Import/Catalogue/Railway Import Norway

From OpenStreetMap Wiki
Jump to navigation Jump to search

This import provides the main railway tracks, all stations (including stop positions) and kilometer positions in Norway from BaneNOR, the national railway infrastructure company.


The Norwegian railways are already in OSM, however, they have in many cases a rough geometry. The goal of this project is to:

  • Make the main tracks available with a better geometry
  • Update stop positions and stations with more accurate data
  • Add stop positions not currently in OSM (only 166 stop positions of the total 508 are in OSM)
  • Add stations/halt not currently in OSM, mostly historic stations (only 580 stations/halts of the total 852 are in OSM)
  • Make kilometer positions available


15 December 2017 - Explicit permission and data obtained from BaneNOR.

03 March 2018 - Import plan submitted to the Norwegian mailing list

07 March 2018 - Import plan submitted to the Import mailing list.

Import Data


Data source site: Dataset provided by
Data license: NLOD -
Type of license (if applicable): Norwegian Licence for Open Government Data
Link to permission (if required): Explicit permission obtained 15 December 2017 - Link to permission
OSM attribution (if required):
ODbL Compliance verified: Yes, explicit permission obtained

This dataset only contains the main line (i.e. right side) of the railway tracks. Any parallell tracks unfortunately have to be deduced. Heritage/museum tracks are included as well as the most recently disused tracks and tracks currently under construction.

Norwegian railways are documented in Banedata 2004 (also available for download) and in the more recent Banedata 2013 edition. Individual railway lines and stations are also well documented in Wikipedia: Jernbanen i Norge. BaneNor has made available various resources here

OSM Data Files

The original data files may be inspected in this Google Disk folder. The folder Banenettverk_samla_lett.gdb contains the entire dataset as provided by BaneNOR. Shapefiles were also provided as 4 separate datasets and they have been converted into the following OSM files:

  • Banelenke.osm - Railway tracks
  • Stasjonsnode.osm - stations/stop positions
  • Kilometerpunkt.osm - Kilometer positions
  • Banekjedebrudd.osm - Breaks in kilometer positions due to track alterations

The OSM files to be imported are:

  • Railway.osm - Tracks with stop positions and kilometer positions
  • Stations.osm - Station nodes (next to the tracks)

For the time being, the original internal data attributes have been kept in the Railway.osm and Stations.osm files along with proper OSM tagging. The internal attributes will be removed before the import.

Import Type

The import approach is two-fold:

  1. The stations and stop positions will be conflated with the current OSM data as a one-time import.
  2. The railway lines will be provided in a folder for the OSM community to import whenever there is a desire to improve the accuracy of the current railway lines in OSM.

Data Preparation

Data Reduction & Simplification

All 4 files will be combined into one new file called Railway.osm.

The shapefiles already have an appropriate geometry, so no simplification is needed.

Tagging Plans

Railway tracks

The railway lines from Banelenke.osm will be tagged according to the table below. There is no distinction between active railways, railways under construction, disused railways and heritage railways in the dataset, so these different railway types will be tagged according to their status in Banedata or Wikipedia.

Property OSM tagging Original data Comment
Active tracks railway=rail Tracks in regular use
Tracks under construction railway=construction Tracks under construction
Disused tracks railway=disused The tracks are still present but no longer in use
Abandoned tracks railway=abandoned


The tracks have been removed but the former line can still be seen
Overbuilt tracks railway=razed


A former track that has been built upon
Heritage/museum tracks railway=rail


Preserved tracks with heritage/museum use. Replaces earlier railway=preserved tagging.
Railway line id ref=* Banekortnavn (Internal) railway line number/code. It is a 4 letter code such as "DOVB" for the Dovrebanen line with an optional 2-3 letter extension for sidings etc, e.g. "SORB_DNE".
Railway line name name=* Banenavn Full official name of railway line, e.g. "Østfoldbanen østre linje"

As all lines are already in OSM, no more tags will be provided in this dataset.

Stop positions

The stop positions in Stasjonsnode.osm will get the following tagging for one node on the railway track:

Property OSM tagging Original data Comment
Stop position public_transport=stop_position Jernbaneformål=P,B,M One node on the railway track. For passenger traffic only.
Disused stop position disused:public_transport=stop_position Jernbaneformål=P,B,M


One node on the railway track. For passenger traffic only.
Stop railway=stop


One node on the railway track. Not for short crossovers between double tracks ("overkjøringsspor") nor for marking transition from double to single tracks.
Disused stop disused:railway=stop


Jernbanestatus=N,M One node on the railway track.
Name name=* Navn Station/stop name. Do not include "station", "halt" etc in name.
Kilometer railway:position=* Sporkilometer Kilometer position for the station/stop on the railway line

During import, the stop positions must be copied to any parallell main track at the same station. Also, crossover tracks must be tagged with service=crossover.

Stations/halts and crossing loops

There are no additional nodes in the dataset specifically for stations, halts and crossing/passing loop stations. There is, however, data in Stasjonsnode.osm which will be used for updating existing station nodes or creating new nodes if none exists in OSM (a number of crossing loop stations and historic stations).

  • If Jernbaneformål is either P (Passenger traffic), B (Passenger and freight traffic) or M (Museum traffic) then it will be considered a station or halt for passenger traffic.
  • If Jernbaneformål is G ("gods"/freight) then the station will be considered a yard.
  • If Jernbaneformål is K ("Kryssing"/crossing) then the station will be considered a crossing/passing loop station and also a historic/disused station.
Property OSM tagging Original data Comment
Passenger station railway=station Stasjonstype=S


Only for stations with access for passengers.
Passenger halt railway=halt Stasjonstype=I


"Holdeplasser" (stations without switches).

Only for stations with access for passengers.

