Class StandardValidator

java.lang.Object
org.elasticsearch.geometry.utils.StandardValidator
All Implemented Interfaces:
GeometryValidator

public class StandardValidator extends Object implements GeometryValidator
Validator that only checks that altitude only shows up if ignoreZValue is set to true. Despite the name, this is not a generic "default" validator: it is CRS-agnostic, and used to parse both geographic and cartesian WKT/GeoJSON (see e.g. server's GeometryParser, used by both geo_shape and shape field mapping/queries). Because of that, it must not gain any check that differs between CRSes -- e.g. rectangle/envelope ordinate ordering, which GeographyValidator and CartesianValidator each enforce differently. Add such checks to those classes instead.
  • Method Details

    • instance

      public static GeometryValidator instance(boolean ignoreZValue)
    • checkZ

      protected void checkZ(double zValue)
    • validateCoordinate

      public void validateCoordinate(double x, double y, double z)
      Description copied from interface: GeometryValidator
      Validates a single coordinate and throws IllegalArgumentException if it is not valid. Default implementation is a no-op.
      Specified by:
      validateCoordinate in interface GeometryValidator
    • validate

      public void validate(Geometry geometry)
      Description copied from interface: GeometryValidator
      Validates the geometry and throws IllegalArgumentException if the geometry is not valid
      Specified by:
      validate in interface GeometryValidator