07-23-2016 01:47 PM - last edited on 10-27-2020 03:04 AM by gspbsoperations
How do I count the number of features identified by a Filter By Attributes (FbA) operation?
I piped the results of FbA to the MeasurePolygon (MP) operator and it errored out saying there were no features, but when attached a NumCount operator to FbA I get 1, which contradicts the MP op.
Advice would be appreciated.
Solved! Go to Solution.
08-06-2016 02:07 PM - last edited Monday by fcaelen
This is a workaround (likely not the best) for avoiding the "Unsupported field type" error when using the MeasurePolygon operator.
Poor man's polygon cleaner  Convert your features to raster then  back to features.
Theorectically I suppose this would address occluded and/or slivers, but I'm pretty confident my data's good.
Anyhow, the image below shows an error is MeasurePolygon is used straightaway and the lower path shows that operaor succeed with the roundabout cleaner.
08-06-2016 04:23 PM
It appears the problem lies not with my geometries, but some of my attribute columns in my feature layer. I haven't yet investigated which ones, but my columns were all text types up to 80 chars in length. A few column names were prefixed with underscores and some columns stored hyperlinks. Again, not sure which was the offender, but in hindsight the error message was spot on...
I used QGIS to remove all but 2 text columns and the recipe skated right on through MeasurePolygon.
08-07-2016 08:42 AM
It looks like you found a work around and a resolution.
There is no validate geometry operator partly because it was not intention of the spatial modeler to reject any specfic geomtery for all operators but it is the responsibilty of the operator to process it appropriately and report if it cannot handle a certain type.
It seems like measure polygon is handling it properly. If some operator does not then that will be a defect and it needs to be fixed. Please do report it in case you find one.
08-07-2016 10:16 AM
Thank you, Kumar.
I see. So operators only have "type" validation? Is there any plan to add "content" (e.g., feature) validation to help relax the modeler's all-or-nothing execution policy? Theorectically, my model can tolerate some loss in data, but the gap is in lowering the threshold from the 100% clean assumption.
From UX and dev perspectives, identifying and filtering invalid geometries, for example, would allow the model to continue or have a controlled exit rather than error out with a message that users (and often developers) won't understand. Be nice to have.
Thanks again for chiming in!
08-09-2016 10:37 AM - edited 08-09-2016 10:46 AM
Each operator should have that test and should deal with them. And some cases it seems to error out which may be desirable.
It will be interesting to identify those use cases. Coming up with requirement for a generic operator is complicated as the definition of invalid feature/geometry is subjective to the operator that is operating on it.
Anyways, I will bring it up with the teams for future development. Thanks for the feedback.