Allow Linking of Coordinate System of grats/grids to map

992
3
09-14-2020 04:46 PM
Status: Open
Labels (1)
TimothyBarnes
Occasional Contributor

When updating the coordinate system of a map (i.e. moving to a different UTM zone) using Python in ArcGIS PRO, the coordinate system of the associated layout grid(s) is not updated. Choosing the Coordinate System of the grid to match the coordinate system of the map within the UI only reads that coordinate system one time (it then sets it to that coordinate system)- It isn't "tied" to the map and so is not updated when the map is updated which is a useful option when writing tools to work in multiple utm zones.

There doesnt appear to be away within python to update the coordinate system of grids directly.

3 Comments
KoryKramer

Thank you for submitting this Timothy Barnes‌.  

This is not a bug.  If you believe you are experiencing something in the software that may be a bug, the best avenue is to contact technical support.  The ArcGIS Ideas site is designed to request new features/functionality.  Could you please edit the idea's title to remove the word bug?  Thank you!

For a measured grid, the grid can have a different coordinate system than the map and therefore it should not automatically update.  

There is no way within python to update the coordinate system of grids directly.

The grid's coordinate system can be changed using Python CIM access.  Here is some example code:

 

p = arcpy.mp.ArcGISProject('current')

lyt = p.listLayouts()[0]

cim_lyt = lyt.getDefinition('V2')

mf = cim_lyt.elements[0]

mf.grids[0].projectedCoordinateSystem.get("wkid")

3446  #RI SPF

mf.grids[0].projectedCoordinateSystem['wkid'] = 26919        #UTM Zone19

mf.grids[0].projectedCoordinateSystem['latestWkid'] = 26919

lyt.setDefinition(cim_lyt)

Note: set both wkid AND latestWkid.

Given that, the idea becomes something more like "Provide a way to automatically update Coordinate System of grats/grids when changing map coordinate system"

TimothyBarnes

Thanks Kory- have amended title. It appeared as a bug as setting the coordinare system to the maps coordinate system seemed like it should 'stick' to that map sr rather than just read it and then list it as an actual coordinate system...if that makes sense. While there are definitely times when having different grid coordinate system than the map is useful, having the ability/tick box to tie that to the map would also be useful.

However, the CIM access is definitely something I can use to achieve this.

Cheers

MarcNakhleh

Hi,

I am seconding Timothy's comment here, and I would consider this a bug because:

  • The expected behaviour, or one analogous to it, is the default in previous ArcMap releases ("Use the data frame's current coordinate system")
  • There is currently no option AT ALL to reproduce this behaviour in the current ArcGIS Pro interface (clicking on the Map name option simply pulls up its associated coordinate system, instead of linking them together)
  • The changes in abstractions between ArcGIS Desktop and Pro do not eliminate the need for such behaviour (and I do not think that we are edge cases.)

I am glad that a solution exists, and have successfully implemented it on my own system, but it took a few hours of Googling to locate this post. I hope that others have more success than me.

Here is a link to the CIM docs: https://github.com/Esri/cim-spec/blob/master/docs/v2/CIMLayout.md