XAPI: Unterschied zwischen den Versionen

Aus Geometa Lab OST
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 17: Zeile 17:
* [http://openstreetmap.us/uixapi/xapi.html XAPI Helper Webtool on openstreetmap.us]
* [http://openstreetmap.us/uixapi/xapi.html XAPI Helper Webtool on openstreetmap.us]
* [http://open.mapquestapi.com/xapi/ XAPI Helper Webtool from Mapquest]
* [http://open.mapquestapi.com/xapi/ XAPI Helper Webtool from Mapquest]
== Technisches ==
Siehe http://www.gis.hsr.ch/wiki/XAPI
Das Ziel ist nicht die vollständige "Syntax", sondern nur spezifische und häufige Requests, bestehend aus Key/Value Pairs (0, 1 ode mehrere) sowie einer Bounding Box-Angabe. Wegen '[' muss die URL kanonisiert werden. Achtung auch wegen ":".
Hier einige Tests:
<nowiki>
* .../api/0.6/node[amenity=*]
* .../api/0.6/node[highway=busstop]
* .../api/0.6/node[bbox=-6,50,2,61]
* .../api/0.6/node[amenity=hospital][bbox=-6,50,2,61]
* .../api/0.6/*[seamark:type=signal_station_warning]
</nowiki>
Hier konkrete, laufende Beispiele:
* http://xapi.spline.de/api/0.6/node[amenity=*]
* http://open.mapquestapi.com/xapi/api/0.6/node[operator=Stadtverkehr Lübeck]
* http://open.mapquestapi.com/xapi/api/0.6/node[ref:svhl=*]
Logs:
* http://jxapi.openstreetmap.org/xapi/admin/stats und log http://fsi.spline.de/osm/xapi-access-23-01-2011.log.bz2
XAPI => SQL:
* gemäss osm2pgsql-Schema
* Original wäre das OSM 'pgsnapshot_schema_0.6'
** [http://trac.openstreetmap.org/browser/applications/utils/osmosis/trunk/package/script/pgsnapshot_schema_0.6.sql]
** Siehe dazu https://github.com/osm-spline/xapi/blob/master/sql/sampleRequests.sql
Beispiel:
  <nowiki>.../api/0.6/node[tourism=zoo][bbox=6.2,46.1,10.0,47.6]</nowiki>
  =>
  SELECT ST_AsText(way) geom, name label
  FROM osm_point
  WHERE hstore(tags)->'tourism'='zoo'
  AND ST_Contains(ST_Transform(ST_SetSRID('BOX(6.2 46.1, 10.0 47.6)'::box2d, 4326),900913),way)

Version vom 9. Juni 2011, 09:23 Uhr

Siehe auch OSM-Technisches.

Service, der original OSM XML liefert mit einfachen Query-Möglichkeiten.

Dokumentation:

  • OSM XAPI
  • Examples:
    • ... /api/0.6/node%5Bnatural=peak%5D%5Bbbox=5.94360,45.93587,10.61279,47.73193%5D natural=peak within Switzerland]).

Implementationen:

  • The original: Mumps und GT.M
  • Projekt osm-spline-xapi - Reimplementation in serverside JavaScript mit PostGIS.
  • Projekt JXAPI - Reimplementation als Java Servlet mit PostgreSQL by Ian Dees => XAPI-Servlet

Services (NOTE: the service and the software and hardware behind most OSM XAPI servers are instable and often offline):