Utilising unique numeric IDs in published services

4511
8
11-04-2020 03:18 PM

Utilising unique numeric IDs in published services

Unique Layer ID Assignment

When publishing a service, it is now possible to allow the assignment of unique numeric IDs. In previous versions of Enterprise, these layer IDs were automatically assigned when publishing, using the layer order in the Contents pane to sequentially number layers from 0 onwards. This automatic assignment of IDs based on the layer order in the contents pane has the potential to cause issues when re-ordering or adding layers and overwriting existing services. Even if you change nothing aside from moving a single layer from the top to the bottom of the contents window, this then re-numbers all the layers in the service the next time you overwrite a service and causes disconnects in any web applications or components consuming that service.

The benefits of unique layer ID assignment is that now you can assign a static ID to a layer that will persist regardless of re-ordering of content, or the addition or deletion of content. There are still constraints that need to be understood, which ill discuss later.

This can be enabled in ArcGIS Pro at the time of publishing by selecting on the contents pane → right click on the map icon → map properties → general → “Allow assignment of numeric IDs for sharing web layers”

Once this has been activated, each layer will be assigned a unique ID (visible in the layer properties).

After this setting is configured, the layer order in the contents pane becomes irrelevant and the published service will order the layers based on their unique IDs. This is important to understand when setting up and visualizing your data for publishing.

Example configuration

One way to utilize this functionality is to, as a standard, sequentially number your layers by an order of magnitude of 10 eg. 0, 10, 20, 30

This allows space for the addition of layers at a future point in time, to be able to slot them in between the existing layers by assigning them 15 or 25 (for example).

It also allows for the retirement of layer IDs (eg. 20), without that layer ID then being re-assigned to another irrelevant layer which could cause issues for any downstream configurations that are consuming that layer ID (eg. a web application/report/insights dashboard)

Comments

I have literarry messed up dasboards because of this! now I wish I hadn't updated Pro! How does one fix this going forward?!!

Thanks @Anonymous User for sharing this info. This is great and very informative post!

I'd just like to add a few notes here:

  1. if you never used this option before and you want use this now to overwrite an existing service, then I'd highly recommend you to double check layer-ids that get assigned to each layer (after you check 'allow assignment...' checkbox) with the layer ids you will see in your service REST resources. And make sure they match. If they don't you can open each layer properties page and update Layer ID in its General tab. Otherwise you might run into some issues.
     

    2022-01-12_23-20-04.png

  2. For those who are still using ArcMap for some reasons (please note, we recommend everyone to migrate to ArcGIS Pro), this option is available in there too.

 

Arguably one of the most frustrating updates to Pro. Please give us the option to have it auto assign or add a tool that provides this functionality. 

@chill_gis_dude 

when you check the 'allow assignment of unique numeric IDs...' in a map's Properties page, all layers and tables get assigned with unique ids automatically. Is it not working for you? I'm afraid it is not very clear from your comment above.

Look forward to your feedback.

Tanu

So allowing Unique IDs for multi-layer documents to tie down specific REST endpoints has been around in ArcMap since at least 10.2 or 10.3 (I'm not sure if it was supported in Pro initially but is right there in your face starting with 2.9.2). There are good reasons to want that functionality when managing Public REST Legacy services with many many endpoints that have other applications tied to specific items - but I'd consider that an advanced option and requires rethinking and being very careful managing Maps (either in ArcMap or Pro) that have Map Properties->Allow assignment of unique numeric IDs for sharing web layers turned on. It is not what I would consider good default behaviour to have on. However it looks like starting around Pro 2.9.2 it now looks to be trying to force users to turn on the map setting as pictured by initial post on this thread. I suggest this is not the right default behavior desired.Allow assignment of unique numeric IDs for sharing web layers setting Error 00374.PNG

Suggestion is that Pro should be able to publish a map without forcing user to turn on Map Properties->Allow assignment of unique numeric IDs for sharing web layers.

There is a workaround with an additional setting (Also I think new in 2.9.2) that allows publishing without assigning layer IDs - it is buried in the Parameters of the Configuration of the Web Service. Traditionally that panel is populated from parameters of an existing service - why this button is there I don't fully understand - Possibly a future property of a Published Service? Anyway by unchecking this setting you can Publish service normally. Suggest if this new setting was set as unchecked by default people could keep publishing as before without freezing layer IDs in Map. This of course is all figured out in ArcMap product.

Allow assignment of unique numeric IDs for sharing web layers workaround.PNG

I am submitting this request as I was trying to log it as a Bug - but was told this is a Feature - so need to post here to get some traction on getting it changed back (or at least to behave like ArcMap):)

@TanuHoque 

It does allow automatic assignment if you check that option in the map properties, however it does not assign added layers in order.

For example,

We have a web layer group with 120 different layers on it that is published into a web map that users in our organization need. It's a lot of layers, but they need them all on one map.

If we make changes and have to add a layer towards the top of the layer order. I have to go in and manually reassign every layer after it in each layer's layer properties. Unfortunately we need the layerIDs to be in consecutive order because we use a security addon called Con Terra that requires this for ease of use. 

Thanks @chill_gis_dude @OderMarcusWCED  for your valuable feedback and providing your details workflows.

to add to this discussion:
in the window Share As Web Layer > Conent > My Content, there is a summary of the Layer ID's. The layer ID is a clickable link in blue that take you to the Layer Properties to swiftly change the layer id. This is a good functionality. 
But it does not list  group headings, just layers so it's not telling the full story of your map. I think this is just an oversight but correct me if I am wrong. 

LAYERIDHEADER.jpg

Version history
Last update:
‎11-04-2020 03:18 PM
Updated by:
Anonymous User
Contributors