Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In PostGIS I have two tables: an osm road network and a table that contains the start and end coordinate points of each path (i.e. userid, start_x1, start_y1, end_x2, end_y2). I would like to know: 1) how to create an osm road network that can be used for implementing the Astart algorithm with pgrouting (I actually have an osm road network which I obtained using osm2po and that works fine Dijkstra shortest path algorithm using pgrouting layer plugin) 2) how to find the shortest path of each start and end coordinate points using A-star. Thank you, Selini

share|improve this question

Have you read the pgRouting workshop chapter about A-Star? It should answer your questions.

share|improve this answer

You can use, in a smart way, some of the postgis geometry relationship functions to find the nearest node to the given point coordinates, and then make use of the pgrouting functions (shortest_path, shortest_path_astar, etc)

share|improve this answer
Thank you. In this regard, I found this post:… – selini Sep 6 '12 at 10:11
but it was not really clear to me.could you please let me know where I else I could read about the function to find the nearest node and/or lyne to the given point coordinate? – selini Sep 6 '12 at 10:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.