/swegov-to-osm

Conversion tools for going from Swedish government data to (mostly) OSM-compatible data.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

swegov-to-osm

Conversion tools for going from Swedish government data to (mostly) OSM-compatible data. The purpose of this project was to make government data possible to use together with pbflookup without having to update the C++ code.

Dependencies

This project depends on the following projects:

  • ogr2osm for converting the Shapefiles to OSM
  • osmosis for converting the OSM files into osm.pbf

Examples

To run the conversion chain on a folder of government data from Sweden this command line can be used.

$ python3 convert.py -i /mnt/hgfs/shapes/ -o /home/andpe/out -p '(vgR|Kommun|Lan|bt_riks|mb_riks_centroid).*shp$' default_ruleset.py

This combination of parameters uses /mnt/hgfs/shapes as the input directory and /home/andpe/out as the output directory. The input folder is then filtered looking for files that match the pattern in -p and converts the files from the SHP attributes to OSM attributes using the ruleset specified in default_ruleset.py