Opened 3 years ago

Closed 3 years ago

#3588 closed defect (invalid)

Incorrect distance calculation

Reported by: przemekp Owned by: pramsey
Priority: medium Milestone: PostGIS 2.2.3
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

SELECT ST_Distance(ST_GeographyFromText('SRID=4326;POINT(59.3327903748 18.0644893646)'),ST_GeographyFromText('SRID=4326;POINT(59.3362 18.0704)'))

747.17041

According to google or http://www.movable-type.co.uk/scripts/latlong.html it should be around 506 meters.

Change History (2)

comment:1 Changed 3 years ago by pramsey

If you put the coordinates in the correct order, that's exactly what you get

SELECT ST_Distance(
ST_GeographyFromText('SRID=4326;POINT(18.0644893646 59.3327903748)'),
ST_GeographyFromText('SRID=4326;POINT(18.0704 59.3362)')
)

  st_distance  
---------------
 507.395146393

comment:2 Changed 3 years ago by pramsey

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.