This project has moved. For the latest updates, please go here.

Getting the Correlated FeatureDataRecord for a Given Geometry

Topics: Data Access, SharpMap v2.0
Aug 26, 2010 at 11:06 PM

I'm using SharpMap 2.0, and I'm successfully loading a shapefile and parsing through it. The particular shape file that I'm working with has about 700 polygons in it, and each of those polygons has meta data associated with it (the meta data is in the .DBF file). 

How can I get at the meta data for each polygon? I'm not seeing any methods that allow access to this data...

I've searched Google, these forums and have pretty much exhausted my resources trying to figure this one out.

Any help would be greatly appreciated!


Aug 27, 2010 at 7:17 AM
Edited Aug 27, 2010 at 7:25 AM

Hello Jason,

If you'd like to iterate through the Shapefile, you could use ShapefileProvider's ExecuteIntersectionQuery function, which returns a ShapefileDataReader and you can access the metadata over its indexer or the apropriate Get... functions.

If you prefer a FeatureDataTable, you'd have to use a FeatureLayer with your ShapefileProvider (prov) and use prov.Features property. I think You must run a prov.Select(FeatureQueryExpression.Intersects(<rectangle>)) on the layer first, I think. The result of the prov.Select(...) is of type IEnumerable<FeatureDataRecord>.