<div dir="ltr">suppose you are given the co-ordinates of starting and end points of a road segment.</div><div dir="ltr">Is there any way to extract the other set of co-ordinates laying on the road segment</div>
?<br><br>An example +++++++++++++<br><br>Here's an approach using Spatialite:<br>
You can use the spatialite functions DissolvePoints() or
DissolveSegments() to get each point or line segment along a
LINESTRING. Here's an example:<br>
<br>
(I created in advance a sample LINESTRING called 'seg')<br>
<tt>PRAGMA table_info("seg");</tt><br>
0 pk_uid integer 0 NULL 1<br>
1 label text 0 NULL 0<br>
2 Geometry LINESTRING 0 NULL 0<br>
<br>
<tt>SELECT * FROM seg;</tt><br>
1 a BLOB sz=176 GEOMETRY<br>
2 b BLOB sz=112 GEOMETRY<br>
<br>
(I have two simple LINESTRINGs)<br>
<tt>SELECT AsText(Geometry) FROM seg;</tt><br>
LINESTRING(1 1, 2 1, 2 2, 3 2, 4 2, 5 3, 6 2, 7 1)<br>
LINESTRING(2 2, 2 4, 4 4, 5 2)<br>
<br>
Now, I want to choose one of the linestrings, based on it's start
and end points:<br>
<tt>SELECT AsText(Geometry) FROM seg <br>
WHERE StartPoint(Geometry) = GeomFromText('POINT(1 1)', 4326)
AND<br>
EndPoint(Geometry) = GeomFromText('POINT(7
1)', 4326);</tt><br>
LINESTRING(1 1, 2 1, 2 2, 3 2, 4 2, 5 3, 6 2, 7 1)<br>
<br>
and to break up the LINESTRING into its segments:<br>
<tt>SELECT AsText(DissolveSegments(Geometry)) FROM seg <br>
WHERE StartPoint(Geometry) = GeomFromText('POINT(1 1)', 4326)
AND<br>
EndPoint(Geometry) = GeomFromText('POINT(7 1)', 4326);</tt><br>
MULTILINESTRING((1 1, 2 1), (2 1, 2 2), (2 2, 3 2), (3 2, 4 2), (4
2, 5 3), (5 3, 6 2), (6 2, 7 1))<br>
<br>