[postgis-users] Calculate the distance between a point and a line

Paul Ramsey pramsey at cleverelephant.ca
Wed Jan 6 07:45:15 PST 2021



> On Jan 6, 2021, at 7:33 AM, Luca Bertoncello <lucabert at lucabert.de> wrote:
> 
> Am 06.01.2021 16:27, schrieb Paul Ramsey:
> 
> Hi Paul,
> 
>> (a) you have the longitude and latitude reversed in your POINT
> 
> Arghhhh!!!!! OK, with the parameter in the correct way of course it works...
> 
>> (b) use ST_DistanceSpheroid() or cast to geography instead of doing
>> that heinous mercator hack
> 
> I don't have this function in my instance of PostGIS... Maybe I use an old version? I installed it from Debian Repo and I have a Debian 10...

Go ST_Distance(this::geography, that::geography) then.  DistanceSpheroid() I think still requires a spheroid definition which makes it clunky

http://postgis.net/docs/ST_Distance_Spheroid.html

> 
> Thanks
> Luca Bertoncello
> (lucabert at lucabert.de)
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users



More information about the postgis-users mailing list