Interface GeometryValidator

All Known Implementing Classes:
CartesianValidator, GeographyValidator, StandardValidator

public interface GeometryValidator
Generic geometry validator that can be used by the parser to verify the validity of the parsed geometry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final GeometryValidator
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    validate(Geometry geometry)
    Validates the geometry and throws IllegalArgumentException if the geometry is not valid
    default void
    validateBBox(double minX, double maxX, double maxY, double minY)
    Validates the ordinate ordering of a rectangle/envelope, throwing IllegalArgumentException if the envelope is invalid.
    default void
    validateCoordinate(double x, double y, double z)
    Validates a single coordinate and throws IllegalArgumentException if it is not valid.
  • Field Details

  • Method Details

    • validate

      void validate(Geometry geometry)
      Validates the geometry and throws IllegalArgumentException if the geometry is not valid
    • validateCoordinate

      default void validateCoordinate(double x, double y, double z)
      Validates a single coordinate and throws IllegalArgumentException if it is not valid. Default implementation is a no-op.
    • validateBBox

      default void validateBBox(double minX, double maxX, double maxY, double minY)
      Validates 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.