Skip to main content
Question

Parameter Condition Help

  • June 14, 2018
  • 5 replies
  • 14 views

Forum|alt.badge.img

Hello,

I have a field called SPECIES that could contain surveyed tree values such as E,AS,TA within each record; or perhaps the record could contain just AS or maybe JP,BS, etc. What I would like to do is categorize those values in that record into a new field value such as 'Stocked to Hardwood', 'Stocked to Softwood' etc. (see image). However, I'm having problems as what I would like to categorize as 'Stocked to Hardwood' (e.g. record with AS,TA) is getting flagged as 'Stocked to Softwood and Hardwood'. Is there any way I can use existing operators to categorize a value such as AS,TA to be 'Stocked to Hardwood' or do I need to break this SPECIES field up and extract each tree species separately and work with those?

Thanks.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • June 14, 2018

First, I do not think you need the "NOT IN" clauses as the "Else If" excludes those anyway.

Then a question: With "I have a field called SPECIES that could contain surveyed tree values such as E,AS,TA within each record", do you mean SPECIES can be E or AS or TA, or do you mean it can contain "E,AS,TA". In the latter case the IN statement will not work.

Finally: the test clause is by default case sensitive. Are the SPECIES values always uppercase?


Forum|alt.badge.img
  • Author
  • 16 replies
  • June 14, 2018

First, I do not think you need the "NOT IN" clauses as the "Else If" excludes those anyway.

Then a question: With "I have a field called SPECIES that could contain surveyed tree values such as E,AS,TA within each record", do you mean SPECIES can be E or AS or TA, or do you mean it can contain "E,AS,TA". In the latter case the IN statement will not work.

Finally: the test clause is by default case sensitive. Are the SPECIES values always uppercase?

Hi...the SPECIES can contain "E,AS,TA". The values in this field will vary, so "AS" on its own is also possible, or perhaps "JP,BF,AS", etc. The SPECIES values will always be uppercase and separated by a comma if more than one species was surveyed.

 

 


Forum|alt.badge.img
  • Author
  • 16 replies
  • June 15, 2018

I managed to figure this out using StringSearcher, Aggregator and FeatureJoiner (see images).


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • 2252 replies
  • June 15, 2018

@aviveiro

If you use the regexps you use in the string searchers in a conditional attribute creator you would have only 1 transformer

Prevents to route the data trough 3 identical streams, and you then don't need to join the result attribute back to the features.

cleaner, more efficient and faster.


takashi
Celebrity
  • 7843 replies
  • June 16, 2018

I managed to figure this out using StringSearcher, Aggregator and FeatureJoiner (see images).

0684Q00000ArJlLQAV.jpg

0684Q00000ArJzEQAV.jpg

0684Q00000ArK2yQAF.jpg

Good solution.

 

Just be aware that the regular expression "AS|BA|TA|WB|E|BT" matches not only  "E" (hardwood) but "EC" (softwood).

 

A quick workaround is, add leading and trailing commas to both the regex and the "Search In" value. The StringSearcher parameters dialog would look like this.

 

Note: If there could be spaces between a comma and the following species in the SPECIES value, remove the spaces beforehand. [Addition] Or, use this regex to find matched species even if there were spaces after/before the comma.

 

,\s*(AS|BA|TA|WB|E|BT)\s*,

 

0684Q00000ArM5XQAV.png