java.lang.Object
org.elasticsearch.geometry.utils.CartesianValidator
- All Implemented Interfaces:
GeometryValidator
Validator for cartesian (non-geographic) coordinates. Its one job today is
validateBBox(double, double, double, double): unlike geographic coordinates, cartesian coordinates
have no antimeridian-crossing concept, so a rectangle's x-ordinates must be consistent (maxX cannot be less
than minX), in addition to the same y-ordinate check (GeographyValidator also applies to geographic
coordinates. This is deliberately a separate class from StandardValidator, even though the two
currently look similar in scope: StandardValidator is CRS-agnostic and is relied on by real
geographic production code paths (e.g. GeometryParser) that must tolerate antimeridian-crossing
envelopes, so it cannot safely gain this check.-
Field Summary
FieldsFields inherited from interface org.elasticsearch.geometry.utils.GeometryValidator
NOOP -
Method Summary
Modifier and TypeMethodDescriptionvoidValidates the geometry and throws IllegalArgumentException if the geometry is not validvoidvalidateBBox(double minX, double maxX, double maxY, double minY) Validates the ordinate ordering of a rectangle/envelope, throwing IllegalArgumentException if the envelope is invalid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.geometry.utils.GeometryValidator
validateCoordinate
-
Field Details
-
INSTANCE
-
-
Method Details
-
validateBBox
public void validateBBox(double minX, double maxX, double maxY, double minY) Description copied from interface:GeometryValidatorValidates the ordinate ordering of a rectangle/envelope, throwing IllegalArgumentException if the envelope is invalid. The default implementation only checks that maxY is not less than minY, since that is always invalid, regardless of CRS. It deliberately does not check x-ordinate ordering: geographic coordinates allow minX to legitimately exceed maxX, to represent an envelope that crosses the antimeridian, so only implementations for CRSes without that concept (e.g.CartesianValidator) need to additionally check that maxX is not less than minX.- Specified by:
validateBBoxin interfaceGeometryValidator
-
validate
Description copied from interface:GeometryValidatorValidates the geometry and throws IllegalArgumentException if the geometry is not valid- Specified by:
validatein interfaceGeometryValidator
-