[mapserver-users] optimal path between two points.
hi.. I am back again with my problem pgrouting.. I followed a little tutorial works perfectly with the shapefile from the example, but to use mine the result is not expected, generating lines are not continuous, I think I missing some coordinates or something to work with my shapefile. attached image. please help!!.. 2009/1/19 Valeria Muñoz valemu...@gmail.com Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. RG... attachment: img_routing.JPG___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
This may be cause because you need to check the direction of the line segments before you create a linestring to pass to the client. If you route is something like segment source target 11 3 24 3 37 4 etc route (1,2,4,3,7,4) or 1,3,3,4) depending on how you assemble it is not going to make sense. Then segment 2 needs to be reversed so it goes from 3 to 4 and segment 3 needs to be reverse also. so you get: route (1,3,4,7). Also this is not really a mapserver issues and you should probably pust this to the pgRouting list. It would alos help if you showed some of the intermediate results. When you show a image and the route is broken, most of us can look at the image and say Yup, looks like the route is broken! We do not see what data you got out of pgRouting, we do not know how that got passed to mapserver or OpenLayers, there are a lot of places that you can break things. We don't even know how data flows through your system or who/what is rendering the route part of the image. -Steve Valeria Muñoz wrote: hi.. I am back again with my problem pgrouting.. I followed a little tutorial works perfectly with the shapefile from the example, but to use mine the result is not expected, generating lines are not continuous, I think I missing some coordinates or something to work with my shapefile. attached image. please help!!.. 2009/1/19 Valeria Muñoz valemu...@gmail.com mailto:valemu...@gmail.com Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. RG... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
example the query is optimal path between 887 y 852. : SELECT rt.gid, AsText(rt.the_geom) AS wkt, length(rt.the_geom) AS length, calle.gid FROM calle, (SELECT gid, the_geom FROM dijkstra_sp_delta( 'calle', 887, 852, 3000) ) as rt WHERE calle.gid=rt.gid; result: gid;wkt;length;gid 4389;MULTILINESTRING((-71.1951327440651 -30.5911350429583,-71.1957462426904 -30.5912128948402,-71.1957861853043 -30.591219747929,-71.1958400125164 -30.591211719682));0.000713367403530106;4389 4603;MULTILINESTRING((-71.1939954028678 -30.5921681162637,-71.1939834234752 -30.5922241673576,-71.1938231446269 -30.5925509466888));0.000421286769021393;4603 4331;MULTILINESTRING((-71.1950174992082 -30.5919506007811,-71.1950526139385 -30.5916919152203));0.000261057969957178;4331 4608;MULTILINESTRING((-71.1938231446269 -30.5925509466888,-71.1937648360013 -30.5926358138883));0.00010296765211197;4608 RG 2009/2/3 Stephen Woodbridge wood...@swoodbridge.com This may be cause because you need to check the direction of the line segments before you create a linestring to pass to the client. If you route is something like segment source target 11 3 24 3 37 4 etc route (1,2,4,3,7,4) or 1,3,3,4) depending on how you assemble it is not going to make sense. Then segment 2 needs to be reversed so it goes from 3 to 4 and segment 3 needs to be reverse also. so you get: route (1,3,4,7). Also this is not really a mapserver issues and you should probably pust this to the pgRouting list. It would alos help if you showed some of the intermediate results. When you show a image and the route is broken, most of us can look at the image and say Yup, looks like the route is broken! We do not see what data you got out of pgRouting, we do not know how that got passed to mapserver or OpenLayers, there are a lot of places that you can break things. We don't even know how data flows through your system or who/what is rendering the route part of the image. -Steve Valeria Muñoz wrote: hi.. I am back again with my problem pgrouting.. I followed a little tutorial works perfectly with the shapefile from the example, but to use mine the result is not expected, generating lines are not continuous, I think I missing some coordinates or something to work with my shapefile. attached image. please help!!.. 2009/1/19 Valeria Muñoz valemu...@gmail.com mailto:valemu...@gmail.com Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. RG... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Yup, the results from pgRouting look broken. You should repost to the pgRouting list and describe how you set up your data. What tolerances you used when you created the vertices_tmp table, etc. This is not relevant to the mapserver list. -Steve W Valeria Muñoz wrote: example the query is optimal path between 887 y 852. : SELECT rt.gid, AsText(rt.the_geom) AS wkt, length(rt.the_geom) AS length, calle.gid FROM calle, (SELECT gid, the_geom FROM dijkstra_sp_delta( 'calle', 887, 852, 3000) ) as rt WHERE calle.gid=rt.gid; result: gid;wkt;length;gid 4389;MULTILINESTRING((-71.1951327440651 -30.5911350429583,-71.1957462426904 -30.5912128948402,-71.1957861853043 -30.591219747929,-71.1958400125164 -30.591211719682));0.000713367403530106;4389 4603;MULTILINESTRING((-71.1939954028678 -30.5921681162637,-71.1939834234752 -30.5922241673576,-71.1938231446269 -30.5925509466888));0.000421286769021393;4603 4331;MULTILINESTRING((-71.1950174992082 -30.5919506007811,-71.1950526139385 -30.5916919152203));0.000261057969957178;4331 4608;MULTILINESTRING((-71.1938231446269 -30.5925509466888,-71.1937648360013 -30.5926358138883));0.00010296765211197;4608 RG 2009/2/3 Stephen Woodbridge wood...@swoodbridge.com mailto:wood...@swoodbridge.com This may be cause because you need to check the direction of the line segments before you create a linestring to pass to the client. If you route is something like segment source target 11 3 24 3 37 4 etc route (1,2,4,3,7,4) or 1,3,3,4) depending on how you assemble it is not going to make sense. Then segment 2 needs to be reversed so it goes from 3 to 4 and segment 3 needs to be reverse also. so you get: route (1,3,4,7). Also this is not really a mapserver issues and you should probably pust this to the pgRouting list. It would alos help if you showed some of the intermediate results. When you show a image and the route is broken, most of us can look at the image and say Yup, looks like the route is broken! We do not see what data you got out of pgRouting, we do not know how that got passed to mapserver or OpenLayers, there are a lot of places that you can break things. We don't even know how data flows through your system or who/what is rendering the route part of the image. -Steve Valeria Muñoz wrote: hi.. I am back again with my problem pgrouting.. I followed a little tutorial works perfectly with the shapefile from the example, but to use mine the result is not expected, generating lines are not continuous, I think I missing some coordinates or something to work with my shapefile. attached image. please help!!.. 2009/1/19 Valeria Muñoz valemu...@gmail.com mailto:valemu...@gmail.com mailto:valemu...@gmail.com mailto:valemu...@gmail.com Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. RG... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Hi, I agree with Steve, that you better ask this question in the pgRouting forum or on their list. Looking at your screenshot my first thought was that your network topology is not correct, maybe you took a too high tolerance value when you assigned source and target IDs (units meter instead of degree). But let's discuss this better here http://pgrouting.postlbs.org/discussion or here http://lists.postlbs.org/mailman/listinfo/pgrouting-users Daniel Valeria Muñoz schrieb: example the query is optimal path between 887 y 852. : SELECT rt.gid, AsText(rt.the_geom) AS wkt, length(rt.the_geom) AS length, calle.gid FROM calle, (SELECT gid, the_geom FROM dijkstra_sp_delta( 'calle', 887, 852, 3000) ) as rt WHERE calle.gid=rt.gid; result: gid;wkt;length;gid 4389;MULTILINESTRING((-71.1951327440651 -30.5911350429583,-71.1957462426904 -30.5912128948402,-71.1957861853043 -30.591219747929,-71.1958400125164 -30.591211719682));0.000713367403530106;4389 4603;MULTILINESTRING((-71.1939954028678 -30.5921681162637,-71.1939834234752 -30.5922241673576,-71.1938231446269 -30.5925509466888));0.000421286769021393;4603 4331;MULTILINESTRING((-71.1950174992082 -30.5919506007811,-71.1950526139385 -30.5916919152203));0.000261057969957178;4331 4608;MULTILINESTRING((-71.1938231446269 -30.5925509466888,-71.1937648360013 -30.5926358138883));0.00010296765211197;4608 RG 2009/2/3 Stephen Woodbridge wood...@swoodbridge.com mailto:wood...@swoodbridge.com This may be cause because you need to check the direction of the line segments before you create a linestring to pass to the client. If you route is something like segment source target 11 3 24 3 37 4 etc route (1,2,4,3,7,4) or 1,3,3,4) depending on how you assemble it is not going to make sense. Then segment 2 needs to be reversed so it goes from 3 to 4 and segment 3 needs to be reverse also. so you get: route (1,3,4,7). Also this is not really a mapserver issues and you should probably pust this to the pgRouting list. It would alos help if you showed some of the intermediate results. When you show a image and the route is broken, most of us can look at the image and say Yup, looks like the route is broken! We do not see what data you got out of pgRouting, we do not know how that got passed to mapserver or OpenLayers, there are a lot of places that you can break things. We don't even know how data flows through your system or who/what is rendering the route part of the image. -Steve Valeria Muñoz wrote: hi.. I am back again with my problem pgrouting.. I followed a little tutorial works perfectly with the shapefile from the example, but to use mine the result is not expected, generating lines are not continuous, I think I missing some coordinates or something to work with my shapefile. attached image. please help!!.. 2009/1/19 Valeria Muñoz valemu...@gmail.com mailto:valemu...@gmail.com mailto:valemu...@gmail.com mailto:valemu...@gmail.com Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. RG... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] optimal path between two points.
You may also want to look at the Workshops posted at the pgRouting site. Here is a link to the workshop from FOSS4G2008: http://pgrouting.postlbs.org/wiki/WorkshopFOSS4G2008 -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Valeria Muñoz Sent: Monday, January 19, 2009 2:20 PM To: Frank Warmerdam Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] optimal path between two points. frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Valeria, You should really look at the example provided with: http://pgrouting.postlbs.org/wiki/WorkshopFOSS4G2007 This is what I started with and then made my own modifications. The above workshop should walk you through how to setup a pgRouting without my additional hacks which will only confuse you at the moment. My dd_routing.php is a modified version of ax_routing.php that is included in the tutorial tarball. You might also want to read some of these pages if you have not already: http://www.google.com/search?hl=enq=pgRoutingbtnG=Google+Search Best regards, -Steve W Valeria Muñoz wrote: hi Stephen.. thank for the tips... I have reviewed the code but can only see the dd.html. can you send me the dd_routing.php? . please thanks for everything 2009/1/19 Stephen Woodbridge wood...@swoodbridge.com mailto:wood...@swoodbridge.com Valeria Muñoz wrote: frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. So you have various options depending on the client software you are using. So here are some ideas for you: 1) put the route into a results table with a unique id, and pass the unique id back to the client where it can then request the route image via a mapserver mapfile the connects to the postgis database and requests the layer be drawn with the unique id to select the appropriate route. 2) make an ajax request to generate the route and return the polyline as an xml or json object back to the client. The client then parses the result document and displays the route over the map. 3) if you use OpenLayers for the client then you can use it to help you do 1) as an image, or 1) as a wfs layer, or 2) as a vector layer. You can look at the source for my demo page http://imaptools.com/leaddog/routing/dd.html which does this with a modified version of pgRouting (pgRouting does not return turn-by-turn directions), but you should be able to modify my code to work with pgRouting. I wrote a simple php script to proxy the route request into postgres and to format the results back to the client. Look this over and see how far you can get with this. If you get stuck, ask and I'm sure we can get you moving in the right direction. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Hi Stephen thanks for the tip... I read the example and implements it with my data. Now my problem is :how to rescue the data for instructions,distance,time etc? .. how can I know whether to turn right or left? RG. 2009/1/20 Stephen Woodbridge wood...@swoodbridge.com Valeria, You should really look at the example provided with: http://pgrouting.postlbs.org/wiki/WorkshopFOSS4G2007 This is what I started with and then made my own modifications. The above workshop should walk you through how to setup a pgRouting without my additional hacks which will only confuse you at the moment. My dd_routing.php is a modified version of ax_routing.php that is included in the tutorial tarball. You might also want to read some of these pages if you have not already: http://www.google.com/search?hl=enq=pgRoutingbtnG=Google+Search Best regards, -Steve W Valeria Muñoz wrote: hi Stephen.. thank for the tips... I have reviewed the code but can only see the dd.html. can you send me the dd_routing.php? . please thanks for everything 2009/1/19 Stephen Woodbridge wood...@swoodbridge.com mailto: wood...@swoodbridge.com Valeria Muñoz wrote: frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. So you have various options depending on the client software you are using. So here are some ideas for you: 1) put the route into a results table with a unique id, and pass the unique id back to the client where it can then request the route image via a mapserver mapfile the connects to the postgis database and requests the layer be drawn with the unique id to select the appropriate route. 2) make an ajax request to generate the route and return the polyline as an xml or json object back to the client. The client then parses the result document and displays the route over the map. 3) if you use OpenLayers for the client then you can use it to help you do 1) as an image, or 1) as a wfs layer, or 2) as a vector layer. You can look at the source for my demo page http://imaptools.com/leaddog/routing/dd.html which does this with a modified version of pgRouting (pgRouting does not return turn-by-turn directions), but you should be able to modify my code to work with pgRouting. I wrote a simple php script to proxy the route request into postgres and to format the results back to the client. Look this over and see how far you can get with this. If you get stuck, ask and I'm sure we can get you moving in the right direction. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Valeria Muñoz wrote: Hi Stephen thanks for the tip... I read the example and implements it with my data. Now my problem is :how to rescue the data for instructions,distance,time etc? .. how can I know whether to turn right or left? Assume you have two segments a-b and a-c and we want to evaluate it at a 1) you need to check if segment a-b needs to be flipped end to end. 2) because segments can be curves like highway exit ramps you can not just use the endpoints, instead you have to use: ab[npoints], ab[npoints-1] and compute the azimuth of this ac[1], ac[2] and compute the azimuth of this 3) then based on the change in azimuth you and determine if the route is changing directions and turning right or left See postGIS functions: ST_NumPoints() ST_pointN() Reverse() Azimuth() -Steve RG. 2009/1/20 Stephen Woodbridge wood...@swoodbridge.com mailto:wood...@swoodbridge.com Valeria, You should really look at the example provided with: http://pgrouting.postlbs.org/wiki/WorkshopFOSS4G2007 This is what I started with and then made my own modifications. The above workshop should walk you through how to setup a pgRouting without my additional hacks which will only confuse you at the moment. My dd_routing.php is a modified version of ax_routing.php that is included in the tutorial tarball. You might also want to read some of these pages if you have not already: http://www.google.com/search?hl=enq=pgRoutingbtnG=Google+Search http://www.google.com/search?hl=enq=pgRoutingbtnG=Google+Search Best regards, -Steve W Valeria Muñoz wrote: hi Stephen.. thank for the tips... I have reviewed the code but can only see the dd.html. can you send me the dd_routing.php? . please thanks for everything 2009/1/19 Stephen Woodbridge wood...@swoodbridge.com mailto:wood...@swoodbridge.com mailto:wood...@swoodbridge.com mailto:wood...@swoodbridge.com Valeria Muñoz wrote: frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com mailto:warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. So you have various options depending on the client software you are using. So here are some ideas for you: 1) put the route into a results table with a unique id, and pass the unique id back to the client where it can then request the route image via a mapserver mapfile the connects to the postgis database and requests the layer be drawn with the unique id to select the appropriate route. 2) make an ajax request to generate the route and return the polyline as an xml or json object back to the client. The client then parses the result document and displays the route over the map. 3) if you use OpenLayers for the client then you can use it to help you do 1) as an image, or 1) as a wfs layer, or 2) as a vector layer. You can look at the source for my demo page http://imaptools.com/leaddog/routing/dd.html which does this with a modified version of pgRouting (pgRouting does not return turn-by-turn directions), but you should be able to modify my code to work with pgRouting. I wrote a simple php script to proxy the route request into postgres and to format the results back to the client. Look this over and see how far you can get with this. If you get stuck, ask and I'm sure we can get you moving in the right direction.
Re: [mapserver-users] optimal path between two points.
Actually there is wiki page on the pgRouting website how to use Mapserver with pgRouting: http://pgrouting.postlbs.org/wiki/MapServerOutput And there is also a tutorial that makes use of Mapserver: http://pgrouting.postlbs.org/wiki/pgRoutingDocs#Tutorials I didn't try the tutorial myself and it could use an older version of pgRouting. If something doesn't work (anymore), you can also ask on the pgRouting forum (http://pgrouting.postlbs.org/discussion). Daniel Fawcett, David schrieb: You may also want to look at the Workshops posted at the pgRouting site. Here is a link to the workshop from FOSS4G2008: http://pgrouting.postlbs.org/wiki/WorkshopFOSS4G2008 -Original Message- *From:* mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Valeria Muñoz *Sent:* Monday, January 19, 2009 2:20 PM *To:* Frank Warmerdam *Cc:* mapserver-users@lists.osgeo.org *Subject:* Re: [mapserver-users] optimal path between two points. frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com mailto:warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com mailto:warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam http://pobox.com/%7Ewarmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] optimal path between two points.
Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. RG... ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] optimal path between two points.
Valeria Muñoz wrote: frank thanks for the tips. I use prRouting and create the table dijsktra_result. Now how can I implement with my mapfile? , how deliver the data .. have some sample code? thanks for your help. 2009/1/19 Frank Warmerdam warmer...@pobox.com mailto:warmer...@pobox.com Valeria Muñoz wrote: Hi I would like to implement the service optimum path between 2 points, can someone help me to be able to implement it?. The general idea is that a user picks a point A and point B and a display on the map the best route to get from point A to B. Valeria, MapServer itself does not do route calculation. You might find some useful pointers on this page: http://wiki.osgeo.org/wiki/OpenRouter I think the pgRouting (built on postgres/postgis) is the best bet for integration with MapServer. So you have various options depending on the client software you are using. So here are some ideas for you: 1) put the route into a results table with a unique id, and pass the unique id back to the client where it can then request the route image via a mapserver mapfile the connects to the postgis database and requests the layer be drawn with the unique id to select the appropriate route. 2) make an ajax request to generate the route and return the polyline as an xml or json object back to the client. The client then parses the result document and displays the route over the map. 3) if you use OpenLayers for the client then you can use it to help you do 1) as an image, or 1) as a wfs layer, or 2) as a vector layer. You can look at the source for my demo page http://imaptools.com/leaddog/routing/dd.html which does this with a modified version of pgRouting (pgRouting does not return turn-by-turn directions), but you should be able to modify my code to work with pgRouting. I wrote a simple php script to proxy the route request into postgres and to format the results back to the client. Look this over and see how far you can get with this. If you get stuck, ask and I'm sure we can get you moving in the right direction. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users