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

Phaneshwar
6112
accept rate: 0%


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

[bbox:{{bbox}}];
way[highway=residential][!name];
out center;

I don't know the xml language but I think you may need to use regex negation to check for missing keys, https://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Negation

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

maxerickson
12.4k1079174
accept rate: 31%

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 ♦
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×107

question asked: 03 Sep '18, 14:06

question was seen: 783 times

last updated: 03 Sep '18, 16:07

powered by OSQA