const bearing = geodesicUtils.geodesicDistance(point1Wgs84,point2Wgs84,"kilometers");
z {distance: 61.525187404214556, azimuth: 90.42038020754926, reverseAzimuth: 91.18218544411303}
Solved! Go to Solution.
This may be a bug in the SDK. One might expect the algorithm to calculate the azimuth first, and then calculate the reverse azimuth off of that value by simply adding or subtracting 180 (depending on whether the calculated azimuth is less than 180 or not, respectively), but that's definitely not the case here, because the SDK is calculating them independently of each other (for the most part).
Since it appears the azimuth value is correct, you can just fix the reverseAzimuth value manually after the fact:
const bearing = geodesicUtils.geodesicDistance(point1Wgs84, point2Wgs84, "kilometers");
//fix the reverseAzimuth value
bearing.reverseAzimuth = ((bearing.azimuth >= 180) ? bearing.azimuth - 180 : bearing.azimuth + 180);
This may be a bug in the SDK. One might expect the algorithm to calculate the azimuth first, and then calculate the reverse azimuth off of that value by simply adding or subtracting 180 (depending on whether the calculated azimuth is less than 180 or not, respectively), but that's definitely not the case here, because the SDK is calculating them independently of each other (for the most part).
Since it appears the azimuth value is correct, you can just fix the reverseAzimuth value manually after the fact:
const bearing = geodesicUtils.geodesicDistance(point1Wgs84, point2Wgs84, "kilometers");
//fix the reverseAzimuth value
bearing.reverseAzimuth = ((bearing.azimuth >= 180) ? bearing.azimuth - 180 : bearing.azimuth + 180);
Yeah exactly, the difference should be 180°.
Not great that it is a bug, but knowing it is a bug is great.
Thanks.
Hi @SebastianKrings, we appreciate you sharing a potential bug with the broader Esri Community; however, Esri does not actively track software defects posted here. The official channel for investigating and validating bugs is Esri Technical Support. All customers experiencing a potential software bug should leverage technical support to report and investigate the issue.
By reporting bugs through technical support, Esri can better track the scope and impact of the issue across all our customers and better prioritize it with our product teams. Our teams can also investigate the issue more thoroughly to see if there is a solution, workaround, or patch to get you back up and running as soon as possible.
As a reminder, Esri Community is primarily a self-service support platform where Esri users can ask or answer each other’s questions, share feature requests, and collaborate to solve problems with GIS.
*Note that this is a scripted message prompted when posts allude to a potential product bug.