Understand S2 Geometry Validation Semantic Models
masterS2 Geometry uses different semantic models to define what constitutes 'valid' geometry. Depending on your use case, you may need to validate against one of the following levels of strictness:
S2Valid: The most lax model. It performs basic checks (e.g., proper interior orientation, no overlaps) and explicitly supports degeneracies. This is the minimum requirement for usingS2BooleanOperation.S2LegacyValid: Designed to supportS2Polygonvalidation semantics. It combinesS2ValidwithSingle2DShapeand other specific predicates.OGCValid: Validates geometry according to the Open Geospatial Consortium (OGC) specification.STLibValid: Adds additional constraints toOGCValidto ensure geometry is 'dissolved' (no overlapping/touching components that should be one).OGCSimple: A strict OGC model that also checks for polyline self-intersection.