pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17037: ST_Azimuth used with geography produces results not in accordance with documentation
2+ messages / 2 participants
[nested] [flat]

* BUG #17037: ST_Azimuth used with geography produces results not in accordance with documentation
@ 2021-05-26 18:15  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2021-05-26 18:15 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: jan.heckman@gmail.com

The following bug has been logged on the website:

Bug reference:      17037
Logged by:          Jan Heckman
Email address:      jan.heckman@gmail.com
PostgreSQL version: 11.11
Operating system:   windows 10 pro 21H1
Description:        

The following queries illustrate that ST_Azimuth can fail to follow
https://postgis.net/docs/ST_Azimuth.html with dy < 0 and dx < 0.
The first three queries produce correct results, the last one does not:

select degrees(st_azimuth('POINT(0 1)'::geometry,'POINT(0 0)'::geometry));
 degrees
---------
     180
(1 row)

select degrees(st_azimuth('POINT(0 1)'::geography,'POINT(0
0)'::geography));
 degrees
---------
     180
(1 row)

select degrees(st_azimuth('POINT(0 1)'::geometry,'POINT(-0.01
0)'::geometry));
     degrees
------------------
 180.572938697683
(1 row)

select degrees(st_azimuth('POINT(0 1)'::geography,'POINT(-0.01
0)'::geography));
     degrees
------------------
 359.423171739084
(1 row)

This behavior occurs also with less 'nice' inputs, e.g.
select degrees(st_azimuth(ST_POINT(4.76389,
52.308601)::geography,'POINT(4.43722 51.956902)'::geography));
     degrees
-----------------
 330.11876325276
This is NOT the course to fly from airport AMS to airport RTM.

Doing the query with geometry instead of geography produces a better result,
but should be inaccurate for greater distances:
select degrees(st_azimuth(ST_POINT(4.76389,
52.308601)::geometry,'POINT(4.43722 51.956902)'::geometry));
     degrees
------------------
 222.886982058682



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #17037: ST_Azimuth used with geography produces results not in accordance with documentation
@ 2021-05-26 19:08  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-05-26 19:08 UTC (permalink / raw)
  To: jan.heckman@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> The following queries illustrate that ST_Azimuth can fail to follow
> https://postgis.net/docs/ST_Azimuth.html with dy < 0 and dx < 0.

You need to send this to the appropriate postgis mailing list.
This list is for core-server bugs, and I'm not sure that any
postgis developers follow it closely.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-05-26 19:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 18:15 BUG #17037: ST_Azimuth used with geography produces results not in accordance with documentation PG Bug reporting form <noreply@postgresql.org>
2021-05-26 19:08 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox