Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 138 commits ahead of andrewguertin:master.

test-py2 test-py3

A tool for converting ogr-readable files like shapefiles into .osm data

!!! Notice !!!

This version is no longer maintained, do not file new issues or pull requests here. Development will continue here.


ogr2osm requires gdal with python bindings. Depending on the file formats you want to read you may have to compile it yourself but there should be no issues with shapefiles. On Ubuntu you can run sudo apt-get install -y python-gdal python-lxml to get the software you need.

It also makes use of lxml. Although it should fall back to builtin XML implementations seamlessly these are less likely to be tested and will most likely run much slower.

To install ogr2osm and download the default translations the following command can be used:

git clone --recursive

To update

cd ogr2osm
git pull
git submodule update


This version of ogr2osm is based on Andrew Guertin's version for UVM which is in turn based on Ivan Ortega's version from the OSM SVN server.

ogr2osm will read any data source that ogr can read and handle reprojection for you. It takes a python file to translate external data source tags into OSM tags, allowing you to use complicated logic. If no translation is specified it will use an identity translation, carrying all tags from the source to the .osm output.

Import Cautions

Anyone planning an import into OpenStreetMap should read and review the import guidelines located on the wiki. When writing your translation file you should look at other examples and carefully consider each external data source tag to see if it should be converted to an OSM tag.



  -h, --help            show this help message and exit
						Select the attribute-tags translation method. See the
						translations/ directory for valid values.
  -o OUTPUT, --output=OUTPUT
						Set destination .osm file name and location.
  -e EPSG_CODE, --epsg=EPSG_CODE
						EPSG code of source file. Do not include the 'EPSG:'
						prefix. If specified, overrides projection from source
						metadata if it exists.
						PROJ.4 string. If specified, overrides projection from
						source metadata if it exists.
  -v, --verbose         
  -d, --debug-tags      Output the tags for every feature parsed.
  -f, --force           Force overwrite of output file.
  --encoding=ENCODING   Encoding of the source file. If specified, overrides
						the default of utf-8
						Number of decimal places for coordinates
						Number of decimal places for rounding
  --no-memory-copy      Do not make an in-memory working copy
  --no-upload-false     Omit upload=false from the completed file to surpress
						JOSM warnings when uploading.
  --never-download      Prevent JOSM from downloading more data to this file.
  --never-upload        Completely disables all upload commands for this file
						in JOSM, rather than merely showing a warning before
  --locked              Prevent any changes to this file in JOSM, such as
						editing or downloading, and also prevents uploads.
						Implies upload="never" and download="never".
  --id=ID               ID to start counting from for the output file.
						Defaults to 0.


pnorman's version of UVM's Rewrite of ogr2osm







No releases published


No packages published


  • Python 51.5%
  • Perl 48.5%