I am trying to calculate the distance using the ST_Distance function in the postgres database.
I am using following query:
SELECT ST_Distance(
ST_GeogFromText('SRID=4326;POINT(52.3551151038034 4.87660185549649)')
, ST_GeogFromText('SRID=4326;POINT(52.3549985339677 4.87622001617791)')
);
For this the distance is returned as 44.159975697 meters.
When I am comparing this value with other sources, for example Haversine formula explained in this post. The Haversine formula return the value as 0.0289913126501404, which is roughly 29 meters.
What am I doing wrong with my query here?
ST_GeogFromTextuse WKT geometry so coordinates have to be POINT(longitude, latitude) – mgc Nov 11 '16 at 17:16