XAPI: Unterschied zwischen den Versionen
Stefan (Diskussion | Beiträge) (→Technisches) |
Stefan (Diskussion | Beiträge) |
||
Zeile 11: | Zeile 11: | ||
* The original: Mumps und GT.M | * The original: Mumps und GT.M | ||
* Projekt [https://github.com/slomo/osm-spline-xapi osm-spline-xapi] - Reimplementation in serverside JavaScript mit PostGIS. | * Projekt [https://github.com/slomo/osm-spline-xapi osm-spline-xapi] - Reimplementation in serverside JavaScript mit PostGIS. | ||
− | * Projekt [http://wiki.openstreetmap.org/wiki/Xapi#Java JXAPI] - Reimplementation als Java Servlet mit PostgreSQL by Ian Dees | + | * Projekt [http://wiki.openstreetmap.org/wiki/Xapi#Java JXAPI] - Reimplementation als Java Servlet mit PostgreSQL by Ian Dees => [https://github.com/iandees/xapi-servlet XAPI-Servlet] |
− | |||
Services (''NOTE: the service and the software and hardware behind most OSM XAPI servers are instable and often offline''): | Services (''NOTE: the service and the software and hardware behind most OSM XAPI servers are instable and often offline''): |
Version vom 9. Juni 2011, 11:21 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):
- Aktueller Service: xapi.openstreetmap.org
- XAPI Helper Webtool on openstreetmap.us
- 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: * .../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]
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'
Beispiel:
.../api/0.6/node[tourism=zoo][bbox=6.2,46.1,10.0,47.6] => 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)