You are here: Resources > Worked Examples > Example: Building Containment Rule

Example: Building Containment Rule

This example rule validates that the area of a farm house is completely contained by the combined area of all the fields that partly overlap. 

This illustrates the use of an aggregate value to calculate the combined geometry of these fields.

A rule to check a farm house is contained within some fields

  1. Set a Class of FARM HOUSE on the root node.
  2. Click and select Condition then Comparison.
  3. Select the first <<value>> element. From the Type list, select Dynamic Value. From the Class list select FARM HOUSE, and in the Attribute field type geometry.
  4. Select the <<relationship>> element. From the Type list select Spatial Relationship. When the second Type list appears, select Within.
  5. Select the other <<value>> element. From the Type list select Aggregate Value. Set the Function to union and in the Class field enter FIELD.
  6. Select the next <<value>> element. From the Type list, select Dynamic Value. From the Class list select FIELD, and in the Attribute field type geometry.
  7. Set the <<condition>> to Comparison. This inserts two more values and a relationship.
  8. Select the <<value>> element. From the Type list, select Dynamic Value. From the Class list select FARM HOUSE, and in the Attribute field type geometry.
  9. Set the <<relationship>> element. From the Type list select Spatial Relationship. When the second Type list appears, select Intersect.
  10. Select the other <<value>> element. From the Type list, select Dynamic Value. From the Class list select FIELD, and in the Attribute field type geometry.
  11. Click Save to store the completed rule in the repository.