Interface GeometryVisitor

All Known Implementing Classes:
GeometryBytes.EmptyGeometryCollectionVisitor, GeometryCoordinateSwapper.SwapVisitor, GeometryEndiannessConverter.EndianConverterVisitor

interface GeometryVisitor
A visitor that is used by the GeometryTraverser to traverse a WKB/EKB byte buffer.
Author:
Chris Cranford
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called before leaving a GEOMETRYCOLLECTION geometry type.
    default void
    Called before leaving a LINESTRING geometry type.
    default void
    Called before leaving a MULTILINESTRING geometry type.
    default void
    Called before leaving a MULTIPOINT geometry type.
    default void
    Called before leaving a MULTIPOLYGON geometry type.
    default void
    Called before leaving a POLYGON geometry type.
    default void
    Called before leaving a ring within a polygon.
    default boolean
    enterCollectionGeometry(byte byteOrder)
    Called when a GEOMETRYCOLLECTION geometry type is observed.
    default boolean
    enterGeometry(int wkbType, boolean hasZ, boolean hasM, int stride)
    Called when a geometry sequence has started.
    default boolean
    enterSubGeometry(byte byteOrder, int wkbType)
    Called just before visiting sub-geometry types inside a MULTIPOINT, MULTILINESTRING, or a MULTIPOLYGON geometry type.
    default void
    Called when leaving a GEOMETRYCOLLECTION geometry type.
    default void
    Called when a a geometry sequence ends.
    default void
    Called after leaving a sub-geometry type inside a MULTIPOINT, MULTILINESTRING, or a MULTIPOLYGON geometry type.
    default void
    startGeometryCollection(int geometryCount)
    Called after reading the number of geometries present in a GEOMETRYCOLLECTION geometry type.
    default void
    startLineString(int pointCount)
    Called after reading the number of points inside a LINESTRING geometry type.
    default void
    startMultiLineString(int lineStringCount)
    Called after reading the number of line strings present in a MULTILINESTRING geometry type.
    default void
    startMultiPoint(int pointCount)
    Called after reading the number of points present in a MULTIPOINT geometry type.
    default void
    startMultiPolygon(int polygonCount)
    Called after reading the number of polygons present in a MULTIPOYLGON geometry type.
    default void
    startPolygon(int ringCount)
    Called after reading the number of rings inside a POLYGON geometry type.
    default void
    startRing(int ringIndex, int pointCount)
    Called after reading the number of points present in a ring within a polygon.
    default void
    visitCoordinate(double[] ordinates)
    Called after reading the coordinates of a point.
    default void
    visitSrid(int srid)
    Called after the geometry spatial reference identifier was read.
  • Method Details

    • enterGeometry

      default boolean enterGeometry(int wkbType, boolean hasZ, boolean hasM, int stride)
      Called when a geometry sequence has started.
      Parameters:
      wkbType - the WKB geometry type
      hasZ - whether the geometry has a Z-axis
      hasM - whether the geometry has an M-axis
      stride - the stride for given coordinates, 2D vs 3D
      Returns:
      true if the visitor should continue visiting, false otherwise
    • exitGeometry

      default void exitGeometry()
      Called when a a geometry sequence ends.
    • enterCollectionGeometry

      default boolean enterCollectionGeometry(byte byteOrder)
      Called when a GEOMETRYCOLLECTION geometry type is observed.
      Parameters:
      byteOrder - the byte order
      Returns:
      true if the visitor should continue visiting, false otherwise
    • exitCollectionGeometry

      default void exitCollectionGeometry()
      Called when leaving a GEOMETRYCOLLECTION geometry type.
    • enterSubGeometry

      default boolean enterSubGeometry(byte byteOrder, int wkbType)
      Called just before visiting sub-geometry types inside a MULTIPOINT, MULTILINESTRING, or a MULTIPOLYGON geometry type.
      Parameters:
      byteOrder - the byte order
      wkbType - the sub geometry type
      Returns:
      true if the visitor should continue visiting, false otherwise
    • exitSubGeometry

      default void exitSubGeometry()
      Called after leaving a sub-geometry type inside a MULTIPOINT, MULTILINESTRING, or a MULTIPOLYGON geometry type.
    • visitSrid

      default void visitSrid(int srid)
      Called after the geometry spatial reference identifier was read. If the Geometry is not an Extended Well-Known Binary (EWKB) type that has the spatial reference identifier, this won't be called.
      Parameters:
      srid - the spatial reference identifier
    • visitCoordinate

      default void visitCoordinate(double[] ordinates)
      Called after reading the coordinates of a point. The stride of the point can be determined by the number of values in the array.
      Parameters:
      ordinates - the coordinate values
    • startLineString

      default void startLineString(int pointCount)
      Called after reading the number of points inside a LINESTRING geometry type.
      Parameters:
      pointCount - the number of points
    • endLineString

      default void endLineString()
      Called before leaving a LINESTRING geometry type.
    • startPolygon

      default void startPolygon(int ringCount)
      Called after reading the number of rings inside a POLYGON geometry type.
      Parameters:
      ringCount - the number of rings
    • endPolygon

      default void endPolygon()
      Called before leaving a POLYGON geometry type.
    • startRing

      default void startRing(int ringIndex, int pointCount)
      Called after reading the number of points present in a ring within a polygon.
      Parameters:
      ringIndex - the ring index, 0-based.
      pointCount - the number of points present within the ring
    • endRing

      default void endRing()
      Called before leaving a ring within a polygon.
    • startMultiPoint

      default void startMultiPoint(int pointCount)
      Called after reading the number of points present in a MULTIPOINT geometry type.
      Parameters:
      pointCount - the number of points
    • endMultiPoint

      default void endMultiPoint()
      Called before leaving a MULTIPOINT geometry type.
    • startMultiLineString

      default void startMultiLineString(int lineStringCount)
      Called after reading the number of line strings present in a MULTILINESTRING geometry type.
      Parameters:
      lineStringCount - the number of line strings
    • endMultiLineString

      default void endMultiLineString()
      Called before leaving a MULTILINESTRING geometry type.
    • startMultiPolygon

      default void startMultiPolygon(int polygonCount)
      Called after reading the number of polygons present in a MULTIPOYLGON geometry type.
      Parameters:
      polygonCount - the number of polygons
    • endMultiPolygon

      default void endMultiPolygon()
      Called before leaving a MULTIPOLYGON geometry type.
    • startGeometryCollection

      default void startGeometryCollection(int geometryCount)
      Called after reading the number of geometries present in a GEOMETRYCOLLECTION geometry type.
      Parameters:
      geometryCount - the number of geometries
    • endGeometryCollection

      default void endGeometryCollection()
      Called before leaving a GEOMETRYCOLLECTION geometry type.