I am trying to create a label that will overlay a line in ArcGIS Pro, the layer is coming from a PostGIS database. The underlying materialized view for the label/symbol overlay is something like this:
SELECT label, degrees(public.ST_Azimuth(public.ST_StartPoint(public.ST_UNION(geom)), public.ST_EndPoint(public.ST_UNION(geom)))) AS Azimuth, geom FROM TABLE
Then I go to the Table of Contents and under map properties change the map's coordinate system from lat/long to Web Mercator Auxiliary Sphere:
Then ArcGIS Pro puts the label at the wrong angle and at an odd offset:
This phenomenon is localized to certain areas of the globe. It seems to me that the offset makes no sense. I have tried projecting the line geometry into Web Mercator (srid: 3857) using
ST_transform and getting the azimuth using
ST_Azimuth and the azimuth angle changes but still isn't right.
Shouldn't ArcGIS Pro at the very least reproject the the point on the line and shouldnt it match the azimuth if I calculate it in Web Mercator in PostGIS?