Question

Validation of number of features before overwriting destination tables


Badge

Hello,

I'm creating a workspace where I'm fetching zipped shapefiles from an external http resource. My goal is to run this workspace automatically on a daily basis and I'm looking for a robust solution.

I know that the source is auto generated and normally contains approximately 3.000 features, but if it for some reason out of my control only contains 500 features during processing (which indicates malfunction at the creation of my source) I don't want to overwrite the existing destination shape file.

So, how can I halt a translation if the number of features is below threshold X?


3 replies

Userlevel 2
Badge +17

Hi @daniel_l, an easy way is to count the number of features with the StatisticsCalculator and discard the features if the number of them is less than 500.

Badge +1

Hi,

you could use a StatisticsCalculator in your process. From the Complete port you get the attribute '_total' on every fature indicating the amount of features read. Then use a Tester so that all features fail _total is below X.

Cheers,

Heinz

Userlevel 2
Badge +16

And as an addition to the remarks above, you can stop the process if the number is not the required number by using the Terminator transformer.

Reply