Hello, I'm building a C++ desktop application feature where you can visualize 3D data and I'd like to import 3D buildings from some locations specified by the user into it. I looked at this kind of request Is there a better way to to achieve what I'm trying to do ? Thanks asked 19 Nov '20, 16:47 Timo1111 |
One Answer:
Your usage sounds to me like it would fall under the second paragraph of the When NOT to use the API section of that page. I think the some of Overpass API instances have fewer restrictions. This would also allow you to request only the ways and relations that are either answered 19 Nov '20, 23:01 InsertUser |
Sorry I'm late to answer, didn't have a PC this week-end.
I agree Overpass API seems more fitted for my needs but from what I saw I can't request buildings information only using an URL. Every request described in the documentation is using Overpass QL or Overpass XML language. Is there a REST API or should I put the OQL script in the body of a GET request ?
I'm not a developer myself, but the Overpass Turbo "export" options allow you to produce a "compact form" like this:
[out:xml][timeout:25];(nwr["building"](40.764472136395,-73.979962170124,40.766089194963,-73.976062238216);nwr["building:part"](40.764472136395,-73.979962170124,40.766089194963,-73.976062238216););out;>;out skel qt;
Which it then converts to a URL that looks like this:
https://overpass-api.de/api/interpreter?data=%5Bout%3Axml%5D%5Btimeout%3A25%5D%3B%28nwr%5B%22building%22%5D%2840%2E764472136395%2C%2D73%2E979962170124%2C40%2E766089194963%2C%2D73%2E976062238216%29%3Bnwr%5B%22building%3Apart%22%5D%2840%2E764472136395%2C%2D73%2E979962170124%2C40%2E766089194963%2C%2D73%2E976062238216%29%3B%29%3Bout%3B%3E%3Bout%20skel%20qt%3B%0A
Which I assume is the same but percent encoded?