Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

pretty new to Geo-Informatics so do not bear with me if my questions sound like newbie-questions: can i do some requests on POIs of Openstreetmap with XAPI.

doing like so: i send a request to the API-Server - over http as a respond i get the following result - in XML

example: the following link gives back all the Nodes of the Type amenity=restaurant in XML-Format.Note: the bounding box (bbox) limits the area:

http://xapi.openstreetmap.org/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]

see here the results:_

<?xml version='1.0' standalone='no'?>
<osm version='0.6' generator='xapi: OSM Extended API 2.0' xmlns:xapi='http://www.informationfreeway.org/xapi/0.6' xapi:uri='/api/0.6/node[amenity=restaurant|fast_food|pub|cafe][bbox=9.4908142,48.7810801,9.5660019,48.8387351]' xapi:planetDate='20100824' xapi:copyright='2010 OpenStreetMap contributors' xapi:license='Creative commons CC-BY-SA 2.0' xapi:bugs='For assistance or to report bugs contact 80n80n@gmail.com' xapi:instance='zappyOsm'>
 <node id='721241970' lat='48.830856' lon='9.5116892' user='mabe75' timestamp='2010-05-04T19:01:28Z' uid='260302' version='1' changeset='4607010'>
 <tag k='amenity' v='restaurant'/>
 <tag k='name' v='Lamm'/>
 </node>
 <node id='392682646' lat='48.8315734' lon='9.5468864' user='MattGPS' timestamp='2010-05-11T19:00:20Z' uid='12973' version='3' changeset='4671372'>
 <tag k='amenity' v='restaurant'/>
 <tag k='name' v='Gasthaus an der Wieslauf'/>
 </node>
 <node id='319597380' lat='48.8277913' lon='9.5477029' timestamp='2008-12-17T21:13:15Z' version='1' changeset='444629'>
 <tag k='amenity' v='restaurant'/>
 <tag k='name' v='Gasthaus zur Linde'/>
 </node>
[...]

well this example does not work here... what do ido wrong

update:

although this page doesn't explicitly say where xapi.opentreetmap.org points to these days, it does say that jxapi.openstreetmap.org (which it might point to) is down for maintenance right now. However, Mapquests's jxapi instance should be up, so we should be able to do that. Well actually i did a try and did just this:

wget http://open.mapquestapi.com/xapi/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]

and it works. Note that there's an extra "/api" in the Mapquest xapi URL. The bbox is currently limited to 10 square degrees. See the various links from the XAPI wiki page for more info, including the terms of service for the Mapquest instance of the XAPI.

Any idea how i can delimit the bbox - in order to run over a whole town like Hamburg or Berlin or lemme take Paris for example

By the way. How to get the results stored in a databasse- note i have to convert the xml to a db-sheme.. mysql is preferred- any idea and helping hand is greatly appreciated

share|improve this question
up vote 3 down vote accepted

I sometimes find that the official OSM Xapi is not that reliable, indeed it is currently shown as being down for maintenance.

You will probably be better off using the Mapquest Open API - url as follows:

http://open.mapquestapi.com/xapi/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]

They also have good docs for all parameters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                    <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2016 Stack Exchange Inc; user contributions licensed under <a href=\"https://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2016.5.30.3623\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Geographic Information Systems Stack Exchange works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\">"], "copyright__copyright__copyright": ["y shown as being down for maintenance.\n\nYou will probably be better off using the Mapquest Open API - url as follows:\n\nhttp://open.mapquestapi.com/xapi/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]\n\nThey also have good docs for all parameters.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question.", "y shown as being down for maintenance.\n\nYou will probably be better off using the Mapquest Open API - url as follows:\n\nhttp://open.mapquestapi.com/xapi/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]\n\nThey also have good docs for all parameters.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}