07-23-2016 01:47 PM
The MeasurePolygon example in the documentation is simple enough, but I get a couple errors:
23/07/16 12:46:18 SessionMgr(2376): Unspecified function failed 23/07/16 12:46:18 Unsupported field type 23/07/16 12:46:18 SessionMgr(2376): Spatial model execution failed.
My suspicion was that the centroid computation failed due to some sort of invalid geometry. Most of the features in my layer are simple polygons, but I found at least one with a hole and don't think I have multi-polygons (all of which are supoprted geometry types though). I ran the same recipe on a point layer but IMAGINE kept crashing. My shapefile had a custom projection (though that shouldn't matter), so I changed the projection definition and the recipe worked on points, which points a finger back at my polygons. QGIS' validation, however, reported no geometry errors and although each system has its own threshold for what's considered an error, I'm confident I don't have eggregious errors.
 Is there a FeatureValidation operator that could prevent recipes from being derailed by bad input?
 Anyone have experience with MeasurePolygon that could offer suggestions?
Solved! Go to Solution.
08-06-2016 02:07 PM - edited 08-06-2016 02:09 PM
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.