1

I've already Googled extensively around this subject, and can't quite get it right.

Can anyone give me example URLs which return XML data consisting of just roads, for example, over areas larger than the 0.5 degrees limited by api.openstreetmap.org? Not had much luck with XAPI.

I'm just looking for ways to get minimal amounts of useful spatial data for regions enclosed by bounding boxes of various sizes.

2

Try using Overpass API and for playing around the overpass turbo frontend.

Example query:

[out:xml]
[timeout:25];
way["highway"](51.0634071197396,13.773078918457031,51.12550562618459,13.905601501464844);
out body;
>;
out skel qt;

Please note that the other API you mentioned is for editing only! That's why it has these strict limits regarding the bounding box. It is also pretty slow either.

  • Thanks for the quick response. Is there a way of expressing this as a simple URL string? I'm playing around with a Java application for gathering the data, and ideally I'd like to be able to pass in a single string. – HomerPlata Aug 3 '15 at 10:32
  • Yes, see the "Raw data" URL or click on "Export" on the overpass turbo page. – scai Aug 3 '15 at 10:54
  • Sorry to be a pain. I've looked at the raw data export, and it does provide the data I want, but it's multiple clicks to get it. Can you give me an example of a URL I can paste into a browser, which produces the XML response in the browser (or immediately triggers the .osm download)? – HomerPlata Aug 3 '15 at 11:48
  • You still seem to miss the "Raw data" link in my answer (the second bullet point). When clicking on it a download popup should open immediately. – scai Aug 3 '15 at 13:20
  • 1
    No, I saw it, but like I said I don't want multiple clicks. I will be using this in an automatic setting, not making manual queries. I want to be able to send a simple URL request via Java and receive the XML response. Anyway, not to worry, I think I've got what I need via something like: link. Thanks for your help. WAIT!! No, sorry! I've just noticed the link you posted above! Oops, sorry. I was looking at the raw data stuff on the overpass site itself. My bad. – HomerPlata Aug 3 '15 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.