Skip to content

Update azimuth to be calculated _from_ feature _to_ center point

Jeremy M Fee requested to merge github/fork/jmfee-usgs/fix-azimuth into master

https://earthquake.usgs.gov/ws/geoserve/places.php reports azimuth to be:

azimuth = Direction (in decimal degrees [0, 360]) from the Feature to the center point (latitude, longitude).

Below are attached example queries before this change. These can be pasted into https://geojson.io , the red point is the search point and others are results. Note the azimuth currently is reported from the center point to the feature point; so it is off by 180 degrees.

utah_geoserve.txt ca_geoserve.txt

The ST_Azimuth is less than clear, but the images provide an explanation https://postgis.net/docs/ST_Azimuth.html

Merge request reports