ShapefileDataAdapter Class
Data adapter that provides data from a shapefile.
Namespace: DevExpress.XtraMap
Assembly: DevExpress.XtraMap.v19.1.dll
Declaration
Remarks
Currently, the following shapefile element types are supported.
- Point
- PolyLine
- Polygon
- Multipoint
- PointZ (the Z value is ignored)
- PolylineZ (the Z value is ignored)
- PolygonZ (the Z value is ignored)
- MultipointZ (the Z value is ignored)
- PointM (the M value is ignored)
- PolylineM (the M value is ignored)
- PolygonM (the M value is ignored)
- MultipointM (the M value is ignored)
For more information about Shapefile element types, refer to the ERSI Shapefile Technical Description
For more information about this data adapter, refer to the Load Vector Data from a Shapefile topic.
Example
To load shape data from a shapefile do the following.
- Create a
ShapefileDataAdapter
object. - Specify its ShapefileDataAdapter.FileUri property.
- Assign this object as the VectorItemsLayer.Data property value.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-colorize-map-contours-loaded-from-shapefiles-using-the-choropleth-colorizer-e4691
// Create data for the MapLayer.
MapLayer.Data = CreateData();
private MapDataAdapterBase CreateData() {
Uri baseUri = new Uri(System.Reflection.Assembly.GetEntryAssembly().Location);
// Create an adapter to load data from shapefile.
ShapefileDataAdapter adapter = new ShapefileDataAdapter() {
FileUri = new Uri(baseUri, filename)
};
return adapter;
}
Implements
Inheritance
Object
MapDisposableObject
MapDataAdapterBase
CoordinateSystemDataAdapterBase
DevExpress.XtraMap.OuterDataAdapterBase
FileDataAdapterBase
ShapefileDataAdapter
See Also