1

I am trying to display small mammal trapping data in ArcMap 10.3.1.

I am dealing with a point feature class. There are 3 relevant fields in the attribute table, one for each night of trapping, containing categorical data (type of species caught). Each night, the traps can catch 1 of any 4 species. So, some points will have a capture of the same species across the 3 nights, while others might capture a different species each night. There might be any combination of species caught during the 3 nights of trapping for any particular point.

I am interested in displaying which species were caught at which trap. I don't care about the order or if a trap caught the same species more than once.

I am having difficulty finding an efficient way to display these data. I've tried "Unique values, many fields" in the symbology tab of properties box, but that gives all permutations while I am only interested in relevant combinations.

I think one efficient display would be to assign each species a circle with a unique color and diameter. This way, multiple species could be seen for each point if one trap catches multiple species, and the legend would only have to show 1 symbol for each species.

Another problem I cannot resolve is how to collapse the information when one point has duplicate data across fields. In other words, how to collapse if one trap catches the same species for multiple nights.

2
  • If there are only 4 species you can copy the layer 3 times and use a definition query to restrict to a particular species per layer then display with a slight offset but the a single symbol for each layer. Or add a field for each species and populate "yes" if the species is caught in any one of the 3 fields and "no" if it doesn't exist in any field, combine the fields into a single field (it will look like "yes,no,no,yes") then display all the unique combinations. There's two methods that might get you close to what you're after. Nov 29, 2017 at 0:25
  • @MichaelStimson I used your 1st suggestion, no definition query required though/
    – FelixIP
    Nov 29, 2017 at 3:04

2 Answers 2

2

I used 3 layers with the "same" symbology and placed symbols under each other using y-shift and labelled 2nd night using:

'%s\n%s\n%s' %( [NIGHT_1] , [NIGHT_2] , [NIGHT_3] )

enter image description here

Another option is using single field and populate it by:

"-".join(sorted([ !NIGHT_1! , !NIGHT_2! , !NIGHT_3! ]))

results in too many cases and doesn't look good in my opinion:

enter image description here

Perhaps you'd like using:

"-".join(list(set([ !NIGHT_1!, !NIGHT_2!, !NIGHT_3!])))

which will result in a fewercases:

enter image description here

2
  • Your last option, adding the set, is definitely the way I would go. Might consider adding a sorted before the list because sets aren't necessarily sorted.
    – Fezter
    Nov 29, 2017 at 4:43
  • @Fezter check my edits to my answer. I wasn't sure how they wanted to display the finds (labels or symbols). I've added options for both.
    – jbalk
    Nov 29, 2017 at 5:41
1

You can create a label expression in ArcMap.

Here is the expression I created, which works for your use case (Open the label properties and click 'expression'. In the expression box, tick 'advanced' and use the Python Parser):

def FindLabel ([ID], [Name], [Comment]):
  a = str( [ID] )
  b = str( [Name] )
  c = str( [Comment] )
  if a==b==c:
    return a  
  elif a==b!=c:
     return a + ", " + c
  elif a==c!=b:
    return a + ", " + b
  elif b==c!=a:
    return a + ", " + b
  elif a!=b and b!=c:
    return a + ", " + b + ", " + c

Here is my table:

enter image description here

Here are the labels that are created with the expression (red labels):

enter image description here

You can also create a new attribute column to hold the value sets for each record. This could be used to create symbology for each species group.

Here is the field calculator expression to achieve this:

code block:

def specSet(spec1, spec2, spec3):
  a = str(spec1)
  b = str(spec2)
  c = str(spec3)
  return ",".join(sorted(set([a,b,c])))

expression:

specSet(!Species1Field!,!Species2Field!,!Species3Field!)

With my example table above, the new column produced has the following values:

a

a,b,c

a,b

a,b

a,b

With these values I can classify the points using 3 symbols (a; a,b; a,b,c)

2
  • He is dealing with 4 possible values stored in 3 fields. Your solution is about something else but.
    – FelixIP
    Nov 29, 2017 at 5:48
  • But what? It doesn't matter how many different values there are. It's based on the fields, not the values. The first part explains how to set up labels for the find sets. The second part explains how to calculate the sets into a new field to be used for symbology. Number of different values is irrelevant if you actually look at my answer. If there are 4 different values the possible sets would be (a; b; c; d; a,b; a,c; a,d; b,c; b,d; c,d; a,b,c; a,b,d; a,c,d; etc.).
    – jbalk
    Nov 29, 2017 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.