Hello I have the openstreetmap database , from geofabrik..which contain planet_osm_point.planet_osm_line,Planet_osm_polygon,planet_osm_roads. So now my question is, ST_distance is used to find the distance between source and destination , so how can i retrieve the existing -Nodes(which is -osm_id,name,Way) between source and destination.in postgre sql help me please best regards Kumar asked 07 Oct '15, 23:18 kumar45 aseerel4c26 ♦ |
You can retrieve the positions of the nodes from the line geometry but not the OSM ID; the OSM ID has been thrown away during the import because it is not needed for rendering. If you import with the --slim option, then the OSM IDs of all nodes making up a way will be kept in an array in the planet_osm_ways table. The coordinates of those nodes will be in planet_osm_nodes unless you import with --flatnodes. The tags of those nodes (since you mention "name") are only recorded if they appear in the osm2pgsql style file and in that case, the node will (in addition to being in planet_osm_nodes) also appear in planet_osm_point where the tags are stored. answered 07 Oct '15, 23:31 Frederik Ramm ♦ |