Skip to main content

Vector Formats

  • 3 minutes to read
In This Article

This document lists supported vector formats, and explains how to import and visualize data from these formats in a map control.

#Shapefiles

A Shapefile (Esri Shapefile) is a vector format that represents geographic data (e.g., rivers, lakes, and countries) using geometries (e.g., points, polylines, and polygons). These shapes (stored in the .shp file) are associated with data via attributes displayed in columnar format (the .dbf file).

The vector format can also represent such supplemental information as a geographic name or temperature. See the Shapefile topic to learn more.

ShapefilesSupport

To load shapes from a Shapefile, do the following.

NOTE

Make sure that the Build Action property of both shape files is set to Resource.

When data is loaded from a Shapefile, the Map control generates a collection of vector items objects stored in a VectorLayer. Note that in this case, data from a .dbf file is stored as attributes in each vector item object. This approach allows you, for instance, to use this data to colorize shapes or display supplementary information in shape tooltips.

To learn how this can be done, see the Lesson 3 - Load Shapes Data from a Shapefile and How to: Colorize Map Contours Using the Choropleth Colorizer examples.

#KML

With the Map control, you can load and depict any set of geographic visualization data (place marks, polygons, images, textual descriptions, etc) created in the KML (Keyhole Markup Language) format.

The KML file has a tag based structure with nested elements similar to the XML standard. For more information, see the following link: KML tutorial.

One of the common usage scenarios for the KML format is to display vector data above an image tiles map. For instance, the image below shows a route line loaded from a KML file.

The image below shows a route line with pushpins loaded from a KML file.

KMLFileData

To load geographic data from a KML file, do the following:

NOTE

Make sure that the Build Action property of a KML file is set to Resource in the Properties windows.

The following example demonstrates how to load data from a KML file and visualize it in the map control: How to: Load Data from a KML File.

See Also