XAPI: Unterschied zwischen den Versionen
Stefan (Diskussion | Beiträge) (Weiterleitung nach OSM-Technisches#OSM XAPI erstellt) |
Stefan (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
Siehe auch [[OSM-Technisches]]. | |||
Service, der original OSM XML liefert mit einfachen Query-Möglichkeiten. | |||
Dokumentation: | |||
* [http://wiki.openstreetmap.org/wiki/Xapi 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 [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 | |||
** [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''): | |||
* Aktueller Service: [http://wiki.openstreetmap.org/wiki/Xapi xapi.openstreetmap.org] | |||
* [http://openstreetmap.us/uixapi/xapi.html XAPI Helper Webtool on openstreetmap.us] | |||
* [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: | |||
.../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) | |||
Version vom 9. Juni 2011, 09:20 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
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)