NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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]

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

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

asked 17 Apr '12, 22:44

tagtheworld's gravatar image

tagtheworld
0889
accept rate: 0%

edited 18 Apr '12, 07:21


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 you should be able to do that. I've just tried 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.

permanent link

answered 18 Apr '12, 00:15

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

many many thx

(18 Apr '12, 01:47) tagtheworld

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

(18 Apr '12, 07:21) tagtheworld

I tried this and it ran. I am such a newbie that I have no idea where the results ended up. On my PC somewhere?

Would appreciate help.

(31 Jul '13, 16:54) walkergeoff

It'll be on your PC, wherever you ran it from. I've just run it from the command line in the c:\temp folder and ended up with a file called "node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]" in there, so I'd loke for files with e.g. 7810801 in them.

(31 Jul '13, 17:00) SomeoneElse ♦

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:

×362
×84
×32
×9

question asked: 17 Apr '12, 22:44

question was seen: 8,888 times

last updated: 31 Jul '13, 17:00

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum