Hello people,
Just seeking a better way of detecting overlaps between a number of different datasets by validation rule.
I have a database that contains hundreds of datasets. I have a code for detecting overlaps between different datasets - see below. But in the code, I have to create "Intersects" function for each pair of datasets to detect overlaps. As there are heaps of datasets in the database, I would like to avoid creating heaps of lines for the geometry function. Is there any more sophisticated way of coding to detect overlaps between hundreds of different datasets?
Thanks in advance for your ideas!
// Validation - overlaps
var poly_b = FeatureSetByName($datastore, "polygon_b", ["*"], false)
var poly_b_intersect = Intersects(poly_b, Geometry($feature))
var line_a = FeatureSetByName($datastore, "line_a", ["*"], false)
var line_a_intersect = Intersects(line_a, Geometry($feature))
var polygon_c = FeatureSetByName($datastore, "polygon_c", ["*"], false)
var polygon_c_intersect = Intersects(polygon_c, Geometry($feature))
// return error if $feature intersect any polygon A
if (Count(poly_b_intersect) > 0 || Count(line_a_intersect) > 0 || Count(polygon_c_intersect) > 0)
return {"errorMessage": "polygon A features must not be intersected with others."}
else
return true