Skip to main content
Question

Validation of number of features before overwriting destination tables

  • March 3, 2016
  • 3 replies
  • 14 views

daniel_l
Forum|alt.badge.img

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?

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.

3 replies

takashi
Celebrity
  • March 3, 2016

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.


Forum|alt.badge.img+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


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • March 3, 2016

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.