x

alle Schulen: als nodes, areas (polygons oder multipolygon) objects?


Geschrieben von tagtheworld (Gast) am 13. Juni 2014 13:49:11: [flux]

Hallo Community,

Ein OSM Overpass API Beispile mit PHP SimpleXML;

update: hab die bounding-box nochmals geaendert - so muesste es gehen

<?php
/**
*␣OSM␣Overpass␣API␣with␣PHP␣SimpleXML␣/␣XPath
*
*␣PHP␣Version:␣5.4␣-␣Can␣be␣back-ported␣to␣5.3␣by␣using␣5.3␣Array-Syntax␣(not␣PHP␣5.4's␣square␣brackets)
*/
//
//␣1.)␣Query␣an␣OSM␣Overpass␣API␣Endpoint
//
$query␣=␣'node
["addr:postcode"~"RM12"]
(51.5557914,0.2118915,51.5673083,0.2369398);
node
(around:1000)
["amenity"~"fast_food"];
out;';
$context␣=␣stream_context_create(['http'␣=>␣[
'method'␣␣=>␣'POST',
'header'␣=>␣['Content-Type:␣application/x-www-form-urlencoded'],
'content'␣=>␣'data='␣.␣urlencode($query),
]]);

Manche Schulen sind als nodes, andere als areas (polygons oder multipolygons), oder beides abgelegt.
Wie kann ich alle Schulen bekommen?

Wenn ich mehr schreiben soll, dann lasst es mich bitte wissen.


Antworten: