[GIS] How to find Shortest Route between two points in PostGIS without using pgRouting

pgroutingpostgispostgresql

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?

Best Answer

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.