ArcGIS Pro Legend 'unique values' symbology using ArcGIS Online data

4637
11
Jump to solution
09-25-2017 08:45 PM
PeterSmith3
New Contributor III

I recently updated to ArcGIS Pro 2.0.1 with the hope of being able to utilise a dynamic legend which shows only those symbols which are present within the map extent.

However, this feature only partially works for me. It's OK for all data stored locally (whatever the type of symbology) and it's OK for ArcGIS Online data which has 'single symbol' symbology. However, for ArcGIS Online data with 'unique values' symbology, it fails to show anything in the legend for that layer.

Using the count feature in the symbology pane, I get a '?' count value where there's no data with that unique value, and a '0' count value where there is data with that particular unique value.

The data is correctly symbolised in the map but nothing shows in the legend for that layer.

I'm guessing that, although the data displays OK in the map, the legend utilises the same count value as that in the symbology pane and, because the count value is incorrectly shown as '0', nothing is displayed in the legend.

My question is: Am I missing a step in the process, or is there a bug which stops ArcGIS Pro from counting unique value symbology objects correctly when the data is hosted in ArcGIS Online?

Symbology pane count values

The image above shows two zero count values where there should be a larger count value as there is data for these values in the map. The ? values appear where there is not any data with these unique values.

0 Kudos
1 Solution

Accepted Solutions
TomBole
Esri Regular Contributor

Hi Peter, 

It's likely you ran into a bug. The Pro legend was not properly supporting feature service point layers. This has been resolved with version 2.1.

We also discovered a bug where all legend classes were being returned for unique value rendered feature service (point, line, polygon) when no features were present in the map extent. This issue has been addressed in version 2.2.

Hope this helps,

Tom

View solution in original post

0 Kudos
11 Replies
Robert_LeClair
Esri Notable Contributor

Is the ArcGIS Online service a Map Image Layer or a Feature Layer?  The reason I ask is I found a similar Esri Support Services case that's very close to what you're experiencing.  Granted it's an ArcMap case, but I would think the logic applies in Pro.  Below is the text from the case:

"When a map service is added into an ArcGIS online map viewer or in content, it is treated as a "Map Image Layer". This is the case where all the layers are essentially treated as map services, whose response to the Map Viewer client is an "Export to Map" function. This function returns a snapshot of your data in its true symbology. This is the reason why it retains the symbology that you have set in the MXD.

When a single layer in a map service is added into an ArcGIS online map viewer or in content, it seems to be treated as a "Feature Layer". This is the case where all the layers seem to be treated as feature services and have different rules for symbology in ArcGIS clients. In order for these layers to retain the symbology that an MXD contains, it needs to be a Simple Fill or a Picture Fill Symbol. Feature services support simple, unique value, class break, and cartographic representation renderers. 

Additionally, feature services do not support proportional symbols or unique value renderers based on multiple fields. Documentation link: http://server.arcgis.com/en/server/10.4/publish-services/windows/author-feature-services.htm#ESRI_SE..."

0 Kudos
PeterSmith3
New Contributor III

Thanks for taking the time to reply.

The data is a hosted feature layer which contains point, line, and polygon layers. I'm not using the ArcGIS map viewer at all. I'm only using ArcGIS Online to host the data.

I'm pulling the data from ArcGIS Online into ArcGIS Pro, and the symbology is applied in Pro.

I'll try keeping a simple symbology in Pro to see if I can get a basic count that way. At least then I'll know whether the problem is the type of symbology used or not.

0 Kudos
Robert_LeClair
Esri Notable Contributor

Sounds like a good plan - let me know what you discover and we'll go from there.

0 Kudos
TomBole
Esri Regular Contributor

Hi Peter, 

It's likely you ran into a bug. The Pro legend was not properly supporting feature service point layers. This has been resolved with version 2.1.

We also discovered a bug where all legend classes were being returned for unique value rendered feature service (point, line, polygon) when no features were present in the map extent. This issue has been addressed in version 2.2.

Hope this helps,

Tom

0 Kudos
JustinConnerWR
Occasional Contributor II

While this is not quite related, I would love to hear how to easily modify the labels when using multiple fields with unique values.  I would previously simply modify the delimiter (so if symbolizing on city + school district, instead of "Madison, Madison School District" I could change the delimiter to "Madison - Madison School District".  Is it now necessary to save the symbology, then access it with a Python script (or something) to batch-modify the labels?

0 Kudos
JeffBarrette
Esri Regular Contributor

This can be done with Python.

Try pasting the following code into the Python window for ArcGIS Pro.  Make sure your indents are correct (line 6 has a 2 space indent and line 7 has a 4 space indent).

p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('map name here')[0]
l = m.listLayers('layer name here')[0]
sym = l.symbology
for grp in sym.renderer.groups:
  for itm in grp.items:
    itm.label = itm.label.replace(","," - ")
l.symbology = sym

Jeff

0 Kudos
JustinConnerWR
Occasional Contributor II

Thanks! I hadn’t jumped from arcpy.mapping to .mp yet, but it seems 2.1.2 might be mature enough to justify trying it out. It’s the first time I’ve successfully imported multiple maps without Pro crashing, and I also figured out how to tweak Arcade enough to get that to work as well.

0 Kudos
JeffBarrette
Esri Regular Contributor

It can't be done with arcpy.mapping because we did not expose the same level of symbology detail in the ArcMap API.

0 Kudos
PeterSmith3
New Contributor III

Just moved to v2.2.1. Legends now display as expected.

0 Kudos