2

I want to use regex to simply distinquish between POLYGON and MULTIPOLYGON using the regex term "\bPOLYGON"

Apparently I can use the Advanced Editor and use

@FindRegEx(<STRING>,<STRING>)POLYGON

But what do I enter here for STRING? In the documenation it states

FindRegEx(string str, string regExp, [int startIdx], [bool caseSensitive], [-1])

So I guess "string regExp" is the expression "\bPOLYGON", and I would guess "string str" means the source text....but this is already defined as the "left Value".

Can anyone give me an example of how to use this?

1 Answer 1

2

"string str" just means the text you want to test. Which is the attribute you're testing. The second string is your regex pattern.

What attribute are you actually testing? Is it an FME attribute or one from your source data?

If you want to check the actual geometry for multipolygons you can use a TestFilter or a Tester transformer to test the fme_type and fme_geometry attributes. You may need to expose these attributes first. Set the Pass Criteria to "AND".

enter image description here

See here for more information about fme types.

But perhaps an even simpler way to do this is to just use the MultipleGeometryFilter. The output ports will sort your data whether they are single or multi-part geometries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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