yutannihilation opened a new pull request, #183:
URL: https://github.com/apache/sedona-db/pull/183
This pull request is my attempt to implement `ST_Azimuth()`.
```
> sd_sql("select ST_Azimuth( ST_Point(25, 45), ST_Point(75, 100))")
┌──────────────────────────────────────────────────────────────────────────┐
│ st_azimuth(st_point(Int64(25),Int64(45)),st_point(Int64(75),Int64(100))) │
│ float64 │
╞══════════════════════════════════════════════════════════════════════════╡
│ 0.7378150601204649 │
└──────────────────────────────────────────────────────────────────────────┘
Preview of up to 6 row(s)
```
This pull request is mostly for figuring out how to implement a function so
that I can contribute more. So, please feel free to close if there's another
plan to implement this.
I picked `ST_Azimuth()` because it looks relatively simple. I follow the
implementation of Sedona, although I might not understand the code correctly as
I'm poor at Java...
https://github.com/apache/sedona/blob/f9069e7dc6682d53335f0e0c6fb4bd444024d3b5/common/src/main/java/org/apache/sedona/common/Functions.java#L202-L209
I think the implementation is straightforward. One thing to note is that, if
I understand the Sedona's implementation correctly, it returns `0.0` when the
two points are the same. However, PostGIS returns `NULL`. [The
document](https://postgis.net/docs/en/ST_Azimuth.html) says:
> NULL if the two points are coincident
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]