Closed blahami2 closed 8 years ago
Even in the opposite direction
SELECT e.id, e.is_forward, e.source_id, e.target_id, e2.is_paid, e2.length
, e2.speed_fw, e2.speed_bw
, ST_Length(ST_Line_Substring(e2.geom, 0, ST_Line_Locate_Point(e2.geom, e2.point)), 1) AS keyDistanceFromStart
, ST_Length(ST_Line_Substring(e2.geom, ST_Line_Locate_Point(e2.geom, e2.point),1), 1) AS keyDistanceToEnd
FROM edges e
JOIN (
SELECT ed.*, x.point
FROM edges_data ed
JOIN (select " + pointString + " AS point) AS x ON 1 = 1
WHERE ed.ROWID IN(
SELECT ROWID FROM SpatialIndex
WHERE f_table_name = 'edges_data'
AND search_frame = BuildCircleMbr(15.8916358, 50.20177 , 50 ,4326)
)
ORDER BY Distance( ed.geom, x.point)
LIMIT 1
) AS e2
ON e.data_id = e2.id
returns null for distances, the point is approximately in the middle of the edge
Fixed with the issue #11
http://147.32.87.157:8084/map?latFrom=50.0681506&lonFrom=14.3976025&latTo=50.20177&lonTo=15.8916358&priority=TIME&algorithm=DIJKSTRA&route=true