Sample Header Ad - 728x90

Postgis reporting a point is 1216m away from itself using ST_Distance

0 votes
4 answers
68 views
I have a table containing a geometry column in 4236 projection. I take the ST_X and ST_Y values from one row, and create a point from them. I then transform the point and the original geometry column value into 3857 projection to get a 2d distance between then using ST_DISTANCE. I expect the distance to be ~0. The answer I actually get it 1216.something metres. Here is example code which creates two points, which should be identical, and takes the distance between them, giving the same ~1216m answer select ST_Distance( ST_Transform( ST_SetSRID( ST_MakePoint(5.6100, 58.8900), 4236), 3857), ST_Transform( ST_SetSRID( ST_MakePoint(5.6100, 58.8900), 4326), 3857)); I'm presumably making some stupid mistake here (I am by no means a GIS expect), but what is it that I'm doing wrong?
Asked by khafka (79 rep)
Dec 1, 2020, 04:59 PM
Last activity: Dec 2, 2020, 11:43 AM