# How To Retrieve All Highway By Certain Area With Relevant Values?

 1 Hello Guys I'm Newcomer Here. Recently I Have A Project Want To Use OSM With Overpass API. My Requirements Are: Retrieve All Streets (Highway) In A Specified Area. I Know This Is Possible By Kinds Of Ways. For Example Set Query Type As Boundary And Boundary Type = Admin Then Admin Level = N Or By Area With Area ID (Relation ID). I Need To Get A Lists Of All Highways With Way Type (For Example Motorway / Trunk / Primary / Secondary / Tertiar) And Availability Of Driving And Direction (For Example Is That Way A West-Eastward Way Or North-Southward Way . My Question Is That Possible To List All Roads With All Required Values? I Also Need All Corresponding Nodes (Longitude / Latitude) In A Road (Highway). Does Overpass API Support To Get Nodes Relation Of A Highway? If I Need Only A Few Nodes In A Way Can I Set Parameter (Meter) As Wanted Distance Between Nodes (For Example Every N Meter For A Node)? asked 12 Oct '20, 05:29 Bright 26●2 accept rate: 0% It sounds like you have half of it. Have you written any code a a basis? (12 Oct '20, 16:25) DaveF

 2 Amended VIPINDAS K's answer so it runs. Pivot converts an area into an element. ^ and \$ are part of regular expressions, defining the begining & ending of a string. In this example it searches for highways the are either 'trunk' or 'primary'. 'trunk_link' would not be returned, ``````{{geocodeArea:Malappuram}}; rel(pivot)->.District; wr[highway~"^(trunk|primary)\$"](area); out geom; .District out geom; {{style: way{ color: green; fill-color: green; text: name:en; } relation{ color: green; fill-color: green; text: name:en; } }} `````` answered 19 Oct '20, 13:27 DaveF 1.8k●61●71●96 accept rate: 6%
 1 Sample code: [out:json][timeout:25]; // fetch area “Malappuram" to search in {{geocodeArea:Malappuram}}->.searchArea; // gather results ( //query part for: “boundary=Malappuram”; wr["boundary"="administrative"]["name"="Malappuram"]["admin_level"="5"](area.searchArea); way["highway"="trunk"](area.searchArea); way["highway"="primary"](area.searchArea); relation["highway"="trunk"](area.searchArea); relation["highway"="primary"](area.searchArea); //we can add more tags way{ color: green; fill-color: green; text: name:en; } relation{ color: green; fill-color: green; text: name:en; } ); // print results out body; >; out skel qt; wizard helps to create codes. Qgis helps to make customized map. answered 19 Oct '20, 08:49 VIPINDAS K 110●3●10 accept rate: 0%
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Question tags:

×399
×176
×151
×85
×3

question asked: 12 Oct '20, 05:29

question was seen: 172 times

last updated: 19 Oct '20, 13:27