Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch($_REQUEST['method']) {
- case 'SP' : // Shortest Path
- §sql = "SELECT arcos.id, ST_AsGeoJSON(arcos.the_geom) AS geojson, length(arcos.the_geom) AS length, ".TABLE.".id
- FROM ".TABLE."
- JOIN
- (SELECT * FROM shortest_path('SELECT id,source::int4 AS source,target::int4 AS target,length::double precision AS cost FROM ".TABLE."',
- ".$startpoint['id'].",".$endpoint['id'].",false,false)) AS rota
- ON
- ".TABLE.".id = rota.edge_id;";
- break;
- case 'SP2' : // Shortest Path2
- $sql = "SELECT arcos.id, ST_AsGeoJSON(arcos.the_geom) AS geojson, length(arcos.the_geom) AS length, ".TABLE.".id
- FROM ".TABLE."
- JOIN
- (SELECT * FROM shortest_path('SELECT id,source::int4 AS source,target::int4 AS target,length::double precision AS cost FROM ".TABLE."',
- ".$startpoint['id'].",".$endpoint['id'].",false,false)) AS rota
- ON
- ".TABLE.".id = rota.edge_id;";
- break;
- } // close switch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement