Skip to main content
Question

Test against table of lookup values

  • November 25, 2013
  • 3 replies
  • 16 views

Hi,

 

 

I am working with a ESRI file geodatabase.

 

 

I would like to test if cetain field contains a specific value from a lookup table (in an ideal world this testing would not be required as this would have been mitigated agaist by using domains - however I am where I am!).

 

 

So essentially I have two tables, first my feature class: Roads_FC

 

 

[ID],[RoadName],[RoadType]

 

1,High Street, Sealed Road

 

2,School Lane, Unsealed

 

3,Smith Road, Concrete Slabs

 

4,Jones Street, Sealed Road

 

5,Downy Street, Tarmac

 

6,Boris Street, Tarmac

 

 

My second table is a CSV 'FieldList' constructed as follows:

 

[FeatureClass],[Field],[RoadTypeVaL]

 

Roads_FC,RoadType,Concreate Slabs

 

Roads_FC,RoadType,Sealed Road

 

Roads_FC,RoadType,Unsealed

 

Rivers,RiverType,Main River

 

Rivers,RiverType,Medium River

 

Rivers,RiverType,Small River

 

 

So I want a test that tells me that items 5 and 6 do not contain a conrrect value from my field list (i.e. "Tarmac" is not a valid value).

 

 

I can filter 'FieldList' easily using a 2 testers - first to filter by the feature class I am testing, and secondly by the field I am testing.  However I cannot work how to then check if the current row in my Roads Feature classe has one of my filtered values in 'FieldList'.

 

 

Can anyone help?

 

 

Regards,

 

 

Kevin

 

 

3 replies

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • November 25, 2013
Hi,

 

 

To be able to test on both attributes and their values, you need somehow to merge/join the feature class and csv.

 

Hope this helps,

 

 

Itay

  • Author
  • November 25, 2013
Hi Itay,   I think I managed to solve this one - I have run a test on two CSV files and it seems to have worked.   I used the Feature Merger transformer to get the result I wanted.    The data I actually had for my valid field values was in this format:   [FeatureClass],[Field],[Values] Roads_FC,RoadType,Concreate Slabs; Sealed Road; Unsealed Rivers,RiverType,Main River; Medium River; Small River   Rather than:   [FeatureClass],[Field],[Value] Roads_FC,RoadType,Concreate Slabs Roads_FC,RoadType,Sealed Road Roads_FC,RoadType,Unsealed Rivers,RiverType,Main River Rivers,RiverType,Medium River Rivers,RiverType,Small River   This meant that I needed to filter the data first in FieldList.csv so I first used the Tester to filter on Roads_FC and RoadType field.  Then I used the AttributeSplitter and the ListExploder to get the values to pass into FeatureMerger.   Thanks for the pointer it helpped!   Regards,   Kevin

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 26, 2013
U can also create a list with listbuilder on Roads_FC,RoadType, listconcatenate on RoadType and then use a tester to do

 

@Value(ID.RoadName.[RoadType]) in @Value(Concatenated)

 

 

My coleague usualy does a lookup trough a joiner transformer b.t.w., wich is also a way to do it. This is primarily handy if u have external lookup-tables.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings