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? |
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? |
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. |
"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. |
I do apologise if my initial question wasn't clear enough. |