ArcPro symbolize based on unique values

1739
5
01-25-2019 02:58 PM
SRC_BOCCGIS_Department
New Contributor II

I am using ArcPro 2.3.0 (just upgraded today).  I have a layer of street centerlines and want to symbolize all of them as grey except 2 streets will be a different color based on streetname.  This is so simple in ArcMap! Just click on properties- symbology- categories - choose the field - click Add Values - since the streetnames list is so long I always just type it in to add to the list and voila! Then I change color of both categories.

I CANNOT find a way to do this workflow in ArcPro.  Here's my (incorrect, apparently) workflow: Go to Appearance - Symbology-  choose unique values - then make Field 1 be the streetname....and there I'm stuck. If I click the green X it wants me to build an Arcade expression but I don't want to concatenate or trim anything. If I go below that and click on the classes tab every button I click gives me a problem - I keep generating the entire list and I can't figure out how to remove the extra values - plus if I type the value in - it seems to be making it a new value - not selecting the existing street. 

What am I doing wrong? It's a Friday, and I was trying to get this map printed for a customer. I'm using an AGOL basemap so I figured Pro would be best for that and now this silly symbology thing is making me late.  I've spent almost 1 hour looking at tutorials and ESRI pages about it - I do not need to calculate anything or display anything fancy - I just want all my streets in grey and these 2 in blue.  My hatred of ArcPro grows every day - and I promised myself this would be the year I mastered it, but all I want to do is throw it out the window.

Please some of you Pro experts, have pity on a newbie and point out the simple, non-intuitive way to do this. Thank you!!

0 Kudos
5 Replies
XanderBakker
Esri Esteemed Contributor

Hi SRC BOCC GIS Department ,

There are several ways to do this. You can for instance load all the values and select them all to assign the grey line and then find the 2 roads and define a blue line for them.

If you are going to create a legend you will not wan tto have the entire list of road names, so you might want to select all the grey lines and group them (right click and you will find the option). 

Since you mentioned Arcade, there is also a simple way to do this using an Arcade expression. Copy the two names of the roads you want to assign a blue color and use the following expression:

if (IndexOf(["N. Hatton Ave.", "N. Castle Heights Ave."], $feature.Fullname) > -1) {
    return "Blue";
} else {
    return "Grey";
}

Your expression window will look like this:

Note that "N. Hatton Ave." and "N. Castle Heights Ave." are the two roads I'm interested in. This will return two values either "Blue" or "Grey" (You shoud assign more meaningful names to these). Once you do that, the Unique Value Renderer will only have two items:

SRC_BOCCGIS_Department
New Contributor II

Thank you for your help, Xander - this put us on the right track!

XanderBakker
Esri Esteemed Contributor

I'm glad that helped. Since you have experience with ArcMap there are a couple of resources available to help migrate from ArcMap to ArcGIS Pro:

There is also a book that will be released next month (if I'm correct)

GulnurKhalmurzayeva2
New Contributor

Hi,

Thank you for this cool example.

I have one question, I am just new in coding...

If I want to make blue all the roads which contain the word "Green"? 

I have tried "%Green%" but it doesn't work.

and additionally to above blue line I want to add red line for all roads which contain the word "ave"?

So I try below code, but all roads are grey...

if (IndexOf(["%Green%"], $feature.Fullname) > -1) {
    return "Blue";
} else {if (IndexOf(["%ave%"], $feature.Fullname) > -1) {
    return "Red";

}
    else {return "Grey";
}

Thanks in advance

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi gukashy_gis , 

You should use the function FindText Functions | ArcGIS for Developers 

IndexOf will search an item in an array and Find will search a part of a text inside another text.