herrkaefer / psycopgr

A Python wrapper of pgRouting for routing from nodes to nodes on real map.
MIT License
28 stars 7 forks source link

__node_distance only works for geographic coordinate systems #4

Closed jmtaysom closed 5 years ago

jmtaysom commented 6 years ago

Node distance uses ST_GeogFromText which only accepts data in a geographic coordinate system whereas ST_GeomFromText does the reverse and only accepts data from a projected coordinate system. One possible solution would be to try one and if it throws an error then it could try the other.

herrkaefer commented 5 years ago

Sorry for this so late reply...

Based on this doc https://postgis.net/docs/ST_Distance.html, node_distance now supports these two format, though for each format, calculation is implemented in a default manner. It detects the format set in meta_data. Also node_distance now become a public API.