Reading Shapefile

Topics: General Topics
Oct 9, 2006 at 6:22 PM
Hi

I am trying to read the information out of a shapefile. I want to draw the map myself, so I need a list of the lines in the shape file. Can anyone please tell me how to get this.

Thank You
Krappies
Coordinator
Oct 10, 2006 at 10:37 PM
Hi,

Just initiate a datasource, which is a shape file in your case
and then retrieve all features.

            SharpMap.Data.Providers.ShapeFile shp = new SharpMap.Data.Providers.ShapeFile(@"f:\area.shp");
 
            
            Collection<uint> GeomIds = new Collection<uint>();
            GeomIds = shp.GetObjectIDsInView(myShapeLayer.DataSource.GetExtents());
            
            SharpMap.Data.FeatureDataRow fdr;
            foreach(uint id in GeomIds)
            {
           	.
            	.
            	fdr = shp.GetFeature(id);
            	.
            	.
            }
Oct 15, 2006 at 7:26 PM
thank you.

i have now wrote my own reader, but thank you anyways.