[osmosis-dev] Overpass-api support

Igor Podolskiy igor.podolskiy at vwi-stuttgart.de
Mon Sep 19 17:46:17 BST 2011


Hi Rüdiger,

> I have currently huge problems reading OSM data from the XAPI server(s).
> Errors 500, 503, 504 are coming up.
> While searching the internet I found the "new" overpass-api
> http://wiki.openstreetmap.org/wiki/Overpass_API#XAPI_Compability_Layer
> unfortunately if i call --read-api -url=
> http://www.overpass-api.de/api/xapi? ...
> I got
> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to parse
> xml. publicId=(null), systemId=(null), lineNumber=1, columnNumber=1.
that's because the --read-api task is not suited for downloading OSM XML 
data from arbitrary URLs. The url parameter you're using is the base API 
URL, --read-api will append different parameters to it for the bounding 
box and so on, and that is incompatible with the XAPI or its Overpass 
dialect.

There is (sadly) no Osmosis task that I know of which will download OSM 
XML from an arbitrary URL.

As a workaround you can call the API from Java/Groovy (it's just a HTTP 
request, anyway), save the result to a temporary file, and use 
--read-xml. Or you could write that Osmosis task that allows download 
from arbitrary URLs before I or someone else gets around to do it. :)

One more caveat you might run into: Osmosis XML parser requires that the 
version attribute of all nodes and ways and relations be set, otherwise 
it will abort parsing with an error. The Overpass API does not return 
the version attribute by default, so you need to add the [@meta] 
parameter to the Overpass XAPI queries:

http://www.overpass-api.de/api/xapi?node[name=Wuppertal-Barmen][@meta]

instead of just

http://www.overpass-api.de/api/xapi?node[name=Wuppertal-Barmen]

> Is there support for the overpass-api planed?
Not that I know of (but I didn't knew about Overpass till today, either 
:)), and it seems to be a fairly complex beast. It sure looks powerful 
and interesting ;) What kind of support do you have in mind?

Greetings from Stuttgart
Igor



More information about the osmosis-dev mailing list