Tuesday, August 31, 2010

A kml to shapefile converter

Tool: FWTools
Download link: http://fwtools.maptools.org/

At the command line prompt, use the following syntax
Syntax:
Ogr2ogr -f “ESRI Shapefile”

Example 1:
To convert sample.kml located in C:\Test and save the converted shapefile in the same folder,
C:\>Ogr2ogr -f “ESRI Shapefile” C:\Test\sample.shp C:\Test\sample.kml


Things to remember:
1. Only KML files can be converted to *.shp. If the file is in KMZ format, save as “KML” before conversion.
2. The KML file name should not contain white spaces. The best practice is to use “_” or “-“ as separators instead of a space.
3. The coordination system of the shapefiles may need to be changed because Google Earth's native coordination system is
• Geographic Coordinates (latitude/longitude) GCS_WGS_1984
• Datum: D_WGS_1984

No comments:

Post a Comment