Use separate attributes to control Symbol/Size/Colour ?

1951
8
03-23-2017 07:33 PM
Highlighted
New Contributor

I have a requirement for an addin that imports and displays points that have already been externally symbolised;
i.e. the imported point data has attributes _Symbol, _Size, _Colour that can be translated to esri equivalents.

I have been able to implement a CIMUniqueValueRenderer that will translate the _Symbol attribute value to appropriate symbol and that's working.

Is it possible for the renderer to use separate attributes (_Size, _Colour) to set size and colour ? or perhaps is there some other technique to achieve this?

I'd appreciate any pointers/example code.

Reply
0 Kudos
8 Replies
Highlighted
Esri Contributor

Jack,

yes you can do that. Please take a look at the documentation for this topic at Proportional symbols—ArcGIS Pro | ArcGIS Desktop and then the section Vary symbology by attribute. Once you have setup the renderer to your liking you can use the CIM Viewer (https://community.esri.com/groups/arcgis-pro-sdk/blog/2016/08/04/arcgis-pro-cim-viewer ) to take a look at the layer CIM representation to see what you need to configure in code and to see the appropriate CIM syntax.

- Thomas

Reply
0 Kudos
Highlighted
New Contributor

Thanks Thomas , I have looked through the articles you referred to and checked out CIMViewer. Actually I cannot see how to achieve the desired state in the retail UI.
For example, using your USA_Major_Cities dataset as an example of what i need to display, how would i set up symbology such as :

1) control symbol shape by the "Place Class" field
[e.g. squares for cities, triangles for villages etc]

plus

2) Control the symbol size by the "Avg Fam Sz" field

plus

3) Control the symbol colour by a continuous range using the "Med Age M" field

Note i want the fields to be independently controlled - there is no benefit to the user in symbolising the permutations of symbol shape/size/colour etc and in any case the permutations would run to hundreds/thousands;

Alternatively is it possible to implement my own renderer ?

thanks, Jack

Reply
0 Kudos
Highlighted
Esri Contributor

Jack, what you are describing is the purpose of our "DictionaryRenderer". However, currently, there is only built in support for the mil2525d specification. It has similar requirements to yours - shape, color, symbol, etc. all driven off multiple attribute values of each row (you can see a sample here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/DictionarySymbolP...).

Would you mind sharing more details of your requirements please as well as a dataset perhaps? It is hard to tell what is possible and what enhancements would be needed without more details

Note: If you click on "Advanced Editor" in the Geonet comment screen (just above the toolbar I think) you will get an "Attach" icon at the bottom of the screen which will allow you to attach a zip file or whatever.

***EDIT***

I want to add - there are "Visual Variables" in Pro that you an set up with attributes or expressions involving attributes to control transparency, orientation, size, etc. (but not ~shape~). The user doc. is here: http://pro.arcgis.com/en/pro-app/help/mapping/symbols-and-styles/symbolize-feature-layers.htm. Look for "Vary transparency by...", "Vary symbology by...", etc. in the TOC. They are referring to this guy on the symbology pane. Disclaimer: I have not personally fiddled with these options.

Reply
0 Kudos
Highlighted
New Contributor II

[I have added a specific set of test data, screenshots]
The attached csv data file contains point locations and various attributes.

A fairly common use case would be where we wish to display the points coloured by the attribute "Regolith Unit", shape controlled by the attribute "Sample Medium" and marker size controlled by the attribute "Cu_ppm";

To do this in arcgis in the past the mechanism was to create a composite field that has the 3 attributes appended, and programmatically add all the permutations to a unique value renderer - see the screenshot

This is not great - as you can see that legend (legend_combo.jpg) is pretty unweildy at 130 permutations, but could easily be many hundreds more than that.
Since the attributes are unrelated, having a legend listing all of the combinations is not really of much use to the user;

In the source software application, the data has been symbolised by each attribute seperately and that legend (legend_separate.jpg) is much more useful to the user
(note for the size legend, an arbitrary shape is used)

My understanding is that it is not possible in either the retail gui of arcgis pro, nor through the api to create symbology in this manner - is that correct ?

If my understanding is incorrect, would you be able to explain to me how to accomplish this?

Reply
0 Kudos
Highlighted
Esri Contributor

Hi Jack, thanks for this. I will pass this data, etc. on to the mapping team. Varying by color and size is supported (via Visual Variables - please refer to my link to the ArcGIS Pro user guide in my previous reply) but varying by shape (of the marker) is not.

Reply
0 Kudos
Highlighted
Esri Contributor

Jack, try this. I think this meets your needs. Step by step is in the word document. The attached is a 2.0 project (which you can use if you have the beta software) but you should be able to re-create the project using the Word doc in 1.4. 

Reply
0 Kudos
Highlighted
New Contributor II

Thanks for taking the time to put that together Charles - it's certainly closer than i had got with the retail GUI.

Here are my outstanding aspects of this :

1) I wished to set the shape by ranges of a numeric field (cu_ppm) So i used graduated symbols instead, and then went to vary by attribute : that works fine.

2) Now I go to set size by a text field (Sample Medium) , but I only get numeric fields offered when i click on the database icon, so i cannot do that;
[you have used a numeric attribute (cu_ppm) but even then i cannot see how you would map ranges of cu_ppm to specific sizes ? i would be expecting a dialogue that allows for range and sizes?]

3) Now I go to set colour (and outline colour) by a text field (Regolith Unit) I only get offered text attributes from text fields, which in this case is fine, but I would need some of dialogue to set colour by text value of attribute.

[Note that if i needed to colour by ranges of a numeric field would that not be possible? i can't see how you would do it]

You are saying that if i set a hexadecimal colour value 


4) I cannot see the changes i have made to size, colour reflected in the legend in arcgis pro legend pane, only the shape - is that a limitation ?

5) I notice the CIM viewer shows no code for this scenario; i can extract the xml for the renderer through code. But what would be far more helpful is some brief API example code of how to achieve this ?

Thanks

Reply
0 Kudos
Highlighted
Esri Contributor

Jack, this is for #3 and #4

Reply
0 Kudos