Nevron Open Vision Documentation
ESRI Shapefiles

The ESRI shapefile is a popular geospatial vector data format, which contains geographical data and is widely used by geographical information system (GIS) software. An ESRI shapefile typically has an "shp" file extension and contains information about the geometry of different geographical objects called features, for example country boundaries, rivers, cities and so on. It's accompanied by a a file in the dBase format (DBF file), which contains attributes for each shape. For example if the shapefile is about the countries in the world, the DBF file may contain information about the name, the area, the population and the GDP of each country.

NOV Diagram provides support for importing of ESRI shapefile data through the NEsriMapImporter class. The shapefile data can come from a file on the disk, from a stream or from a resource embedded in your NOV application. To add ESRI shapefiles to the importer use the AddShapefile method of the ESRI map importer.

Shapefile Properties

The NEsriShapefile class exposes the following properties you can use to configure the way the shapes are imported in the drawing document and their behavior:

Note that you should configure all properties of the shapefiles you want prior to calling the Import method of the map importer.
Code Example

The following piece of code demonstrates how to create an ESRI map importer, add a shapefile to it and import the shapes from the shape file to a drawing document:

ESRI map import
Copy Code
// Create a map importer
mapImporter = new NEsriMapImporter();

// Add a shapefile
NEsriShapefile countries = new NEsriShapefile(NResources.RBIN_Maps_countries_zip);
countries.NameColumn = "name_long";
countries.TextColumn = "name_long";
countries.MinTextZoomPercent = 50;
countries.FillRule = new NMapFillRuleRange("pop_est", NColor.White, new NColor(0, 80, 0), 12);
mapImporter.AddShapefile(countries);

// Read the map data
mapImporter.Read();
mapImporter.MapBounds = WorldBounds;

// Import the map data
mapImporter.Import(drawingDocument, page.Bounds);
See Also
Send Feedback