I have created a web based GIS application using Django, Mapnik, Mapproxy, OpenLayers 6. Now I need to develop a shortest path(road distance) between two points selected by the user. What is the best solution for the development? I have installed PostgreSQL and created a network topology by added two columns namely source and target then executed the select query with function
I am using SRID 32643 and data in UTM format. Then to find route between two point I have executed the below query:
SELECT seq, node, edge, cost as cost, agg_cost, ST_AsText(the_geom) FROM pgr_dijkstra( 'SELECT gid as id, source, target, st_length(the_geom) as cost FROM gistrack_roads', ( SELECT source FROM gistrack_roads ORDER BY ST_Distance( ST_StartPoint(the_geom), ST_SetSRID(ST_MakePoint(715511.9, 938165.3), 32643) ) ASC LIMIT 1 ), ( SELECT source FROM gistrack_roads ORDER BY ST_Distance( ST_StartPoint(the_geom), ST_SetSRID(ST_MakePoint(717022.4, 938451.4), 32643) ) ASC LIMIT 1 ) ) as pt JOIN gistrack_roads rd ON pt.edge = rd.gid;
but not getting the correct result.Getting empty records.
I have followed the tutorial https://blog.daftcode.pl/find-your-way-with-the-power-of-postgis-pgrouting-66d620ef201b