Question

File gdb reader in dynamic workspace - merge filter/regex to exclude certain feature types

  • 8 February 2022
  • 3 replies
  • 0 views

Badge +11

I have a dynamic replication workspace which reads the contents of one file gdb and uses its schema to truncate/overwrite another. I've added some contour datasets to both gdbs that are static, and don't want them being included in the replication because of the time overhead they add in reading and writing. Mid-workspace workaround is the humble Tester, but not reading at all would be better. I've had a google of regular expressions to use for this, rubular rejected the solutions here ( https://stackoverflow.com/questions/2078915/a-regular-expression-to-exclude-a-word-string ), and couldn't think of how the merge filter would be used for it.

 

I need to exclude feature classes like '%Contour%' and also those like '%0_5m' - in the latter case it can be an 'ends with' scenario as it is always at the end of the feature class name.


3 replies

Userlevel 5
Badge +29

An approach to consider would be using two featurereaders. One reads in just the schema from all datasets. Then use the tester to filter out the relevant featuretypes. Then pass the resulting features to a second featurereader and use the feautre_type_name to specify which feature type to read in

Badge +15

Hi @chriswilson​ ,

I did a couple of tests and had some success with this syntax filtering out Parks and FoodVendors from the CommunityMap gdb available in the FMEData.zip folder:

^(?!Parks|Food.*)([a-zA-Z0-9]+)$

I understand you could try something like this for your use case:

^(?!.*Contour.*|.*0-5m)([a-zA-Z0-9]+)$

The first () block includes the ?! syntax meaning it excludes the following matches, and the second () block matches whatever is left

imaxe

Badge +11

Thanks guys, I'll take a look at those. The in-workspace tester has already taken a huge amount off the runtime due to not writing the features which is great, but I'll see how these two solutions go. I tend to be a mostly basic user of regex!

Reply