Convert Lantmäteriet topography data into files for OpenStreetMap.
Usage: python3 topo2osm.py <municipality> [<category>] [-options]
Paramters:
- municipality - Name of municipality or 4 digit municipality number.
- category - Optional, one of the following data categories (themes) in the topography datasets:
Anläggningsområde
- Landuses for industry, leisure and public usage. Useful for airports and sport pitches/tracks.Byggnadsverk
- Special buildings/structures such as communication masts, towers, chimneys etc. Use building2osm to get buildings with better data.Hydro
/Hydrografi
- Waterways. Used in theTopo
(default) category.Höjd
- Mountains/peaks.Kommunikation
- Hiking related features such as routes and snowmobile trails. Use nvdb2osm to get highways with better data.Kulturhistorisk lämning
- Heritage and archeological sites. Only provided with raw geojson output. Not provided for Topography 10.Ledningar
- Power lines and transformer station areas.Mark
- Land cover features such as wood, wetland, farmland and industrial/residential areas.Naturvård
- National parks, nature reserves and other protected areas. Use reserve2osm to get protected areas with better data (to be extended for Sweden).- If no category is provided, a combination of
Mark
andHydrogrfi
will be produced, including place names (also called categoryTopo
).
- options:
-seanames
- Include place names in the sea, such as bays, straits etc.-baynames
- Include place names which are parts of lakes and rivers, such as bays, straits, still water etc.-wetland
- Try to merge boundaries of wetland with wood and other topological features.-nosimplify
- Do not simplify or concatenate geometry lines before output.-geojson
- Output raw topo source data in geojson file.
- Requires GeoPandas library.
- Requires to download Topography 10 (or Topo 50, 100, 250) files downloaded from Lantmäteriet Geotorget (minimum the file corresponding to the selected category above, usually Mark and Hydro(grafi)).
- Requires permission to Municipality boundaries api at Lantmäteriet Geotorget.
- Recommended to download the file ortnamn_sverige_multipoint.geojson) to get names on lakes, wetland, islands and rivers.
- Recommended to download the Hydrografi files for Topography 100 and for Topography 250 to get meaningful waterway=river tagging.
- The topo data is loaded from Lantmäteriet's Geotorget service. The data is free, but you need to apply for each dataset. Remember to say that you intend to use it for OpenStreetMap.
- The dataset Topografi 10 is supported, as well as Topografi 50, 100 and 250.
- OSM relations are automatically created based on polygons and segment lines in the dataset. Note that wetland is in general not connected to other features. This will result in overlapping ways and nodes from wetland.
- Place names are derived from the dataset Ortnamn at Lantmäteriet, combined with coordinates used by each Topografi datasets. A few category corrections are made.
- River centerlines for waterway=river in water=river polygons are missing, but will hopefully be available if permission to use the Hydrografi dataset is obtained from Lantmätriet.
- Parts of he program has exponential complexity. Most municipalities will run in a few seconds, large municipalities will run in minutes, while the largest municipalities might require more than an hour to complete.
- A few FIXME=* tags are produced for place names whenever there are more than one name for an feature. Overlapping names are sorted by appearence in the various topo maps by Lantmäteriet (Topografi 250 with highest rank, then 100 etc).
- Enclaves in municipalities are disregarded, i.e. everything within the outer boundary of the municipality is included. Exclaves are included for completeness.
- See example files at Topo Sverige on Jottacloud.
- v0.4: Loads municipality boundary from Lantmäteriet api; Enclaves are disregarded; Minor fixes and improvements.
- v0.3: Initial Beta version. A few minor improvements to be done.
- Topografi 10 content description at Lantmäteriet Geotorget.
- Geotorget at Lantmäteriet.
- Example files on Jottacloud.
- building2osm on GitHub - Produces OSM files with buildings.
- nvdb2osm on GitHub - Produces OSM files with highways.
- reserve2osm on GitHub - Produces OSM files with protected areas.
- n50osm on GitHub - Similar program for N50 in Norway.