Converting map data between formats

From OpenStreetMap Wiki
Jump to navigation Jump to search

This page lists tools to convert external map data to and from OSM formats.

GDAL/OGR, ogr2ogr and QGIS – the almost every time working solution

The GDAL/OGR library supports serveral dozens of vector file formats. You can use the ogr2ogr command line programme to convert between them. It is also able to read/write PostgreSQL databases (with PostGIS extension).

A common workflow to get OSM data into a different file format using GDAL is

Using the command line programme ogr2ogr:

  1. Load OSM data into PostgreSQL database using Osm2pgsql or Imposm.
  2. Convert data using ogr2ogr where ogr2ogr reads from the database and writes to your desired output format.

Using the QGIS (no command line required):

  1. Open .osm.pbf file in QGIS
  2. Save in your desired output format.


File type Extension To import into OSM To export from OSM Discussion/Comments
Adobe Illustrator .ai no See Exporting to Adobe Illustrator, OSM2ai and
(by ESRI)
several ArcGIS
E00 e00 partial partial See message 593
Dafif ? dafif2osm no
(by AutoCad)
.dxf DXF_import (JOSM plugin), Dxf2gpx GeoConverter, GDAL/OGR, QGIS See Convert dxf File to Shapefile Using Grass
GADM ? gadm2osm no
Garmin maps .img no OSM Map on Garmin
Geobase ? geobase2osm no
GeoJSON .geojson osm-and-geojson, geojsontoosm, geojson2osm-es6 OSM2GEO, osmtogeojson, Gdal ogr2ogr, osmium export ogr2ogr tips
GeoPackage .gpkg no Gdal ogr2ogr, osm-export-tool
GML ? gml2osm XSLT, Python, GeoConverter See Converting OSM to GML. See JOSM ticket #6921.
Google Earth (Keyhole) Markup Language .kml JOSM/Plugins/OpenData OSM in Google Earth, Osm2KML, GeoConverter, osm-export-tool.
GPX .gpx Import as layer in main site, josm, gpx2csv->csv2osm OGR, QGIS, GeoConverter
MP (Polish format) .mp mp2osm
Persistance of Vision Raytracer .pov no
Shapefile .shp JOSM/Plugins/OpenData GDAL, QGIS, GeoConverter, osm-export-tool See Shapefiles
Smallworld (GE Smallworld datastore) .ds no OpenStreetMap Plug-In

Specialised formats

This lists only very specific formats, mostly dedicated for a specific import.

File type Extension To import into OSM To export from OSM Discussion/Comments
AND ? and2osm no See AND Data
CIA World Database .wdb wdb2osm no
Coastlines .pgs perl script no See Almien coastlines (PGS)
NKF ? Nkf2osm no
Frida ? Frida no
TIGER ?? ? ? See TIGER, most data has been imported

See also

  • For exporting a map as images (PNG, SVG, PDF) please refer to the Rendering page.
  • For a much more general overview, see the Export Guide.