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

I'm using an API query to find out whether a small bounding box point contains: - one way (a regular point on a road) - no ways (e.g. the middle of a field, or a building) - multiple ways (e.g. a bridge or a crossing)

I'm using a self-hosting database, so I've only got the data I've loaded (e.g. not the entire world, just one city and eventually the country).

If I make a request such as this, which is a road under a bridge in London:

[out:json][timeout:10];(way(51.5994,-0.23376,51.5996,-0.23356)[!"landuse"];);out count;>; https://overpass-turbo.eu/s/VCE

(Note this query intentionally returns no nodes, but the counts of data found. Focus on elements.0.ways figure.)

but the data for London has not been loaded - it returns 0 ways.

Equally a query where there are actually no ways returns the same information: https://overpass-turbo.eu/

I get that it's difficult for a system to know why there are no results, but in the hope there's a way:

Is there a way to find out whether data for that region hasn't been loaded, or whether there's plenty of data nearby just not results for that in particular?

asked 30 Jun '20, 18:48

Patabugen's gravatar image

Patabugen
11112
accept rate: 0%

edited 30 Jun '20, 18:48


Unsure whether you're asking why "it returns 0 ways." as it does for me: https://overpass-turbo.eu/s/VCY

out count; on its own will always display the 'This map intentionally left blank' message

or how you can test for an empty return set: (if:count(ways) == 0);

Which city have you got loaded in your self-hosting database,? Rome or London?

permanent link

answered 30 Jun '20, 20:03

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 30 Jun '20, 20:13

I'm asking how I can test for an "empty return set" vs "server hasn't got data for that region".

I've got Greater London loaded.

Actually I thought I had London loaded until my queries all returned 0 ways, which lead me to see that I've not loaded it properly and so I want to protect against that in future.

The workaround I've implemented so far - which works for me - is that if the waypoint returns 0 ways I double check it against the demo serer. My waypoints are all tracking drivers driving cars down roads, so I should never have 0. By double checking against the demo server I can throw an error if my server and the demo server disagree.

But I'd like to do it all on my server if possible.

permanent link

answered 30 Jun '20, 20:28

Patabugen's gravatar image

Patabugen
11112
accept rate: 0%

"I'm asking how I can test for an "empty return set" vs "server hasn't got data for that region"."

I've reread your original post & I'm at a loss how that was to be determined. Please be clearer when asking questions. This is a server side problem. Nothing to do with OP.

permanent link

answered 30 Jun '20, 20:54

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

I do apologise if my initial question wasn't clear enough.

permanent link

answered 30 Jun '20, 20:59

Patabugen's gravatar image

Patabugen
11112
accept rate: 0%

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:

×483
×290
×230
×54
×1

question asked: 30 Jun '20, 18:48

question was seen: 3,212 times

last updated: 30 Jun '20, 20:59

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