MapPoint Spatial Data Import COM Add-in
Microsoft MapPoint 2002
Microsoft MapPoint 2004
Summary: Learn how to use the MapPoint Spatial Data Import COM add-in to import ESRI SHAPE files (.shp) and MapInfo Data files (.mif) into MapPoint. (2 printed pages)
Click here to download the code sample for this article.
The retail version of Microsoft MapPoint cannot read files that were created with high-end Geographical Information Systems (GIS), such as those produced by ESRI and MapInfo. This COM add-in was created so that users of these systems can take such files and integrate them into MapPoint. This COM add-in demonstrates the extensibility that MapPoint offers with its rich object model.
The COM add-in uses Microsoft Visual Basic 6.0 and the new extended MapPoint object model methods to take the native source GIS point datasets and import them as MapPoint pushpin sets. The native GIS polygons, polylines, lines, rectangles, and rounded rectangles are imported to create a layer of MapPoint drawing objects that are displayed on a MapPoint map. Through the MapPoint object model functions you can also set the line color and size, shape fill color, and even move the polygons and lines behind the MapPoint road network.
Once imported into MapPoint, the polygons can be used for visualization and spatial queries of any MapPoint data layers contained on the MapPoint map. For example, you can execute point-in-polygon queries in Visual Basic and export to Excel using the MapPoint application user interface. These can include queries of MapPoint pushpin sets or demographic or end-user data displayed in MapPoint shaded area, shaded circle, sized circle, multiple symbol, pie chart, sized pie chart, column chart, or series column chart datasets. The queries can include multiple layers of information.
When you use the COM add-in, keep the following limitations in mind:
- Once imported into MapPoint, the GIS lines and polylines cannot be added to the MapPoint transportation layer and are not routable. MapPoint recognizes them as simple lines and polylines.
- Occasionally, GIS datasets contain doughnut-shaped objects. The add-in does not support the import of shapes that contain these doughnut-shaped holes.
- The add-in does not support the export of GIS layers that are imported into MapPoint. You can add this functionality, but it requires more extensive Visual Basic code.
To run the COM add-in
- Download the Spatial Data Import sample from this page in the Microsoft Download Center.
- Launch MapPoint, and on the Tools menu, click COM Add-ins.
- Click Add, and then navigate to the folder that contains the downloaded files.
- Click SpatialDataImport.dll, and then click Open.
- In COM add-ins, click OK.
- On the Tools menu, click Spatial Data Import.
- Click Browse, navigate to the folder that contains the download files, select a sample .shp or .mif file, and then click Open.
- In Spatial Data Import, click Start.
- When the Status field indicates that the import procedure is complete, click Close.
The imported data appears on the MapPoint map.