PDA

Click to See Complete Forum and Search --> : How to read .shp files


shaileshganatra
Jan 21st, 2003, 12:28 AM
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.

riis
Jan 23rd, 2003, 05:20 AM
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.

shaileshganatra
Jan 23rd, 2003, 01:00 PM
Hi,

Thanks for your reply.

But dont know .shp file format.

Help me.

Bye.

riis
Jan 24th, 2003, 07:08 AM
At wotsit you'll find a link to a PDF document describing the shapefile format. It comes from Esri (http://www.esri.com), 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.

CornedBee
Jan 25th, 2003, 09:11 AM
Looks like an awful format.

riis
Jan 25th, 2003, 01:08 PM
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.

SandraMF
Nov 10th, 2009, 10:09 AM
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

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