I'm trying to export an osm file for a region larger than that supported by the web interface hence the following command fails: http://api.openstreetmap.org/api/0.6/map?bbox=27.9314,-26.1841,28.1538,-26.0028

I turned to the XAPI which supports larger regions as follows: overpass.osm.rambler.ru/cgi/xapi_meta?*[bbox=27.9314,-26.1841,28.1538,-26.0028]

However, the downloaded file is missing some of the xml elements/fields which are present in the map.osm file. For example there is no bounds field. Where can I download a larger map with all the relevant field (bounds, node, way, relation, Attributes)?

asked 19 Feb '16, 13:39

confused1's gravatar image

confused1
11112
accept rate: 0%

edited 22 Feb '16, 18:59

aseerel4c26's gravatar image

aseerel4c26 ♦
32.1k16239551

1

What sources in detail have you already tried from http://wiki.openstreetmap.org/wiki/Planet.osm ?

And if you found one source fitting to your aims, why did that not work? Or succes?

(20 Feb '16, 14:06) stephan75

i was using the osm extended api. i just added the bounds field myself which is not there by default.

(22 Feb '16, 11:09) confused1

The relevant fields are <node>, <way>, and <relation>, in that order, and lots of them, all enclosed in a big <osm>...</osm> section. Anything else is superfluous and won't be processed by most applications anyway.

permanent link

answered 19 Feb '16, 14:18

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
70.6k826391105
accept rate: 24%

1

thanks very much, makes sense

(22 Feb '16, 11:09) confused1

I believe, the original question hasn't really been answered yet, which was, why there's no bounds element in the XAPI response. Let's take a closer look.

After all, the XAPI call to the following URL will be translated into something Overpass API can make some sense out of, notably an Overpass XML request.

So, if you query for something like

overpass.osm.rambler.ru/cgi/xapi_meta?*[bbox=27.9314,-26.1841,28.1538,-26.0028]

this will in fact be translated into the following Overpass XML query under the hood:

<query type="node">
  <bbox-query s="-26.1841" n="-26.0028" w="27.9314" e="28.1538"/>
</query>
<union>
  <item/>
  <query type="way">
    <bbox-query s="-26.1841" n="-26.0028" w="27.9314" e="28.1538"/>
  </query>
  <recurse type="way-node"/>
</union>
<print mode="meta"/>
<query type="relation">
  <bbox-query s="-26.1841" n="-26.0028" w="27.9314" e="28.1538"/>
</query>
<print mode="meta"/>

BTW: You can get to this translated query on your own, if you're following the XAPI Compatibility Layer to Overpass XML / QL migration procedure, as outlined in the wiki.

That's already a good starting point to feed into overpass turbo: http://overpass-turbo.eu/s/eAf

Now, how do we get the bounds element into the query result?

You need to know that this requires something called global bounding box, which can be added by providing an <osm-script> element along with a bbox attribute. Your resulting query looks like this: it's basically the same overpass turbo query as before, but this time also returning a bounds element.

http://overpass-turbo.eu/s/eAh

You can get the query results from overpass turbo via Export -> get raw data directly from Overpass API, you'll end up with a file called interpreter and the following line in the resulting file:

 <bounds minlat="-26.1841" minlon="27.9314" maxlat="-26.0028" maxlon="28.1538"/>

Mission accomplished!

permanent link

answered 23 Feb '16, 17:45

mmd's gravatar image

mmd
5.6k4988
accept rate: 37%

edited 23 Feb '16, 18:35

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:

×238
×147
×64
×32
×8

question asked: 19 Feb '16, 13:39

question was seen: 3,896 times

last updated: 23 Feb '16, 18:35

powered by OSQA