I want to find shortest route between two points stored in PostGIS database. I know about pgRouting functionalities but I don't want to use it because of data processing/topology creation processes.

Is their any such function/functions in PostGIS to achieve the same?


1 Answer 1


You can get the shortest route between two points using PostGIS with ST_Distance (if you want to know the distance) or with ST_MakeLine (for the geometry):

If you want to use the network for routing, then you need a network topology. You could try something like pggraph, but source and target attributes are required as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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