Scenario-Convert Tool

scenario-convert does not belong do the open-source part of Eclipse MOSAIC and must be obtained separately.

Yet, you can use scenario-convert for free to generate scenarios which are executable with Eclipse MOSAIC. Get it here.

Download scenario-convert from DCAITI mirror
  1. Download the scenario-convert-24.1.zip/tar.gz bundle from the mirror above.
  2. Extract the package to an arbitrary path. It is recommended to extract the package in the very same directory as MOSAIC (<mosaic-root>).
  3. Use the call scenario-convert.bat/sh on the command line to execute the tool.

Usage of scenario-convert

The Create a new Scenario Tutorial provides a detailed introduction to the scenario-convert tool.

The following listing shows an overview for the usage of scenario-convert:

usage: scenario-convert [OPERATION] [OPTIONS]

Examples:
1. Import an osm file and write data into database
   > scenario-convert --osm2db -i <OSMFILE> [-d <DATABASE>]
2. Export database content to SUMO-readable files
   > scenario-convert --db2sumo -d <DATABASE> [-s <SUMOPREFIX>]
3. Import a SUMO routefile into a database
   > scenario-convert --sumo2db -d <DATABASE> -i <ROUTEFILE>.rou.xml
4. Combine steps 1 and 2
   > scenario-convert --osm2sumo -d <DATABASE> -i <OSMFILE> [-s <SUMOPREFIX>]
5. Export db content to GeoJson files (e.g., for visualization)
   > scenario-convert --db2geojson -d <DATABASE>
6. Import an srtm file and write elevation data to nodes of an existing database
   > scenario-convert --srtm2db -i <SRTMFILE> -d <DATABASE>
7. Create a complete MOSAIC scenario from an osm file
   > scenario-convert --osm2mosaic -i <OSMFILE>
8. Create a scenario database from a SUMO net file
   > scenario-convert --sumo2db -i <NETFILE>.net.xml --import-zone 33n
9. Calculate a route from node 123 to node 456
   > scenario-convert --generate-routes -d <DATABASE> --route-begin-node-id 123 --route-end-node-id 456

