Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4718 closed defect (fixed)

ST_Azimuth calculating with point of geography type returns negative value

Reported by: Lake Owned by: pramsey
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: 3.0.x
Keywords: Cc:

Description

According to the doc description: The azimuth is angle is referenced from north, and is positive clockwise: North = 0; East = π/2; South = π; West = 3π/2. But when giving two points of geography type, it returns negative value. eg:
SELECT degrees(ST_Azimuth(ST_GeographyFromText('SRID=4326;POINT(77.46412 37.96999)'), ST_GeographyFromText('SRID=4326;POINT(77.46409 37.96999)'))) AS degA_B;

Change History (2)

comment:1 by Paul Ramsey <pramsey@…>, 4 years ago

Resolution: fixed
Status: newclosed

In 4f1fecf/git:

Return positive azimuth values per the documentation.
Closes #4718

comment:2 by robe, 4 years ago

Shouldn't we also fix this in 3.0 branch or is it more involved?

Not backporting because a change in behavior.

From irc Paul's comment

It changes behaviour is why I didn't.
Since the answer returned isnt' "wrong" per se, it's also not super urgent.
It's just returning -90 instead of 270
Last edited 4 years ago by robe (previous) (diff)
Note: See TracTickets for help on using tickets.