public static int geometryTypeFromConstraint ( String constraint , int numericPrecision ) { if ( constraint . isEmpty ( ) && numericPrecision > GeometryTypeCodes . GEOMETRYZM ) { return GeometryTypeCodes . GEOMETRY ; } // Use Domain given parameters if ( numericPrecision <= GeometryTypeCodes . GEOMETRYZM ) { return numericPrecision ; } // Use user defined constraint. Does not work with VIEW TABLE Matcher matcher = TYPE_CODE_PATTERN . matcher ( constraint ) ; if ( matcher . find ( ) ) { return Integer . valueOf ( matcher . group ( CODE_GROUP_ID ) ) ; } else { return GeometryTypeCodes . GEOMETRY ; } }
Convert H2 constraint string into a OGC geometry type index .