Package io.debezium.connector.postgresql
Class PostgisGeometry
- java.lang.Object
-
- io.debezium.connector.postgresql.PostgisGeometry
-
public class PostgisGeometry extends Object
A parser API for Postgres Geometry types- Author:
- Robert Coup
-
-
Field Summary
Fields Modifier and Type Field Description private static StringHEXEWKB_EMPTY_GEOMETRYCOLLECTIONStatic Hex EKWB for a GEOMETRYCOLLECTION EMPTY.private IntegersridCoordinate reference system identifier.private byte[]wkbPostGIS Extended-Well-Known-Binary (EWKB) geometry representation.
-
Constructor Summary
Constructors Modifier Constructor Description privatePostgisGeometry(byte[] ewkb, Integer srid)Create a PostgisGeometry using the supplied EWKB and SRID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PostgisGeometrycreateEmpty()Create a GEOMETRYCOLLECTION EMPTY PostgisGeometrystatic PostgisGeometryfromEwkb(byte[] ewkb)Create a PostgisGeometry using the supplied PostGIS EWKB.static PostgisGeometryfromHexEwkb(String hexEwkb)Create a PostgisGeometry using the supplied PostGIS Hex EWKB string.IntegergetSrid()Returns the coordinate reference system identifier (SRID)byte[]getWkb()Returns the standard well-known binary representationprivate static IntegerparseSrid(byte[] ewkb)Parses an EWKB Geometry and extracts the SRID (if any) https://trac.osgeo.org/postgis/browser/trunk/doc/ZMSgeoms.txt
-
-
-
Field Detail
-
HEXEWKB_EMPTY_GEOMETRYCOLLECTION
private static final String HEXEWKB_EMPTY_GEOMETRYCOLLECTION
Static Hex EKWB for a GEOMETRYCOLLECTION EMPTY.- See Also:
- Constant Field Values
-
wkb
private final byte[] wkb
PostGIS Extended-Well-Known-Binary (EWKB) geometry representation. An extension of the Open Geospatial Consortium Well-Known-Binary format. Since EWKB is a superset of WKB, we use EWKB here. https://postgis.net/docs/using_postgis_dbmanagement.html#EWKB_EWKT http://www.opengeospatial.org/standards/sfa
-
srid
private final Integer srid
Coordinate reference system identifier. While it's technically user-defined, the standard/common values in use are the EPSG code list http://www.epsg.org/ null if unset/unspecified
-
-
Constructor Detail
-
PostgisGeometry
private PostgisGeometry(byte[] ewkb, Integer srid)Create a PostgisGeometry using the supplied EWKB and SRID.- Parameters:
ewkb- the Extended Well-Known binary representation of the coordinate in the standard formatsrid- the coordinate system identifier (SRID); null if unset/unknown
-
-
Method Detail
-
fromHexEwkb
public static PostgisGeometry fromHexEwkb(String hexEwkb)
Create a PostgisGeometry using the supplied PostGIS Hex EWKB string. SRID is extracted from the EWKB
-
fromEwkb
public static PostgisGeometry fromEwkb(byte[] ewkb)
Create a PostgisGeometry using the supplied PostGIS EWKB. SRID is extracted from the EWKB
-
createEmpty
public static PostgisGeometry createEmpty()
Create a GEOMETRYCOLLECTION EMPTY PostgisGeometry- Returns:
- a
PostgisGeometrywhich represents a PostgisGeometry API
-
getWkb
public byte[] getWkb()
Returns the standard well-known binary representation- Returns:
bytewhich represents the standard well-known binary
-
getSrid
public Integer getSrid()
Returns the coordinate reference system identifier (SRID)- Returns:
- srid
-
parseSrid
private static Integer parseSrid(byte[] ewkb)
Parses an EWKB Geometry and extracts the SRID (if any) https://trac.osgeo.org/postgis/browser/trunk/doc/ZMSgeoms.txt- Parameters:
ewkb- PostGIS EWKB geometry- Returns:
- Geometry SRID or null if there is no SRID.
-
-