Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #2262

Re: VisualBasic 2 VO - reading ESRI SHP files

From "andrej Terkaj" <aterkaj@task.si>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: VisualBasic 2 VO - reading ESRI SHP files
Date 2011-10-12 13:11 +0200
Organization news.siol.net Planet9 d.o.o.
Message-ID <j73sk2$ppc$1@news.siol.net> (permalink)
References <j715vr$r6i$1@news.siol.net> <f97575ab-a3a9-4153-8d37-22d185b3a86b@q13g2000vby.googlegroups.com>

Show all headers | View raw


Dear Johan !
Thank you for your reply. I know the techical specifications and structure 
for the SHP file. But I adressed my problem with this format to the 
community  using OCX control that
exists hoping that such control (which was probably written by the author 
who spents plenty of hours studying SHP structure) is working properly and 
that I can avoid low level reading.

Best regards

Andrej

"Johan Nel" <johan.nel@xsinet.co.za> wrote in message 
news:f97575ab-a3a9-4153-8d37-22d185b3a86b@q13g2000vby.googlegroups.com...
Andrej,

Here is the link for the shapefile format.

You can read it with pure FOpen(), FRead()

www(dot)esri(dot)com(forwardslash)library(forwardslash)whitepapers(forwardslash)pdfs(forwardslash)shapefile.pdf

Obviously you will need to convert from HEX to Decimal for each of the
values.

HTH,

Johan Nel
Pretoria, South Africa.

On Oct 11, 12:32 pm, "andrej Terkaj" <ater...@task.si> wrote:
> Dear members !
> I have a problem reading Arcview (ESRI) SHP files. I found an OCX control
> which was properly incorporated in my VO programme.
> A tree structure of classes are ShapeFile-->ShapeFields----->ShapeField. I
> have troubles with access method (getting Fieldname class ;
> ShapeFields(ThisData) ). I found an example written in VB6 in technical
> specifications for that OCX control as follows
>
> //--------------------------------- VisualBasic6 code
> Sub ReadShape()
>
> Dim ThisRecord As Long, ThisData As Long, ThisPart As Long, VertCount As
> Long
>
> With ShapeIn
>
> .ReadDataOnMove
>
> .OpenShape "C:\Temp\Polygon.shp", shpOpen
>
> For ThisRecord = 1 To .RecordCount
>
> For ThisData = 1 To .ShapeFields.Count
> ' a line bellow is what I would like to print or get from a SHP file
>
> Debug.Print .ShapeFields(ThisData).FieldName,
> .ShapeFields(ThisData).Value
>
> Next ThisData
>
> .MoveNext
>
> Next ThisRecord
>
> End With
>
> End Sub
> // ----------------End VB Code
>
> I wrote a VO code :
>
> METHOD ReadShape() CLASS TopAppWindow
> LOCAL ThisRecord,ThisData,ThisPart as LONG
>
> LOCAL oSHP as ShapeFiles
>
> local oShFields as ShapeFields
>
> LOCAL oParts as Parts
>
> LOCAL oFld as ShapeField
>
> LOCAL uValue as USUAL
>
> oSHP := ShapeFiles{} // CLASS CREATOR
>
> oSHP:ReadDataOnMove := FullRead
>
> oSHP:OpenShape("G:\Program Files\ESRI\AEJEE\DATA\USA\lakes.shp",shpOpen )
>
> oParts := oSHP:Parts
>
> oShFields := oSHP:ShapeFields
>
> FOR ThisRecord := 1 to oSHP:RecordCount
>
> FOR ThisData := 1 to (oSHP:ShapeFields):Count
>
> // a line bellow doesn't work, because I can't get adequate
> ShapeField
>
> oFld := oSHP:ShapeFields:ThisData // a syntax
> oShp:ShapeFields:ThisData --> ThisData would be an access name which of
> // cours doesn't exists in OCX control
>
> // a syntax
> oShp:ShapeFields.ThisData --> ThisData would be a structure ; VO
> doesn't permitt
>
> // a
> syntax oShp:ShapeFields (ThisData) --> SYNTAX NOT ALLOWED
>
> uValue := oFld:FieldName
>
> next ThisData
>
> NEXT ThisRecord
>
> RETURN self
>
> Thanks in advance
>
> Andrej Terkaj



Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-11 12:32 +0200
  Re: VisualBasic 2 VO - reading ESRI SHP files Carlos Rocha <carlos.rochaDELETETHIS@doossier.com> - 2011-10-11 13:03 +0100
    Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-11 19:29 +0200
      Re: VisualBasic 2 VO - reading ESRI SHP files Carlos Rocha <carlos.rochaDELETETHIS@doossier.com> - 2011-10-11 19:35 +0100
        Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-11 21:44 +0200
          Re: VisualBasic 2 VO - reading ESRI SHP files Carlos Rocha <carlos.rochaDELETETHIS@doossier.com> - 2011-10-12 00:50 +0100
            Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-12 08:52 +0200
            Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-14 15:52 +0200
      Re: VisualBasic 2 VO - reading ESRI SHP files Carlos Rocha <carlos.rochaDELETETHIS@doossier.com> - 2011-10-11 19:37 +0100
  Re: VisualBasic 2 VO - reading ESRI SHP files "Willie Moore" <williem@wmconsulting.com> - 2011-10-11 07:26 -0500
    Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-11 19:54 +0200
      Re: VisualBasic 2 VO - reading ESRI SHP files "Willie Moore" <williem@wmconsulting.com> - 2011-10-11 13:10 -0500
        Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-11 20:30 +0200
          Re: VisualBasic 2 VO - reading ESRI SHP files dlzc <dlzc1@cox.net> - 2011-10-11 14:53 -0700
            Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-12 08:42 +0200
              Re: VisualBasic 2 VO - reading ESRI SHP files dlzc <dlzc1@cox.net> - 2011-10-12 06:46 -0700
          Re: VisualBasic 2 VO - reading ESRI SHP files "Willie Moore" <williem@wmconsulting.com> - 2011-10-11 17:20 -0500
            Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-12 08:48 +0200
  Re: VisualBasic 2 VO - reading ESRI SHP files Johan Nel <johan.nel@xsinet.co.za> - 2011-10-11 23:55 -0700
    Re: VisualBasic 2 VO - reading ESRI SHP files "andrej Terkaj" <aterkaj@task.si> - 2011-10-12 13:11 +0200

csiph-web