ArcPy in Pro more limited than in Desktop?

2886
15
09-08-2017 10:05 AM
LevNagdimunov
New Contributor II

ArcPy for ArcGIS Pro seems more limited than the Desktop ArcPy in crucial ways.

The older ArcPy had the ``arcpy.mapping.UpdateLayer`` function, which could (with the last parameter set to true) update symbology on a layer from a template layer. No such function (or replacement for it) appears to exist in the new ArcPy, unless I am missing it? This is a crucial capability given how limited ArcPy is in terms of directly manipulating symbology, for example for rasters there seems to be essentially no way to modify any symbology now.

There is still the ``arcpy.ApplySymbologyFromLayer_management`` tool. However this tool does not work for all layers (nor did it in Desktop), for example it executes without error but seems to do nothing for symbology of a raster layer of a mosaic, whether you apply symbology from a raster layer to the mosaic raster layer or symbology from an entire mosaic to the entire mosaic.

Separately but related, the functionality of ``arcpy.mapping.UpdateLayerTime`` is also gone, and seems to have no replacement. The entire ability to deal with time appears to be gone, for example layer.time no longer seems to exist for time-enabled layers (also according to the docs).

I am surprised to find such crucial features removed. Has something replaced them that I was not able to find, or is something slated to?

Tags (2)
15 Replies
DanPatterson_Retired
MVP Emeritus

The mapping module has been changed... plus more additions

Have a look through the Arcpy Tree

LevNagdimunov
New Contributor II

I have looked at it, carefully, prior to making the post. I cannot find any replacement to the functionality described above.

There seems to be no functionality to replace symbology based on a template (aside from what was mentioned in the original post), no real additional functionality to manipulate symbology directly, and essentially nothing at all to deal with time. If I missed some, please let me know. This functionality was there before.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Unsupported formats would preclude anything arcpy functionality associated with them of course....

Several data formats are not currently supported in ArcGIS Pro, including raster catalogs, geometric networks, topologies, schematic datasets, geodatabase servers, ArcMap document templates, ArcReader documents, graphs, tiled map packages, and personal geodatabases.

And renaming and reshuffling so would Migrating from...

arcpy.mapping to arcpy.ma and its associated changes..

So if the functionality isn't in Pro or has been added to the...

What's new list it isn't available yet, and that was made quite clear that Pro want' going to be an exact replica when it was released and its changes will be implemented in due time.

Since it is basically free, I would continue to do what you need to do in ArcMap if it isn't available in Pro.

I would also warn people to get up to speed in Python 3.x... 2.7 is terminal and 3.x has been out for over 8 years and the changes in it are more significant than the changes in arcpy!

LevNagdimunov
New Contributor II

I am working on supported data formats: simple rasters and mosaic datasets, where ESRI has been especially pushing the latter. Yet basic functionality that use to be in ArcPy appears missing, and has not been replaced by anything I can find. Most of the functionality you mentioned is likely not coming back as those data formats are essentially deprecated, but how can basic features of the API be deprecated.

Non-backwards compatible changes in Python 2.7 to 3.x are likely to more minor than changes in ArcPy for most codes written specifically for the latter, in my opinion. I am trying to rewrite a code that works in ArcPy for Desktop to also work for Pro, and am stopped by the fact that basic functionality does not appear to be there for ArcPy in Pro.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Lev

You will have to keep an eye on the What's new list link... they are pretty quick to announce any changes in functionality as it arrives.

0 Kudos
JeffBarrette
Esri Regular Contributor

Hello Lev,

I'm with the Esri Python map automation team.  I really appreciate your feedback.  There is no question that we need more capabilities in Pro to reach ArcMap equivalency.  You bring up two very good examples: UpdateLayer and UpdateTime.  Please understand that we are aware of most of the missing pieces and have our best intentions of getting them into the core arcpy.mp module. 

We do NOT have a replacement for UpdateLayer in 2.0 (or even the upcoming 2.1 release).  UpdateLayer was mostly used at transferring symbology from a layer file to another layer.  It worked really well for transferring that symbology from a similar layer file to another similar layer but it broke down quickly if data ranges, feature types, etc were different.  So rather than focusing our time on UpdateLayer - we spend a lot of time exposing Symbology in the Pro arcpy.mp API (which we got overwhelming requests for) .  Now you can explicitly change renderers (5 supported in 2.0 and more to come in future releases), and even get down to the individual items/classes and change symbol properties.  So in a way, the new symbology API provides an alternative approach to UpdateLayer.  That is NOT to say it is a replacement or we won't eventually provide an UpdateLayer equivalent, it is just not on our near-term lists.  We want to make improvements to it because, like I said, it was good with symbology but lacked other common capabilities like updating ONLY specific properties of a layer.  For example, a common request we get is to update ONLY field aliases.  We would love to hear more feedback on this.

UpdateTime is something we have prioritized for 2.2.  We know time is crucial to map automation scenarios and we hoped to get it in sooner but time ran out (bad pun intended).

For 2.1 we be exposing:

- MapSeries (DataDrivenPages) capabilities

- WebMapPrinting capabilities

   - ConvertWebMapToArcGISProject

   - MapView class

   - ConvertLayoutFileToLayout

- And other mics members like ActiveMap, etc.

Thanks again for your feedback!

Jeff Barrette

JoshuaBixby
MVP Esteemed Contributor

Jeff, thanks for all of the information, good stuff.  Given the GUI completely changed from ArcMap to ArcGIS Pro, as opposed to data access, geoprocessing tools, etc..., it is clear that Pro's mapping module involved a lot more effort than other parts of ArcPy.  As much as I think there is still lots of room for improvement/enhancement with Pro mapping module, I think some of the new features are great, like more direct access to renderers.  It is just too bad some of that direct access to renderers can't be backported to ArcMap.

LevNagdimunov
New Contributor II

Thank you for the reply Jeff, a lot of interesting information.

In terms of improving capabilities of symbology manipulation directly rather than something like UpdateLayer, certainly the former is a welcome addition. However there does not appear to be support for manipulating RGB or Stretched symbology for rasters (unless I am misunderstanding the docs), which seem likely to be the two most popular raster symbologies. Are there any near term plans to add such support?

In terms of UpdateTime making a come back in 2.2, great to hear and I definitely think that would be useful along with the capability to again access the time properties at-all (e.g. layer's time attribute).

0 Kudos
JeffBarrette
Esri Regular Contributor

Lev - Raster stretched is definitely on the list for 2.2 (as well as UnclassedColors and ProportionalSymbols).  We did not have the time to finish it (them) for 2.1.  I will look into RGB as being a possibility.

Jeff