Disused station disused:railway=station Stasjonstype=S



Disused station. Also for Jernbaneformål=K ("kryssing")
Disused halt disused:railway=halt Stasjonstype=I



Disued halt ("holdeplass")
Freight station railway=yard Jernbaneformål=G Freight station in regular use.
Disused freight station disused:railway=yard Jernbaneformål=G


Disused freight station
Crossing loop stations railway=service_station


Jernbaneformål=K The crossing loop station also happens to be historic railway stations.

end_date=* is missing for these historic stations.

Disused crossing loop station disused:railway=station Jernbaneformål=K


Disused crossing loop station, many of which also happens to be historic railway stations.
Museum station/halt railway:preserved=yes Jernbaneformål=M A station/halt used for heritage railways.
Station name name=* Navn Do not include "station", "halt" etc in the name.
Operational from date start_date=* GyldigFra Date when station was put into service
Disused from date end_date=* GyldigTil Date when station was taken out of service, if any
Traffic type railway:traffic_mode=passenger










A note to clarify station traffic type

All nodes tagged according to the table above will be put in the Stations.osm file.

Changeset Tags

The changesets will be tagged with "Railway import", "source=BaneNOR" and "source:date=2017-12-15" using import user accounts.

Data Transformation

The following data transformations has been done:

  1. The date values in Stasjonsnode.osm has been converted into the correct OSM date format using the script in Also, the decimal separator has been converted from comma to period.
  2. All tracks from Banelenke.osm were copied into the new file Railway.osm with tagging according to the table above.
  3. All stop positions in Stasjonsnode.osm were manually copied into Railway.osm as railway=station/halt/yard/crossover with one node per station representing the station area and tagged according to the table above. All stop positions were also merged into the tracks with one node representing the stop position and tagged according to the table above. Stop positions for "overkjøringsspor" and transitions from double to single tracks were removed.
  4. Whenever a railway track has been altered, the original kilometer positions are no longer correct. The file Banekjedebrudd.osm contains all the points were such a break in kilometer positions has occurred. At these points a note has been manually inserted into the tracks with the value note=Kilometer break at position X km for a distance of Y m as well as railway:position=* for the point.
  5. The resulting file for all 3 datasets is Railway.osm.
  6. Stasjonsnode.osm has been used to create station nodes in the file Stations.osm with tagging according to the table above. Each node has been relocated from the stop position (on the track) to a suitable position on the railway platform.

If someone could help scripting, this additional step will be done:

  1. All kilometer positions in Kilometerpunkt.osm will be merged into the railway tracks from Railway.osm using a script. Each kilometer position will be tagged with railway:position=*. Two decimals will be used, truncating the third decimal (i.e. 10 meter accuracy), to allow for some flexibility for moving the node during import. railway:position:exact=* will not been used because the nodes are likely to be slightly moved by other users. The node carrying the kilometer may keep its coordinates and will just need to be included in the closest way in Railway.osm between the two nodes with the shortest distance to the kilometer node. If the distance to one of these two nodes is less than 10 meters, that node may be deleted. [Need to find someone who is able to script this task]

Optional: It would be great to have a script which carries out all automated transformations for Railway.osm so that it may be repeated for future new revisions of the dataset from BaneNOR.

Data Transformation Results

The final Railway.osm file may be retrieved from this Google Disk folder. This is the import file to be used when there is a desire to replace the current OSM tracks or stop positions for a specific railway line.

The final Stations.osm file will be used to update and to add station nodes (also halts and crossing loops) in OSM next to the tracks.

Data Merge Workflow

Team Approach

The plan is to have all stop positions, stations and crossing loops (both the stop nodes on the tracks and the station nodes next to the tracks) updated in OSM by one or two individuals. The tracks will then be made available for the whole OSM community to import whenever there is a desire to update the existing tracks.

Contributors Noen and Bobcare helped preparing the import plan and the dataset.


If there is uncertainty regarding the import data, the Banedata book in the Google Disk folderwill be consulted.


Here is a typical workflow during import of tracks:

  1. In a new layer, download the relevant railway line from OSM using Overpass API and for example a railway=* query.
  2. Select the desired railway tracks in Railway.osm by searching for the relevant ref=NNNN of the line.
  3. Copy the tracks into your layer.
  4. Work your way through the railway line doing the following modifications:
    • For each tunnel and bridge, split the new tracks at each start and end of the tunnel/bridge, then use Replace Geometry to swap the old tracks with the new. Please make sure that name=* contains the name of the railway line and that tunnel/bridge names are tagged using name:tunnel=* and name:bridge=*.
    • If a section of the existing railway track is tagged with a specific tag (e.g. usage=*), then split the new track for the relevant section and swap that section using Replace Geometry.
    • If a node of the existing railway track is tagged with anything then move that node to the nearest node of the new track (or create a new node on the new track) before replacing the tracks. This way all crossings, switches etc are kept. This is a very important step to avoid losing valuable information already in OSM.
    • If the old track has fewer separate ways than the new tracks, then split the old track at appropriate points before using Replace Geometry so that all new tracks get the old tagging.
    • Please make sure not to move nodes which have a railway:position tag.
  5. Before uploading please verify that all sections of your new tracks got the existing/old tagging (usage=*, electrified=* etc).
  6. Upload your new tracks to OSM, tagging your changeset with source=BaneNOR, source:date=2017-12-15 using your OSM import account.


Conflation is described in the Workflow section above.


The current OSM railways may be inspected in JOSM after including the following TMS imagery for OpenRailwayMap: http://{switch:a,b,c}{z}/{x}/{y}.png ("standard" may be swapped with "signals" or "maxspeed"). Also available as predefined imagery in JOSM.

When in doubt, please consult the Banedata book or the BaneNor track sheets

See also