Results 1 to 7 of 7

Thread: How to read .shp files

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    38

    Question How to read .shp files

    Hi,

    I am new to GIS.

    I want to read .shp file, but I dont know how to do this.

    Please guide me or suggest any resource that can help me.

    Any help will be appreciated.

    Thanx.

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    Search for "shp" at http://www.wotsit.org

    Reading shape files isn't that hard, once you've defined the right structures. In VB I suggest to use arrays for reading. Before you read data, you should redim the array. The size of the array comes usually before the data in the shape file. Also, you should use the index file for faster file search.

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    38
    Hi,

    Thanks for your reply.

    But dont know .shp file format.

    Help me.

    Bye.

  4. #4
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    At wotsit you'll find a link to a PDF document describing the shapefile format. It comes from Esri, which has devised the shapefile format. That's all documentation I know of about the shapefile format, and also all documentation I think is necessary.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Looks like an awful format.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    It might be awful, but a lot of GIS formats are that way. I don't think there will be a much easier and more efficient way to store geographical data. GIS datasets can grow very large.
    The most common formats aren't capable of storing arcs, ellipses and other types of curves; just linear geometries. There are also GIS formats which use databases. Oracle Spatial is the most well known. Another ones are GeoMedia and ArcInfo 8.

    Speaking of awful. Have a look at wotsit.org for DGN/ISFF A guy called Frank Warmerdam has a more readable PDF version available of that document. I don't have an url at hand.

  7. #7
    New Member
    Join Date
    Nov 2009
    Location
    South Africa
    Posts
    10

    Re: How to read .shp files

    Have a look at http://www.mapwindow.org/
    With the ActiveX loaded you can use the following code to read in .shp files into a MapView

    Code:
    Private Sub cmdOpenSHP_Click(ByVal sender As System.Object, ByVal e 
    
    As System.EventArgs) Handles cmdOpenSHP.Click
            Dim myShape As New MapWinGIS.Shapefile
            OpenFileDialogShp.Filter = "Shapefiles(*.shp) | *.shp"
            OpenFileDialogShp.ShowDialog()
            If OpenFileDialogShp.FileName = "" Then Exit Sub
            myShape.Open(OpenFileDialogShp.FileName)
            mapView.AddLayer(myShape, True)
    
        End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width