xapi and api

The Extended API for OSM is documented at the OSM wiki.

This a read-only variant of the OSM api. The standard OSM api only supports queries up to 0.25 square degrees. The Extended API allows much larger requests, up to 10,000,000 elements (this is still less than a third of California) or 100 square degrees, whichever is smaller.

The api is accessed through http://www.informationfreeway.org/api/0.6/... (which redirects you to the most current server, at the time of writing that was http://xapi.openstreetmap.org/api/0.6/...)

To get the data you need use the following syntax

/api/0.6/map?bbox=west,south,east,north

Where west, south, east, north are the respective boundaries of the area you want to get.

The example below gets Sjælland, Lolland and Falster of Danmark.

http://www.informationfreeway.org/api/0.6/map?bbox=12.3,55.85,12.42,55.95

The amount of data returned may be very large, also substantially larger than your browser is prepared to support. in that case you should use the CLI utiltiy Wget instead.

wget http://www.informationfreeway.org/api/0.6/map?bbox=12.3,55.85,12.42,55.95 -O tkkbstdrhv.osm

You can use the 'Export' feature at http://www.openstreetmap.org to determine the coordinates of the area you want to get. but be aware that remember that openstreetmap.org uses the standard api for exports, thus the area you are allowed to get from this interface is not very large.

Unfortunately the xapi.openstreetmap.org/api/0.6/... which you are redirected to is pretty crowded be prepared to give it more than one attempt. The file you get for the area used in the example is about 18.6 Mb.


ċ
tkkbstdrhv.osm
(18182k)
Lars Kruse,
Jul 21, 2011, 5:42 AM
Comments