Build Roads Using OpenStreetMap Data
OpenStreetMap® is a free, open-source, web map service that enables you to access crowd-sourced map data. Using RoadRunner, you can import and preview map data from an OpenStreetMap file and use it to build roads.
Import OpenStreetMap File
To import OpenStreetMap data, you must first select an OpenStreetMap file containing road geometry. To get these files, visit openstreetmap.org
,
specify a map location, manually adjust the region around this location, and export the
road geometry for that region to an OpenStreetMap file with extension .osm
. OpenStreetMap exports only the roads whose whole lengths are within the specified
region. In this example, you use an OpenStreetMap file previously exported from the website.
Open the SD Map Viewer Tool from the toolbar by clicking the SD Map Viewer Tool button.
Click the Open OpenStreetMap File button on the toolbar to the left of scene editing canvas.
In the Open OpenStreetMap File dialog box, browse to this file, select it, and click Open.
RRInstallFolder/bin/platform/AssetsInstall/SampleFiles/city.osm
RRInstallFolder
is your local RoadRunner installation folder.platform
is the folder name for your OS platform.
The file was downloaded from
https://www.openstreetmap.org
, which provides access to crowd-sourced map data all over the world. The data is licensed under the Open Data Commons Open Database License (ODbL),https://opendatacommons.org/licenses/odbl/
.
The SD Map Viewer Tool imports SD Map data that intersects your workspace, converts the data into a preview called an SD Map, and displays the SD Map in the scene editing canvas. The SD Map displays the nodes and links of the road data.
Note
When you import an OpenStreetMap file into a new scene, the SD Map Viewer Tool automatically sets the world origin using the geographic bounds specified in the file. However, to successfully import an OpenStreetMap file into an existing scene that has an already specified World Origin, the geographic bounds specified in the file must approximately match the World Origin value of the existing scene.
OpenStreetMap does not specify road junction information. When a road intersects another road, the SD Map Viewer Tool generates a separate link for each segment of the intersecting roads before and after the intersection. This means that when two roads intersect at a common point, the tool splits each of the link into two links to facilitate junction creation. Essentially, two links would be split into four links with a common node at intersection. As a result, the number of generated links does not match the number of roads specified in the OpenStreetMap file.
When you import an OpenStreetMap file into a scene, RoadRunner imports only drivable highway roads with these values:
unclassified
,motorway
,trunk
,primary
,secondary
,tertiary
,residential
,motorway_link
,trunk_link
,primary_link
,secondary_link
,tertiary_link
,living_street
,service
,raceway
, androad
.
Explore Imported Data
Explore the imported data by selecting links and nodes. You can view their attributes in the Attributes pane. The type of road element selected in the SD Map scene editing canvas determines the available attributes.
Simple Link
Id — Unique identification number for the selected link.
LayerId — Unique layer identification number for the selected link.
Skip During Build — Specifies whether to add or skip this link during the build process. If you select this attribute, the SD Map represents this link as a dashed line, and the link is ignored in the build process. To include the link in the build process, which displays it as a solid line, clear this attribute.
If you clear the Skip During Build attribute , the SD Map Viewer Tool imports the actual links and displays them as solid lines.
Note
You can click and drag to select multiple links within a rectangular region of interest. You can also hold Shift and click additional links to add them to the selection. You can control the Skip During Build attribute collectively, for all selected links, in the Attributes pane.
Road Width (in meters) — Width of the road corresponding to the selected link. Because OpenStreetMap does not specify the width of a lane or a road, the SD Map Viewer Tool sets the default lane width to 3.5 meters. Road width is the product of the lane width and the number of lanes within a road.
Number of Lanes — Number of Forward and Backward lanes for the road corresponding to the selected link. If the input file does not specify the number of lanes for a road, the SD Map Viewer Tool estimates one lane for each travel direction. By default, one-way roads have one lane, and bidirectional roads have two total lanes, one for each travel direction.
Travel Direction — Direction of travel for the road corresponding to the selected link, specified as
Forward
,Backward
, orBidirectional
. If the input file does not specify theoneway
tag for a road, the SD Map Viewer Tool assumes the road is bidirectional.
Each link has several control points and each Control Point contains a Position attribute specifying its (X,Y,Z) location.
Simple Node
Id— Unique identification number for the selected node.
Connecting Links— Displays all the links connected to the selected node. Each connected link is labelled with its associated ID and orientation.
Build Roads
You can build roads for the imported data using one of these processes.
All data — Build all of the imported data.
Select links — Click and drag to select links within a rectangular region of interest.
You can also delete selected links to avoid building them.
For this example, do not select any links. Click the Build Roads button on the toolbar to the left of the scene editing canvas to open the SD Map Builder dialog box.
In the SD Map Builder dialog box, you can view and modify these options:
Option | Description |
---|---|
Preserve Heights | OpenStreetMap files does not contain road elevation information. By default, this option is not applicable. Dependencies
|
Clear Scene of Existing Data | By default, the SD Map Viewer Tool removes already built roads from your scene when you use it to build a scene. To keep the existing roads in the scene, clear this option. |
Driving Side | By default, SD Map Viewer Tool considers left
side of the road as forward direction of driving. To consider
right side of the road as forward direction of driving, select
|
Enable Overlap Groups | Enable Overlap Groups — By default, the SD Map Viewer Tool does not create automatic junctions at road overlaps. To create junctions, the tool uses explicit junction information specified in the imported SD map data. To create automatic junctions at geometric overlaps, clear this option. For more information on overlap groups, see Prevent Creation of Automatic Junctions Between Roads. When you select the Enable Overlap
Groups attribute, the tool sets the
Overlap Group Name attribute to
|
Elevate Roads by Layer | OpenStreetMap files does not contain road elevation information and the imported files may contain overlap roads. To elevate bridges using layer information, enable this option. To get better build results of elevated bridges, enable the Preserve Heights and Auto Detect Bridges options, as well. Dependencies
|
Create Turn Lanes | Turn lane indicates the forward or backward direction of the road in a bi-directional way. By default, imported roads do not contain turn lane markings. To include turn lane markings using turn lane information, enable this option. Dependencies
|
Auto Detect Bridges | If you select this option, the SD Map Viewer Tool creates bridges at road intersections when the roads have different elevations. By default, the tool extends the bridges by 20 meters on either side of the intersection. You can change the length of the extension by changing the Bridge Span Inflation value. To prevent the tool from creating bridges, clear this option. For more information, see Road Construction Tool. Dependencies This option is applicable only when the Elevate Roads by Layer option is enabled, and the imported OpenStreetMap file contains layer information. |
Build Info | Displays the link length and number of links in all the imported data, as well as in the selected subset of roads in the scene. |
To build all roads in the scene, click Build All. If you want to build only a subset of the roads in the scene, select the links you want to include in the scene, and click Build Selected.
For this example, use the default options to build the scene.
You can also build roads by enabling the Elevate Roads by Layer
and the Create Turn Lanes options. Note that the
city.osm
file contains the layer and turn lane
information.
Note
To access the Elevate Roads by Layer and Create Turn Lanes options, you must have a RoadRunner Scene Builder license.
You can visualize the elevated bridges and overpasses at roads and junctions with turn lane markings in the built scene.
After you build roads, you can modify the scene in RoadRunner. You can also export the scene to ASAM OpenDRIVE® file. For more information, see Export to ASAM OpenDRIVE.
If RoadRunner detects lane marking overlaps when building roads, then might display this message in the SD Map Builder Results dialog box:
>WARNING: Lane marking overlaps detected. Adjust road centers at these
locations
To resolve this issue, open the Road Plan Tool, click-navigate to the overlap locations, and adjust the road centers.
Troubleshoot Import and Build Issues
Depending on the region from which you build map data, you might encounter issues when the SD Map Viewer Tool imports data and builds roads. Follow these steps to fix these known issues.
Gap
Issue | Solution |
---|---|
The built road contains gaps between roads at intersections. | Open the Custom Junction Tool, navigate to the affected junction, and increase the ray Distance in the Attributes pane. Ray is the red line displayed when you select the Custom Junction Tool. It is used to adjust the junction boundaries. |
Steep Road Meshes
Issue | Solution |
---|---|
The built road contains steep rises or falls in the road meshes at road junctions. | Open the Corner Tool, navigate to the affected junction, and reduce the Corner Radius in the Attributes pane. |
Roads Under Terrain
Issue | Solution |
---|---|
The built scene contains roads under the terrain. | Open the Surface Tool, navigate to the affected location, and manually adjust the terrain. |
Limitations
RoadRunner does not support direct import of live map data from
openstreetmap.org
.Because OpenStreetMap data does not contain elevation information for roads, RoadRunner builds bridges or overpasses that cross a road as intersecting roads.
Some issues with built roads might be due to missing or inaccurate map data in the OpenStreetMap service. To check whether data is missing or inaccurate due to the map service, view the map data on an external map viewer.
See Also
SD Map Viewer Tool | Custom Junction Tool | Corner Tool | Surface Tool
Related Topics
- Build Roads by Using Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) Data
- Export to ASAM OpenDRIVE
- Importing ASAM OpenDRIVE Files