Package io.debezium.spatial
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 TypeMethodDescriptiondefault voidCalled before leaving aGEOMETRYCOLLECTIONgeometry type.default voidCalled before leaving aLINESTRINGgeometry type.default voidCalled before leaving aMULTILINESTRINGgeometry type.default voidCalled before leaving aMULTIPOINTgeometry type.default voidCalled before leaving aMULTIPOLYGONgeometry type.default voidCalled before leaving aPOLYGONgeometry type.default voidendRing()Called before leaving a ring within a polygon.default booleanenterCollectionGeometry(byte byteOrder) Called when aGEOMETRYCOLLECTIONgeometry type is observed.default booleanenterGeometry(int wkbType, boolean hasZ, boolean hasM, int stride) Called when a geometry sequence has started.default booleanenterSubGeometry(byte byteOrder, int wkbType) Called just before visiting sub-geometry types inside aMULTIPOINT,MULTILINESTRING, or aMULTIPOLYGONgeometry type.default voidCalled when leaving aGEOMETRYCOLLECTIONgeometry type.default voidCalled when a a geometry sequence ends.default voidCalled after leaving a sub-geometry type inside aMULTIPOINT,MULTILINESTRING, or aMULTIPOLYGONgeometry type.default voidstartGeometryCollection(int geometryCount) Called after reading the number of geometries present in aGEOMETRYCOLLECTIONgeometry type.default voidstartLineString(int pointCount) Called after reading the number of points inside aLINESTRINGgeometry type.default voidstartMultiLineString(int lineStringCount) Called after reading the number of line strings present in aMULTILINESTRINGgeometry type.default voidstartMultiPoint(int pointCount) Called after reading the number of points present in aMULTIPOINTgeometry type.default voidstartMultiPolygon(int polygonCount) Called after reading the number of polygons present in aMULTIPOYLGONgeometry type.default voidstartPolygon(int ringCount) Called after reading the number of rings inside aPOLYGONgeometry type.default voidstartRing(int ringIndex, int pointCount) Called after reading the number of points present in a ring within a polygon.default voidvisitCoordinate(double[] ordinates) Called after reading the coordinates of a point.default voidvisitSrid(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 typehasZ- whether the geometry has a Z-axishasM- whether the geometry has an M-axisstride- the stride for given coordinates, 2D vs 3D- Returns:
trueif the visitor should continue visiting,falseotherwise
-
exitGeometry
default void exitGeometry()Called when a a geometry sequence ends. -
enterCollectionGeometry
default boolean enterCollectionGeometry(byte byteOrder) Called when aGEOMETRYCOLLECTIONgeometry type is observed.- Parameters:
byteOrder- the byte order- Returns:
trueif the visitor should continue visiting,falseotherwise
-
exitCollectionGeometry
default void exitCollectionGeometry()Called when leaving aGEOMETRYCOLLECTIONgeometry type. -
enterSubGeometry
default boolean enterSubGeometry(byte byteOrder, int wkbType) Called just before visiting sub-geometry types inside aMULTIPOINT,MULTILINESTRING, or aMULTIPOLYGONgeometry type.- Parameters:
byteOrder- the byte orderwkbType- the sub geometry type- Returns:
trueif the visitor should continue visiting,falseotherwise
-
exitSubGeometry
default void exitSubGeometry()Called after leaving a sub-geometry type inside aMULTIPOINT,MULTILINESTRING, or aMULTIPOLYGONgeometry 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 aLINESTRINGgeometry type.- Parameters:
pointCount- the number of points
-
endLineString
default void endLineString()Called before leaving aLINESTRINGgeometry type. -
startPolygon
default void startPolygon(int ringCount) Called after reading the number of rings inside aPOLYGONgeometry type.- Parameters:
ringCount- the number of rings
-
endPolygon
default void endPolygon()Called before leaving aPOLYGONgeometry 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 aMULTIPOINTgeometry type.- Parameters:
pointCount- the number of points
-
endMultiPoint
default void endMultiPoint()Called before leaving aMULTIPOINTgeometry type. -
startMultiLineString
default void startMultiLineString(int lineStringCount) Called after reading the number of line strings present in aMULTILINESTRINGgeometry type.- Parameters:
lineStringCount- the number of line strings
-
endMultiLineString
default void endMultiLineString()Called before leaving aMULTILINESTRINGgeometry type. -
startMultiPolygon
default void startMultiPolygon(int polygonCount) Called after reading the number of polygons present in aMULTIPOYLGONgeometry type.- Parameters:
polygonCount- the number of polygons
-
endMultiPolygon
default void endMultiPolygon()Called before leaving aMULTIPOLYGONgeometry type. -
startGeometryCollection
default void startGeometryCollection(int geometryCount) Called after reading the number of geometries present in aGEOMETRYCOLLECTIONgeometry type.- Parameters:
geometryCount- the number of geometries
-
endGeometryCollection
default void endGeometryCollection()Called before leaving aGEOMETRYCOLLECTIONgeometry type.
-