Skip to content

Converting KML files

Koordinates doesn’t support importing KML files. To import KML data, first convert it to a supported format.

This is a relatively technical process, and the following guide is aimed at people with some experience in GIS.

  1. Access ogr2ogr

    To convert KML data, we recommend you use the command line tool ogr2ogr, part of the open source GDAL software package.

    You can get GDAL from the GDAL download page.

  2. Convert to Shapefile

    KML files can be converted to Shapefile with the following command:

    Terminal window
    ogr2ogr -where "OGR_GEOMETRY='POLYGON'" /output_path/output_shapefile_polygons.shp /input_path/input_kml_file.kml
    ogr2ogr -where "OGR_GEOMETRY='POINT'" /output_path/output_shapefile_points.shp /input_path/input_kml_file.kml
  3. Compress and upload

    The resulting files can then be compressed to a single zip file and uploaded to Koordinates.

If your KML contains multiple types of geometries (for example, placemarks as well as polygons), you will need to add a ‘where’ expression to produce separate output files for each geometry type.

Also, note that there are some limitations to the conversion process, including:

  • Regionated or complex network links might be lost.
  • Non-trivial folder structures will not be transferred.
  • Symbology will not be preserved, including placemark icons.
  • Some attribute data might not be copied identically.