NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I need to fetch the lat and long of road segments for which names (street names) are missing? How can i fetch it using OSM Overpass API? I tried to tweak a code i already had but it didn't yield any result, the code i used is below

<osm-script output="json" timeout="200"> <id-query {{nominatimarea:washington}}="" into="Area"/> <union> <query type="node"> <has-kv k="highway" v="*"/> <has-kv k="name" v=""/> <area-query from="Area"/> </query> <query type="way"> <has-kv k="highway" v="*"/> <has-kv k="name" v=""/> <area-query from="Area"/> </query> <query type="relation"> <has-kv k="highway" v="*"/> <has-kv k="name" v=""/> <area-query from="Area"/> </query> </union> <union> <item/> <recurse type="down"/> </union> <print mode="body"/> </osm-script>

asked 03 Sep '18, 14:06

Phaneshwar's gravatar image

accept rate: 0%

Here's the script I use to find unnamed residential highways:

out center;

I don't know the xml language but I think you may need to use regex negation to check for missing keys,

I use out center; because it works better for large areas in Overpass Turbo.

permanent link

answered 03 Sep '18, 15:25

maxerickson's gravatar image

accept rate: 32%

Thanks Max but when i replaced the bbox with actual area name and tried overpass turbo gaveup for memory reasons. can you suggest a more optimzed way i can pull all the roads (not just residential) for a particular area along with lat and long of the segment? thank you again for your help!

(03 Sep '18, 15:38) Phaneshwar

I doubt the public Overpass instance will work for a large region, especially if you start including service roads and the like. I use that query to clean up Tiger data and there will often be many thousands of unnamed residentials in just part of a state.

Using a pbf extract and osmconvert/osmfilter is probably the simplest way to go.

(03 Sep '18, 15:45) maxerickson

you should at least exclude anything with noname=yes, assuming you actually want roads without a name that perhaps should have one.

(03 Sep '18, 16:07) SimonPoole ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • 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:


question asked: 03 Sep '18, 14:06

question was seen: 1,627 times

last updated: 03 Sep '18, 16:07

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum