Main Content

Export Vector Geodata

When you want to share geodata you are working with, Mapping Toolbox™ functions can export it two principal formats, shapefiles and KML files. Shapefiles are binary files that can contain point, line, vector, and polygon data plus attributes. Shapefiles are widely used to exchange data between different geographic information systems. KML files are text files that can contain the same type of data, and are used mainly to upload geodata the Web. The toolbox functions shapewrite and kmlwrite export to these formats.

To format attributes, shapewrite uses an auxiliary structure called a DBF spec, which you can generate with the makedbfspec function. Similarly, you can provide attributes to kmlwrite to format as a table by providing an attribute spec, a structure you can generate using the makeattribspec function or create manually.

For examples of and additional information about reading and writing shapefiles and DBF specs, see the documentation for shapeinfo, shaperead, shapewrite, and makedbfspec. For information about creating KML files, see Export KML Files for Viewing in Earth Browsers.