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:

   degrees(public.ST_Azimuth(public.ST_StartPoint(public.ST_UNION(geom)), public.ST_EndPoint(public.ST_UNION(geom)))) AS Azimuth,

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?

  • 1
    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 '19 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 '19 at 19:08
  • Is your data concentrated in a certain location? If so, I would recommend using a local projected coordinate system instead, like State Plane. – Jacob Helfman Dec 16 '19 at 4:20
  • no my data spans the globe. I actually solved this by projecting in PostGIS first. For whatever reason having Arc retroject caused issues... – Frank Conry Dec 30 '19 at 18:34

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.