Select to view content in your preferred language

A way to track all the maps a layer is used in

3276
14
08-09-2022 05:33 AM
Status: Open
Savannah2019
Occasional Contributor

Much like when you open the details page of a map and can view at a glance all the layers within that map, it would be very helpful to open a feature layer's details page and view all the maps/scenes that layer has been put in. 

Several times my organization's team has wanted to delete a layer, thinking it's not used in anything, only to find out the opposite after searching through every single map we have or after we get a call from someone saying a map isn't loading properly. Either way, the process is tedious and frustrating. We experiment a lot with different ideas, so not all layers get used and we need to clean them out eventually. It'd be lovely if we could just open a layer and see a list of everywhere that layer is being used. 

14 Comments
davedoesgis

@COSPNWGuy  - This should run on any system that has ArcGIS Pro. It may take significantly longer to do all the queries to the items than if it's running in an notebook running on the same location (Portal/AGOL) hosting the items, so be prepared to wait.

 

The only major difference is how you create the GIS object. Here is how to do it in Pro: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#connecting...

And how to do it in the Python Command Prompt app: https://developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#storing-yo...

DerekMStrout

Hi,

Thank you for sharing this notebook, @jcarlson. I dream of the day that this is available natively somehow in the Item Details pages on AGO, but I'm happy to try this until then (and continue learning about notebooks, which I should be using more anyway).

I've tried running this, but get stuck on specifying the service. In the attached, you can see I've provided the ItemID and Service URL, but the output is the ItemID along with a blinking cursor. Am I meant to provide additional info or should I just wait until the kernel is finished? If it helps, we have 5,268 items in our organization and I've got gig-speed internet, so I am curious if you'd expect this step to take longer than a couple minutes.

Thanks!
Derek

ArcGIS Notebook - Item Dependencies - Kernel Busy.PNG

ZakBaron

I had a similar issue until I found a clarification here:

https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-find-dependencies-in-portal-for...

I tried the same thing as you, putting the itemID, or the URL in the code where it seems to be asking for it, but leave that code as is. Running cell 4 will produce the empty prompt box: put your ItemID in the prompt box, hit 'enter', and then continue running the rest of the code. Works like a charm and many, many thanks to @jcarlson for this script. I have tried out a number of scripts for this, but yours is the only one I could get to work. 

Thanks, 

Zak--

DerekMStrout

I'm sure many of you have seen this clip from last year's UC, but I just stumbled on it and figured I'd share to this thread for anyone else looking forward to being able to see these item relationships in AGO in an upcoming release:

https://mediaspace.esri.com/media/t/1_wnn4gjeb

Item relationships (with concept images) discussed at 21:55.

Derek