1

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

In ArcGIS Pro the label overlays perfectly initially: Looks perfect to start

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:

Change to Web Mercator Aux Sphere

Then ArcGIS Pro puts the label at the wrong angle and at an odd offset:

Now its wrong

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?

  • Short answer: No. Azimuth in 4326 means nothing (unless calculated with geodetic functions, in which case it wouldn't look right). I doubt the Web Mercator azimuth is true either (because of Auxiliary Sphere, if nothing else). If you Edit the question to include one or two specific line segments, then there's an opportunity to do math. – Vince Aug 3 at 11:11
  • The GeoJSON for the line in question is: ` {"type":"LineString","coordinates":[[-7727984.57838143,6200249.38476172],[-7594441.69836957,6297632.81487629]]}` The thing is that the ST_Azimuth mostly works perfectly, its only the odd line that has this issue. – Frank Conry Aug 4 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.