Train Simulator NEXT
In This Topic
    importOSM
    In This Topic

    importOSM is a tool to import Open Street Map files (.osm or .shp) into Train Simulator -NEXT.

    Location

    The tool is located in the [root]/Tools/ directory.

    Calling Conventions

    importOSM
        (detail_level <i>)
        (-import_all)
        (-connectWD)
        (-region <s>)

    Arguments

    Argument Description Remarks
    detail_level <i> Sets the selection of data, to be imported.
    i = 0 = Railroads only.
    i = 1 = Railroads and main roads.
    i = 2 = Railroads, main roads, power lines and main waterways.
    i = 3 = Railroads, main roads, power lines, main waterways (, major water areas).
    i = 4 = Railroads, main + local roads, power lines, main + local waterways (, all water areas).
    Default is 3.
    -import_all Imports all supported data. = detail_level 4
    -connectWD Calls connectWD def -optimize -cache, after the files have been created.
    -region <s> Sets the output region; i.e. "region EU" leads to output file "EU_FileName.WorldData".

    Additional System Requirements

    Component Minimum Minimum
    Main Memory 32 GB for osm files ≤ 8 GB 64 GB for osm files > 8 GB

    If not enough capacity is available, extend your virtual memory to the required size.

    Step by Step Guide

    1. Download the requested data from https://geofabrik.de .
      The files should be small enough chunked; i.e. download each area of Germany instead of the complete map.
    2. Extract the data to [root]/Tools/OpenStreetMaps/ . Create the directory, if it doesn't exist.
    3. Store "not-to-process" files into the [root]/Tools/OpenStreetMaps/tmp directory.
      All files from one sub-directory will be processed, except the Output/ and tmp/ directories.
    4. Run importOSM with the desired arguments (use cmd or powershell).
    5. The Output/ directory will contain files in the form of (N|S)xx_(E|W)yy.WorldData files (World Network Tiles).
    6. Post-process the files with connectWD.

    If you want to process a complete area or region in one step:

    1. Do steps 1 to 3 as above.
    2. Call importOSM -connectWD. Wait.
    3. Rename the Output.WorldNetwork and Output.WorldIndex to the region.
    4. Copy them into the [root]/Resources/Data/World Network/ directory.

    Remarks

    OSM import remarks

    The import process of osm files is memory heavy! A general rule for the required memory consumption is size_of_file * 3.5.

    SHP import remarks

    Extract the contents of the archive. The content of the data will be parsed by its file name. To import a shp file, the dbf file is required too.

    The data quality of shp files is lower than of osm files, as osm files contain more details about e.g. a way.

    Basic rules

    The basic rules to import data is:

    Detail Levels

    The tools supports to handle the Detail Level 3. The Detail Level 3 did contain water areas. This isn't the case currently, as the Open Street Maps data doesn't contain valid polygons and needs a lot of post-processing. In future versions, water areas will be contained again.

    Detail Level 4 includes all minor streets and minor water ways. Use this data only for areas of interest.