Rjgambrel/Trunk highway overpass turbo mashup

From OpenStreetMap Wiki
Jump to navigation Jump to search

This describes an easy way to visualize the trunk highway proposal using the overpass turbo web tool. It provides zoomable output that can either give you a big picture view of the proposal or it allows you to zoom in and see very specific OSM details.

Example screen shots

Here is a middle zoom that shows much of the western portion of Minnesota. Existing trunk roads are in blue. Existing motorways are in red. Cyan shows the proposed trunk roads. They are labelled with the proposal number. Regional centers (tier cities) are also labelled with their tier number and name (see for example: 1 Moorhead).

Overpass turbo view of trunk highway proposal at a middle zoom.

Following is a close in zoom that shows the city of Monticello area. The entire city (tier 2, Monticello) is shown along with I-94 (in red) and US-10 (in blue). Also shown are segments of proposed trunk highways 10a and 10b (refer to the proposal for details). Note that only some segments of the proposal have been tagged as explained in our main page and the helper key description for MN_to_trunk. Before taking the screenshot, I clicked on one of the I-94 red lines and you can see all the tags on that particular section of I-94. You can do that for any displayed result of the query.

Overpass turbo view of trunk highway proposal at a close in zoom.

Towards the end of this writeup are a couple other screen shots at other zoom levels.

How to run the query

After browsing to the overpass turbo web site, press the Wizard button near the top of the page. For this query it does not matter what the map shows at this time. If you are not familiar with overpass turbo, you can refer to OSM wiki overpass turbo page for more information.

1) Basic wizard query input

Press the Wizard button at top, then enter the following text in the wizard pop up:

highway=motorway or highway=trunk or MN_to_trunk=* or MN_city_tier=* or MN_metro=TC in Minnesota

Then press the build query button. The wizard will generate some query text which will be visible in the left pane.

This query finds all motorways and trunk highways and all road segments with the MN_to_trunk tag set. It also finds all of the Minnesota tier cities and those marked as the perimeter of the Twin Cities metro area. The query limits the results to what is in Minnesota.

An alternative is to remove "in Minnesota" and position the map window to a smaller section of the map. For instance, this would be a good way to view what is in nearby Wisconsin as well (some metro edge cities are in Wisconsin, as well as some of the trunk proposals.). Areas of the border that might be interesting are: Twin Cities (from Stillwater to Hudson), Duluth Superior, and Winona to La Crosse. Note that the trunk highway proposals for WI are not tagged, but could be if there is interest in the border areas.

2) Increase timeout

Update the timeout value on left side of the screen at approximately line 6 from 25 (seconds) to 90.

[out:json][timeout:90];

3) Add styling information

After approximately line 33, "out body;" insert this styling information.

// trunk proposal number

{{style: way {text: eval("tag('MN_to_trunk')") } }}

// city tier: level & name

{{style: relation {text: eval("tag('MN_city_tier').' '.tag('name')") } }}

// to color highways

{{style:

way[highway=primary]

{color: cyan; width:8; opacity:0.4;}

{text: eval("tag('MN_to_trunk')") }

way[highway=secondary]

{color: cyan; width:6; opacity:0.6;}

{text: eval("tag('MN_to_trunk')") }

way[highway=trunk]

{color: blue; width:6; opacity:0.6;}

way[highway=motorway]

{color: red; width:4; opacity:.8;}

}}

This will adorn the generated output with the colorful roads and output tags showing the trunk highway proposal numbers, city tier numbers and city names.

4) Run the query

Press the Run button at top to actually run the constructed query. When I run the query for all of Minnesota I get a warning message showing the amount of data generated (about 20 Mb). I press the continue anyway button.

Possibly useful variations

You can add additional highway types such as primary and secondary. If you do you might want to add different colors for them.

You can limit the bounding box by dropping "in Minnesota" and zooming the overpass turbo to the area you want before running.

You can drop any of the wizard criteria to see less information.

You can drop the style information in step 3.

Generating a file to upload into ID

This technique works for ID. I do not know how to do any of this for JOSM or any other OSM editor.

To create a GeoJson file that can be uploaded into ID that shows the query results, change the "out body;" line to:

out skel;

This will suppress all of the useful coloring and tagging and more importantly suppress individual highway segment names being imported into ID.

If you do want to import into ID, do steps 1 and 2 above, skip step 3, make the "out skel;" change above, then press the Run button then Export button at the top of overpass turbo. Save the file generated, then in the ID editor select the Map Data icon on right of the screen. There click the three dots on the Custom Map Data button. In the Custom Map Data Settings dialog box, press Choose File, then select your file (the one you exported), and press OK. This may take a few minutes to complete. In ID you will now see all the items selected in the wizard input (step 1 above).

Dropping out some of the information from the query input may be more useful (and faster). Experiment!

Results at other zoom levels

None of these zoom levels might be useful, but are shown here to show some of the flexibility available when zooming in and out. Here is an image showing the entire state of Minnesota

Overpass turbo results zoomed way out

Here is an image showing some of the results at a different zoom level

Overpass turbo results at a different zoom level

This shows the very NW edge of the Twin Cities metro area with I-94 and US-10 heading NW and US-169 heading N. The edge cities are visible and some trunk highway recommendations can be seen as well.