<div dir="ltr"><div>Hey,<br>seems like a typical job for postgis topology...<br></div><div>Build your topology using <a href="http://postgis.net/docs/TopoGeo_AddLineString.html">AddLinestring</a><br></div><div>Then you have easy access to shared part, intersection & so.<br></div>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-10 23:45 GMT+02:00 Zenon Panoussis <span dir="ltr"><<a href="mailto:oracle@provocation.net" target="_blank">oracle@provocation.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello everyone<br>
<br>
I have a number of OSRM routes and I'm looking for a way to find<br>
intersections between them and order them by the length of the line<br>
between intersections. Say for example that I have the following:<br>
<br>
A: Brussels - Aachen - Köln - Montabaur - Frankfurt a.M. - Fulda.<br>
B: Eindhoven - Venlo - Koblenz - Mainz - Aschaffenburg.<br>
C: Venlo - Köln - Montabaur - Wiesbaden.<br>
D: Tilburg - Eindhoven - Venlo - Koblenz - Mainz - Aschaffenburg - Würzburg.<br>
E: Maastricht - Venlo -Duisburg - (ehum, Bielefeld) - Hannover.<br>
<br>
A to D intersect each-other at more than one point, so each one<br>
of them can substitute the others for part of the way. E does not<br>
intersect A and intersects B, C and D at one single point, so it<br>
cannot substitute any of them. B and D overlap exactly part of the<br>
way, so D can substitute B completely while B can only substitute<br>
D partially.<br>
<br>
What I need to do is to test all of them against all other and come<br>
up with those that can replace the shortest or the longest stretch<br>
of the route that they are being matched against.<br>
<br>
The raw data is a GPX of edge points like<br>
<rtept lat="38.895080" lon="22.435042"></rtept><br>
<rtept lat="38.894685" lon="22.434856"></rtept><br>
<br>
Can anyone suggest an efficient way to do this kind of matching?<br>
<br>
Z<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></blockquote></div><br></div>