Il giorno 08 maggio 2013 10:01, pjhooker <lima.cityplan...@gmail.com> ha scritto:
> Qualcosa ho fatto ... > > ------------------------------------ > <?php > > $url=" > http://overpass-api.de/api/interpreter?data=[out:json];node(45.59374,8.92399,45.60718,8.94424);out > ;"; > > $json = file_get_contents($url); $data = json_decode($json, TRUE); > > foreach($data['elements'] as $obj) { > echo "<br>"; > echo $obj['lat']; > echo $obj['tags']; > > foreach($obj['tags'] as $obj1) { > echo $obj1['wikipedia']; > } > } > ?> > ------------------------------------ > > in pratica se inserisco il seguente url > > http://overpass-api.de/api/interpreter?data=[out:json];node(45.59374,8.92399,45.60718,8.94424);out > ; > < > http://overpass-api.de/api/interpreter?data=[out:json];node(45.59374,8.92399,45.60718,8.94424);out > ;> > mi restituisce ciò che cercavo ... > > ho fatto il parse, per cercare i node che hanno il tag wikipedia ... sembra > funzionare, ma non riesco a togliere gli errori generati dai nodi che non > hanno il tag wikipedia ... > > esempio realizzato: http://host.logosloci.com/test/parse_json.php > <http://host.logosloci.com/test/parse_json.php> > > con i foreach ho fatto un po' di confusione, ma almeno ho qualcosa per > andare avanti. > Però non riesco a pulire il risultato ... non funziona se metto ... > > if($obj1='wikipedia'){echo $obj1['wikipedia'];} > else {} > > if (isset($obj1['wikipedia'])) echo $obj1['wikipedia']; else {} > ... un aiuto? grazie. > > > > -- > View this message in context: > http://gis.19327.n5.nabble.com/Caricare-info-node-OSM-direttamente-su-OpenLayers-tp5759882p5760101.html > Sent from the Italy General mailing list archive at Nabble.com. > > _______________________________________________ > Talk-it mailing list > Talk-it@openstreetmap.org > http://lists.openstreetmap.org/listinfo/talk-it >
_______________________________________________ Talk-it mailing list Talk-it@openstreetmap.org http://lists.openstreetmap.org/listinfo/talk-it