Path on one lineΒΆ

To get a path on one line like that:

../../_images/path_on_one_line.PNG

Please use the following function

It is called in routing3.php if startedge-gid and end-edge-gid are equal.

if ($startEdge['gid']==$endEdge['gid']){

        $abfrage_path_between_two_points="SELECT astext(intersection_on_line($result_besidegeometrie_begin_gid,'$point_on_line_begin','$point_on_line_ende')) as wkt,ST_length(schnittpunkt_auf_linie($result_besidegeometrie_begin_gid,'$point_on_line_begin','$point_on_line_ende')) as length";

        //echo $abfrage_path_between_two_points;
        $query7 = pg_query($con,$abfrage_path_between_two_points);
        $result_path_between_two_points= pg_fetch_result($query7, 0, wkt);
        $result_length_between_two_points= pg_fetch_result($query7, 0, length);

        $searching_wkt_begin=$result_path_between_two_points;
        $searching_wkt_ende=$result_path_between_two_points;
        $length_begin=$result_length_between_two_points;
        $length_ende=$result_length_between_two_points;
        //echo "Die Strecke ".$result_path_between_two_points;
}