--- a/displaystops.georss.php +++ b/displaystops.georss.php @@ -1,17 +1,14 @@ - +Bus Stops from OSM'; -$conn = pg_connect("dbname=openstreetmap user=postgres password=snmc"); +$conn = pg_connect("dbname=bus user=postgres password=snmc"); if (!$conn) { echo "An error occured.\n"; exit; } -/*SELECT * from current_node_tags, (Select id FROM current_node_tags WHERE "v" LIKE '%bus%') as a -where a.id = current_node_tags.id; */ -$result_stops = pg_query($conn, "Select * FROM current_node_tags INNER JOIN current_nodes ON -current_node_tags.id=current_nodes.id WHERE v LIKE '%bus%' "); +$result_stops = pg_query($conn, "Select * FROM stops "); if (!$result_stops) { echo "An stops retirieve error occured.\n"; exit; @@ -19,21 +16,10 @@ while ($stop = pg_fetch_assoc($result_stops)) { echo "\n\n"; - echo ""; -$result_stopkeys = pg_query($conn, "SELECT * from current_node_tags where id = {$stop['id']};"); -if (!$result_stopkeys) { - echo "An stops keys retirieve error occured.\n"; - exit; -} -$name = ""; -while ($stopkeys = pg_fetch_assoc($result_stopkeys)) { -echo htmlspecialchars(print_r($stopkeys,true)); -$name .= htmlspecialchars($stopkeys['v']); -} -echo ""; - echo "$name"; + echo " {$stop['geohash']}"; + echo "{$stop['geohash']}"; -echo " ";echo ($stop['latitude']/10000000)." ".($stop['longitude']/10000000); +echo " ";echo ($stop['lat']/10000000)." ".($stop['lng']/10000000); echo " "; echo ''; }