[pgrouting-users] Shortest Route Search Not Working

Hello Daniel,

Your information was extremely helpful and I was able to get the routing functionality to work.

I hope you don’t mind helping me with another couple short questions:

  1. Projection 4326 with latlng is lot easier for me to work with. Although there are ways to convert the latlng to 900913 projection, I was wondering how would I be able to directly use 4326 and run search on it (HTML changes), assuming that the tiles were generated with 900913 projection and the routing database is set to 4326?

  2. Just out of curiosity.
    The routing results usually take residential route ways, instead of taking instead of taking highway streets (which is more like what results from Google Maps show). Any ideas why the difference?

Thanks

I hope you don’t mind helping me with another couple short questions:

  1. Projection 4326 with latlng is lot easier for me to work with. Although there are ways to convert the latlng to 900913 projection, I was wondering how would I be able to directly use 4326 and run search on it (HTML changes), assuming that the tiles were generated with 900913 projection and the routing database is set to 4326?

You can use Postgis “transform()” function to do this:
http://postgis.refractions.net/docs/ST_Transform.html

  1. Just out of curiosity.
    The routing results usually take residential route ways, instead of taking instead of taking highway streets (which is more like what results from Google Maps show). Any ideas why the difference?

pgRouting gives you the “shortest” path and it’s up to you to define what is “shortest”. Easiest is to take length as cost, but if you take time as cost, then shortest will be the fastest. You could for example define some speed for your road classes, and if the speed is higher on highways it will prefer the highway like Google Maps does.

Daniel

Thanks


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users