public static GeometryValidationState validate ( Geometry geometry ) { validationContext . clear ( ) ; if ( Geometry . LINE_STRING . equals ( geometry . getGeometryType ( ) ) ) { IndexedLineString lineString = helper . createLineString ( geometry ) ; validateLineString ( lineString ) ; } else if ( Geometry . LINEAR_RING . equals ( geometry . getGeometryType ( ) ) ) { IndexedLinearRing ring = helper . createLinearRing ( geometry ) ; validateLinearRing ( ring ) ; } else if ( Geometry . POLYGON . equals ( geometry . getGeometryType ( ) ) ) { IndexedPolygon polygon = helper . createPolygon ( geometry ) ; validatePolygon ( polygon ) ; } else if ( Geometry . MULTI_LINE_STRING . equals ( geometry . getGeometryType ( ) ) ) { IndexedMultiLineString multiLineString = helper . createMultiLineString ( geometry ) ; validateMultiLineString ( multiLineString ) ; } else if ( Geometry . MULTI_POLYGON . equals ( geometry . getGeometryType ( ) ) ) { IndexedMultiPolygon multiPolygon = helper . createMultiPolygon ( geometry ) ; validateMultiPolygon ( multiPolygon ) ; } return validationContext . getState ( ) ; }
Validate this geometry .