The following arguments are available:
 -h,--help                                 Prints this help screen.

 -c,--config-file <PATH>                   Optional, refers to a configuration file which contains all parameters in
                                           JSON format.
    --osm2db                               Converts a OpenStreetMap file to a new scenario database.
    --sumo2db                              Imports a SUMO Network/Routefile. Be aware, that creating a scenario based on
                                           a Network file is not fully compatible with MOSAIC.
    --srtm2db                              Imports an SRTM file and writes elevation data to nodes.
    --db2sumo                              Exports the network to SUMO node and edge files.
    --db2geojson                           Exports the database into GeoJSON format.
    --db2mosaic                            Creates directory structure for a MOSAIC scenario based on the database
                                           contents.
    --osm2sumo                             Combination of osm2db and db2sumo.
    --osm2mosaic                           Combination of osm2db and db2mosaic.
    --update                               Updates the database to the current scheme.

 -d,--database <PATH>                      The path to the database.
                                           For import: File to import to. If not given, a new file is created.
                                           For export: File to load from.
                                           For update operations: file to update.
 -i,--input <PATH>                         Defines an input file to use in an import. File type depends on the import
                                           operation (OSM File/Database file/SUMO net file/SUMO rou file).
 -s,--sumo-prefix <STRING>                 Prefix for the generated sumo files  (uses database name when not defined).
 -f,--force                                Force overwrite of existing files instead of incrementing file names.
 -m,--mapping-file <PATH>                  Uses the given mapping configuration to export existing vehicleTypes and
                                           vehicles data to *.rou.xml.
    --import-lat <DOUBLE>                  Center latitude of imported region to project coordinates.
    --import-lon <DOUBLE>                  Center longitude of imported region to project coordinates.
    --import-zone <STRING>                 UTM zone of location for projecting coords in default format (e.g. 32u).

 -g,--generate-routes                      Generates route(s) from one point to another. The begin and end for the route
                                           must be known (see below options). All generated routes will be added to the
                                           database.
    --clear-routes                         Clear route(s) from the database before adding new ones during route
                                           generation (only with --generate-routes).
    --route-begin-lat <DOUBLE>             Latitude of the starting point, needs --route-begin-lon as well.
    --route-begin-lon <DOUBLE>             Longitude of the starting point, needs --route-begin-lat as well.
    --route-begin-latlon <DOUBLE,DOUBLE>   [latitude],[longitude] of the starting point.
    --route-begin-node-id <STRING>         OSM node id of the starting point (use instead of lat/lon).
    --route-end-lat <DOUBLE>               Latitude of the starting point, needs --route-end-lon as well.
    --route-end-lon <DOUBLE>               Longitude of the starting point, needs --route-end-lat as well.
    --route-end-latlon <DOUBLE,DOUBLE>     [latitude],[longitude] of the ending point.
    --route-end-node-id <STRING>           OSM node id of the ending point (use instead of lat/lon).
    --route-matrix <STRING,STRING,...>     Calculates all possible routes starting and ending at the given nodes, given
                                           as comma-separated list (e.g. 12345,87123,89123)
    --max-number-of-routes <INTEGER>       Defines the maximum number of routes to be calculated, including the best route and alternatives (default=1 - only best route).

    --import-buildings                     Activates import of building information (only with osm2xxx).
    --skip-osm-filter                      Skips automatic filtering of the OSM file (only with osm2xxx).
    --skip-turn-restrictions               Ignore all defined turn restrictions on OSM import.
    --split-connections                    Connections are built for each adjacent node during OSM Import instead of
                                           having geometry nodes. This results in much larger networks.
    --skip-graph-cleanup                   Turns off the removal of unconnected parts from the main traffic network
                                           graph . Since several components of MOSAIC require one main graph without
                                           disconnected ways and nodes, this option should be used only if the cleanup
                                           procedure is faulty.
    --skip-netconvert                      Skips starting sumo netconvert for creating netfile (only with xxx2sumo).
    --skip-traffic-lights-export           Skips exporting traffic light information for nodes (only with xxx2sumo).
    --osm-speeds-file <PATH>               Define a property file which contains speed information which are used to set
                                           the speed for OSM ways without a max speed tag (only with osm2xxx).
    --osm-speeds-overwrite                 If set to true , the maxspeed tags of ways are ignored and replaced by either
                                           default values , or by speed information defined via the --osm-speeds-file
                                           option (only with osm2xxx).

Configuration-files for scenario-convert

Scenario-convert offers a way to safe your conversion-parameters in a JSON configuration file using the option -c or --config-file.
The following listing shows how to save the options used in the example above:

{
  "operatingMode": "osm2mosaic",
  "inputFile": "steglitz.osm",
  "executeOsmosis": true,
  "generateRoutes": true,
  "routeBeginLatLon": "52.457616,13.318392",
  "routeEndLatLon": "52.454774,13.333554",
  "numberOfRoutes": 3
}

Speed-files

Below you can find a properties file which can be used during the import of OSM data in order to define speeds for ways, which do not have a maxspeeds-tag defined. For this purpose use the option --osm-speeds-file <FILE>. In the speed properties file, for each way type a speed value can be defined, according to the OSM highway key.

# the unit the speed values are defined in [kmh, ms]
speed.unit = kmh

# the default speed for all way types which are not defined here
speed.default = 30
        
# autobahn
highway.motorway = 130
highway.motorway_link = 70

# bundesstrasse (germany)
highway.trunk = 70
highway.trunk_link = 65

# linking bigger town
highway.primary = 65
highway.primary_link = 60

# linking towns + villages
highway.secondary = 60
highway.secondary_link = 50

#streets without middle line separation
highway.tertiary = 50
highway.tertiary_link = 40
highway.residential = 30

#special roads
highway.living_street = 5
highway.service = 20

# unclassified roads
highway.unclassified = 30
highway.road = 20

# forest tracks
highway.track 15