Hi Julien,<div><br></div><div>Steve is right. You need to split your linestring and find out, which part is relevant for your routing result.</div><div>When you take this demo with OSM data you will see, that it works: <a href="http://websi.openvrp.com/">http://websi.openvrp.com/</a></div>
<div><br></div><div><a href="http://websi.openvrp.com/"></a>It uses Shooting Star and adds "virtual" segments at the end. Anton made a wrapper function, that is called "shooting_star_smart":</div><div>
<a href="http://pgrouting.postlbs.org/browser/sandbox/wrappers/routing_core_smart.sql">http://pgrouting.postlbs.org/browser/sandbox/wrappers/routing_core_smart.sql</a></div><div><br></div><div>There is no documentation about it, but it has been mentioned a couple of times already in the forum. You can try it, if you like, and modify the function if you want. You need to add a table called "network_info". There is a function for it, that creates the table, if it doesn't exist yet. I don't remember all parameters, but it shouldn't be difficult to find in the wrapper SQL. </div>
<div><br></div><div>Daniel</div><div><br></div><div><br></div><div><br><div class="gmail_quote">2010/10/29 Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Well, the "right"? thing to do would be for the underlying pgRouting code to add transient virtual segments at the start and end of the selected segment. this would resolve this issue independent of the data loaded. The way this would look is like this:<br>
<br>
In the graph we have three segments A, B, and C joining node 1,2,3,4<br>
<br>
(1)------A------(2)-*------B-----*--(3)---*---C--------(4)<br>
S E F<br>
<br>
And the route (S) start and (E)or(F) end points.<br>
<br>
(1)------A------(2)-*------B-----*--(3)-------C--------(4)<br>
+-(S)---------------+---(F)------------+<br>
+-(S)----------(E)--+<br>
<br>
We would then split edge B for the S point and add two new segments 2-S and S-3, and then do the same for the F point and add 3-F and F-4. For the case where the S and E are both on the same segment, you would split B and both S and E and add three segments 2-S, S-E, E-3.<br>
<br>
Then for for shooting star, just make sure the starting and ending segment are not the same. If they are then move one to the adjacent segment.<br>
<br>
This would also work for the shortest path and Astar and would resolve the issue of trimming the start and end segments.<br>
<br>
-Steve<div><div></div><div class="h5"><br>
<br>
On 10/28/2010 1:16 PM, Julien-Samuel Lacroix wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Thank you for your answer. It would probably be better for me to use<br>
Shooting Star indeed. However in my example, the start and the end are<br>
on the same segment, but since my segment is really long and is a loop,<br>
the "real" shortest path would pass through another segment. Is it then<br>
the right thing to do to split my really long segment in 2?<br>
<br>
Best regards,<br>
Julien<br>
<br>
On 10-10-27 09:52 PM, Daniel Kastl wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Julien,<br>
<br>
It is Shooting Star, that takes line segments as start and end point.<br>
Dijkstra and A* route from vertex to vertex.<br>
Indeed your example might lead to the wrong result, if two line segments<br>
have the same start and end point. You could split one of them into two<br>
segments, but Shooting Star would be the easier solution.<br>
<br>
Btw., if you have really long loops like the one of your screenshot, you<br>
need to take care not to make the bounding box too small, when you<br>
select just a part of your network.<br>
<br>
Daniel<br>
<br>
<br>
<br>
<br>
2010/10/28 Julien-Samuel Lacroix <<a href="mailto:jlacroix@mapgears.com" target="_blank">jlacroix@mapgears.com</a><br>
<mailto:<a href="mailto:jlacroix@mapgears.com" target="_blank">jlacroix@mapgears.com</a>>><br>
<br>
Hi,<br>
<br>
I use shortest_path_astar() to do the routing in my application. If<br>
I understand correctly, this mean that I can do routing from one<br>
line segment to another line segment.<br>
<br>
I have a problem with line segment that are big loops (see attached<br>
image). In my example, the green and red points are my start and end<br>
point. Ideally I would like to pass through 95-29, but both points<br>
are on edge 95-28. If I understand correctly, I can't use<br>
shortest_path_astar(). Right?<br>
<br>
Any idea to make this work?<br>
<br>
Best regards,<br>
Julien<br>
<br>
--<br>
Julien-Samuel Lacroix<br>
Mapgears<br>
<a href="http://www.mapgears.com/" target="_blank">http://www.mapgears.com/</a><br>
<br>
_______________________________________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a> <mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Georepublic UG & Georepublic Japan<br>
eMail: <a href="mailto:daniel.kastl@georepublic.de" target="_blank">daniel.kastl@georepublic.de</a> <mailto:<a href="mailto:daniel.kastl@georepublic.de" target="_blank">daniel.kastl@georepublic.de</a>><br>
Web: <a href="http://georepublic.de" target="_blank">http://georepublic.de</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
</blockquote>
<br>
</blockquote>
<br>
_______________________________________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
</div></div></blockquote></div><br></div>