Posted by Yancho on Fri 7 Dec 15:54
report abuse | download | new post
- <?
- include 'db.php';
- $ep = $_REQUEST['finalpoint'];
- $choice = $_REQUEST['method'];
- // print_r ($_REQUEST);
- $end = "'POINT(".$ep.")'" ;
- $start = "select near_accident ($end,'$choice')";
- //echo $start;
- //echo $query;
- $source = $row[0];
- }
- // echo $source;
- $target = "select give_source('$source',1000,200)";
- $source = "select give_target('POINT(".$ep.")',1000,200)" ;
- $sql = "
- SELECT gid, astext(the_geom) as wkt, length(the_geom) AS length
- FROM shootingstar_sp
- ('streets',
- (
- select gid from streets where
- source = ( $source )
- limit 1
- )
- ,
- (
- select gid from streets where
- target = ( $target )
- limit 1
- )
- ,
- 5000,
- 'length',
- true,
- true
- );
- ";
- $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'."\n";
- $xml .= "<route>\n";
- // Add edges to XML file
- $pathlength += $edge['length'];
- $xml .= "\t<edge id='".++$counter."'>\n";
- $xml .= "\t\t<id>".$edge['gid']."</id>\n";
- $xml .= "\t\t<wkt>".$edge['wkt']."</wkt>\n";
- $xml .= "\t</edge>\n";
- }
- $xml .= "</route>\n";
- // Return routing result
- echo $xml;
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.