Converts N50 map data downloaded from Kartverket (SOSI format) to the OpenStreetMap format (.osm). This is a forked version of kartverket2osm originally made by tibnor, and adds several new OSM area types and has support for Karverket's updated file format.
This README describes the Kartverket-to-OSM conversion scripts. If you've downloaded a zip archive with generated OSM files, you only need to use the replaceWithOsm.py
script, which is described in the section "Oppsett" on the OSM wiki page Topography import for Norway (Norwegian).
- Python 2.7 with NumPy
- sosi2osm by Gnonthgol
- geographiclib for Python
- Bidirectional UTM-WGS84 converter for python
- GDAL - Geospatial Data Abstraction Library
- Install
sosi2osm
:
sudo apt-get install sosi2osm
- Install the packages
NumPy
,Geographiclib
andutm
for Python, e.g. usingpip
:
pip install numpy geographiclib utm
- Install GDAL
sudo apt install gdal-bin python-gdal
- Download the appropriate N50 SOSI files from Kartverket and place the zip files in the N50 folder
- Download the digital elevation models (DEM) files for the same areas as step 1. It's recommended to download the DTM 10 files from Kartverket. Files for the whole country can be downloaded from hoydedata.no. Extract the DEM files into the DEM folder.
- Open the kartverket2osm folder in a terminal window, and run parseAll.sh:
./parseAll.sh
riverturner.py: Turns streams and river such that the first node in way is higher than the last point. Requires utm package with small modification (https://github.com/tibnor/utm)
elevation.py: Finds the elevation of a UTM32 koordinate from statens kartverk DEM files located in child folder DEM.
mergeroad.py: NOT WORKING. Compares ways in a.osm with b.osm. Outputs ways which are in a.osm and is not close to any similar way in b.osm.