Package mil.nga.geopackage.geom
Class GeoPackageGeometryData
- java.lang.Object
-
- mil.nga.geopackage.geom.GeoPackageGeometryData
-
public class GeoPackageGeometryData extends Object
GeoPackage Geometry Data- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description GeoPackageGeometryData()
Default Constructor, default SRS Id ofgetDefaultSrsId()
GeoPackageGeometryData(byte[] bytes)
ConstructorGeoPackageGeometryData(long srsId)
ConstructorGeoPackageGeometryData(long srsId, Geometry geometry)
ConstructorGeoPackageGeometryData(long srsId, Geometry geometry, boolean buildEnvelope)
ConstructorGeoPackageGeometryData(long srsId, Geometry geometry, GeometryEnvelope envelope)
ConstructorGeoPackageGeometryData(GeoPackageGeometryData geometryData)
Copy ConstructorGeoPackageGeometryData(Geometry geometry)
Constructor, default SRS Id ofgetDefaultSrsId()
GeoPackageGeometryData(Geometry geometry, boolean buildEnvelope)
ConstructorGeoPackageGeometryData(Geometry geometry, GeometryEnvelope envelope)
Constructor, default SRS Id ofgetDefaultSrsId()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometryEnvelope
buildEnvelope()
Build, set, and retrieve the envelope from the geometrystatic byte[]
bytes(long srsId, Geometry geometry)
GeoPackage geometry bytes from the geometrystatic byte[]
bytes(Geometry geometry)
GeoPackage geometry bytes from the geometry, default SRS Id ofgetDefaultSrsId()
static byte[]
bytesAndBuildEnvelope(long srsId, Geometry geometry)
GeoPackage geometry bytes from the geometry with built envelopestatic byte[]
bytesAndBuildEnvelope(Geometry geometry)
GeoPackage geometry bytes from the geometry with built envelope, default SRS Id ofgetDefaultSrsId()
static byte[]
bytesFromWkb(byte[] bytes)
GeoPackage geometry bytes from Well-Known bytes, default SRS Id ofgetDefaultSrsId()
static byte[]
bytesFromWkb(long srsId, byte[] bytes)
GeoPackage geometry bytes from Well-Known bytesstatic byte[]
bytesFromWkbAndBuildEnvelope(byte[] bytes)
GeoPackage geometry bytes from Well-Known bytes with built envelope, default SRS Id ofgetDefaultSrsId()
static byte[]
bytesFromWkbAndBuildEnvelope(long srsId, byte[] bytes)
GeoPackage geometry bytes from Well-Known bytes with built envelopestatic byte[]
bytesFromWkt(long srsId, String text)
GeoPackage geometry bytes from Well-Known textstatic byte[]
bytesFromWkt(String text)
GeoPackage geometry bytes from Well-Known text, default SRS Id ofgetDefaultSrsId()
static byte[]
bytesFromWktAndBuildEnvelope(long srsId, String text)
GeoPackage geometry bytes from Well-Known text with built envelopestatic byte[]
bytesFromWktAndBuildEnvelope(String text)
GeoPackage geometry bytes from Well-Known text with built envelope, default SRS Id ofgetDefaultSrsId()
void
clearBytes()
Clear the bytesvoid
clearGeometryBytes()
Clear the geometry bytes and overall bytesvoid
clearHeaderBytes()
Clear the header bytes and overall bytesstatic GeoPackageGeometryData
create()
Create geometry data, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
create(byte[] bytes)
Create the geometry data from GeoPackage geometry bytesstatic GeoPackageGeometryData
create(long srsId)
Create geometry datastatic GeoPackageGeometryData
create(long srsId, Geometry geometry)
Create geometry datastatic GeoPackageGeometryData
create(long srsId, Geometry geometry, GeometryEnvelope envelope)
Create the geometry datastatic GeoPackageGeometryData
create(GeoPackageGeometryData geometryData)
Copy the geometry data and createstatic GeoPackageGeometryData
create(Geometry geometry)
Create geometry data, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
create(Geometry geometry, GeometryEnvelope envelope)
Create the geometry data, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createAndBuildEnvelope(long srsId, Geometry geometry)
Create geometry data and build the envelopestatic GeoPackageGeometryData
createAndBuildEnvelope(Geometry geometry)
Create geometry data and build the envelope, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createAndWrite(long srsId, Geometry geometry)
Create geometry data and write the GeoPackage geometry bytesstatic GeoPackageGeometryData
createAndWrite(Geometry geometry)
Create geometry data and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createBuildEnvelopeAndWrite(long srsId, Geometry geometry)
Create geometry data, build the envelope, and write the GeoPackage geometry bytesstatic GeoPackageGeometryData
createBuildEnvelopeAndWrite(Geometry geometry)
Create geometry data, build the envelope, and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWkb(byte[] bytes)
Create the geometry data from Well-Known Bytes, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWkb(long srsId, byte[] bytes)
Create the geometry data from Well-Known Bytesstatic GeoPackageGeometryData
createFromWkbAndBuildEnvelope(byte[] bytes)
Create the geometry data from Well-Known Bytes and build the envelope, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWkbAndBuildEnvelope(long srsId, byte[] bytes)
Create the geometry data from Well-Known Bytes and build the envelopestatic GeoPackageGeometryData
createFromWkbAndWrite(byte[] bytes)
Create the geometry data from Well-Known Bytes and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWkbAndWrite(long srsId, byte[] bytes)
Create the geometry data from Well-Known Bytes and write the GeoPackage geometry bytesstatic GeoPackageGeometryData
createFromWkbBuildEnvelopeAndWrite(byte[] bytes)
Create the geometry data from Well-Known Bytes, build the envelope, and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWkbBuildEnvelopeAndWrite(long srsId, byte[] bytes)
Create the geometry data from Well-Known Bytes, build the envelope, and write the GeoPackage geometry bytesstatic GeoPackageGeometryData
createFromWkt(long srsId, String text)
Create the geometry data from Well-Known Textstatic GeoPackageGeometryData
createFromWkt(String text)
Create the geometry data from Well-Known Text, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWktAndBuildEnvelope(long srsId, String text)
Create the geometry data from Well-Known Text and build the envelopestatic GeoPackageGeometryData
createFromWktAndBuildEnvelope(String text)
Create the geometry data from Well-Known Text and build the envelope, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWktAndWrite(long srsId, String text)
Create the geometry data from Well-Known Text and write the GeoPackage geometry bytesstatic GeoPackageGeometryData
createFromWktAndWrite(String text)
Create the geometry data from Well-Known Text and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
static GeoPackageGeometryData
createFromWktBuildEnvelopeAndWrite(long srsId, String text)
Create the geometry data from Well-Known Text, build the envelope, and write the GeoPackage geometry bytesstatic GeoPackageGeometryData
createFromWktBuildEnvelopeAndWrite(String text)
Create the geometry data from Well-Known Text, build the envelope, and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
static Geometry
createGeometryFromWkb(byte[] bytes)
Create a geometry from Well-Known Bytesstatic Geometry
createGeometryFromWkt(String text)
Create a geometry from Well-Known Textvoid
fromBytes(byte[] bytes)
Populate the geometry data from the bytesBoundingBox
getBoundingBox()
Get the bounding box of the geometry envelopeByteBuffer
getByteBuffer()
Get the bytes already ordered in a Byte BufferByteOrder
getByteOrder()
Get the byte orderbyte[]
getBytes()
Get the bytes of the entire GeoPackage geometry including GeoPackage header and WKB bytesstatic ByteOrder
getDefaultByteOrder()
Get the default byte orderstatic int
getDefaultSrsId()
Get the default SRS idGeometryEnvelope
getEnvelope()
Get the geometry envelopeGeometry
getGeometry()
Get the geometrystatic GeometryFilter
getGeometryFilter()
Get geometry filterByteBuffer
getHeaderByteBuffer()
Get the GeoPackage header bytes already ordered in a Byte Bufferbyte[]
getHeaderBytes()
Get the GeoPackage header bytesstatic int
getIndicator(GeometryEnvelope envelope)
Get the envelope flag indicatorBoundingBox
getOrBuildBoundingBox()
Get the bounding box of the geometry envelope if it exists or build, set and retrieve it from the geometryGeometryEnvelope
getOrBuildEnvelope()
Get the envelope if it exists or build, set, and retrieve it from the geometryGeometry
getOrReadGeometry()
Get the geometry or read it from geometry bytesint
getSrsId()
Get the SRS idbyte[]
getWkb()
Get the Well-Known Binary Geometry bytesByteBuffer
getWkbBuffer()
Get the Well-Known Binary Geometry bytes already ordered in a Byte Bufferint
getWkbGeometryIndex()
Return the byte index where the Well-Known Binary bytes startString
getWkt()
Get a Well-Known text string from the geometryboolean
isEmpty()
Is the geometry emptyboolean
isExtended()
Is the geometry extendedvoid
setByteOrder(ByteOrder byteOrder)
Set the byte ordervoid
setBytes(byte[] bytes)
Set the bytesvoid
setBytes(byte[] bytes, int wkbGeometryIndex)
Set the bytesstatic void
setDefaultByteOrder(ByteOrder defaultByteOrder)
Set the default byte orderstatic void
setDefaultSrsId(int defaultSrsId)
Set the default SRS idvoid
setEmpty(boolean empty)
Set the empty flagvoid
setEnvelope(GeometryEnvelope envelope)
Set the geometry envelopevoid
setExtended(boolean extended)
Set the extended flagvoid
setGeometry(Geometry geometry)
Set the geometry.byte[]
setGeometryAndBuildEnvelopeToBytes(Geometry geometry)
Set the geometry, build the envelope, and write to bytesvoid
setGeometryBytes(byte[] bytes)
Set the geometry bytes.static void
setGeometryFilter(GeometryFilter geometryFilter)
Set the geometry filtervoid
setGeometryFromWkb(byte[] bytes)
Set the geometry from Well-Known bytesvoid
setGeometryFromWkt(String text)
Set the geometry from Well-Known textbyte[]
setGeometryToBytes(Geometry geometry)
Set the geometry and write to bytesvoid
setHeaderBytes(byte[] bytes)
Set the geometry header bytesvoid
setSrsId(int srsId)
Set the SRS idbyte[]
toBytes()
Write the geometry to bytesGeoPackageGeometryData
transform(ProjectionTransform transform)
Transform the geometry data using the provided projection transformGeoPackageGeometryData
transform(GeometryTransform transform)
Transform the geometry data using the provided geometry projection transformstatic byte[]
wkb(byte[] bytes)
Well-Known Bytes from GeoPackage geometry bytesstatic byte[]
wkb(GeoPackageGeometryData geometryData)
Well-Known Bytes from the geometry datastatic byte[]
wkb(Geometry geometry)
Well-Known Bytes from the geometrystatic byte[]
wkbFromWkt(String text)
Well-Known Bytes from Well-Known Textstatic String
wkt(byte[] bytes)
Well-Known Text from GeoPackage Geometry Bytesstatic String
wkt(GeoPackageGeometryData geometryData)
Well-Known Text from the geometry datastatic String
wkt(Geometry geometry)
Well-Known Text from the geometrystatic String
wktFromWkb(byte[] bytes)
Well-Known Text from Well-Known Bytes
-
-
-
Constructor Detail
-
GeoPackageGeometryData
public GeoPackageGeometryData()
Default Constructor, default SRS Id ofgetDefaultSrsId()
- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(Geometry geometry)
Constructor, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(Geometry geometry, boolean buildEnvelope)
Constructor- Parameters:
geometry
- geometrybuildEnvelope
- true to build and set the envelope- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(long srsId)
Constructor- Parameters:
srsId
- SRS id
-
GeoPackageGeometryData
public GeoPackageGeometryData(long srsId, Geometry geometry)
Constructor- Parameters:
srsId
- SRS idgeometry
- geometry- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(long srsId, Geometry geometry, boolean buildEnvelope)
Constructor- Parameters:
srsId
- SRS idgeometry
- geometrybuildEnvelope
- true to build and set the envelope- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(Geometry geometry, GeometryEnvelope envelope)
Constructor, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometryenvelope
- geometry envelope- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(long srsId, Geometry geometry, GeometryEnvelope envelope)
Constructor- Parameters:
srsId
- SRS idgeometry
- geometryenvelope
- geometry envelope- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(GeoPackageGeometryData geometryData)
Copy Constructor- Parameters:
geometryData
- geometry data- Since:
- 4.0.0
-
GeoPackageGeometryData
public GeoPackageGeometryData(byte[] bytes)
Constructor- Parameters:
bytes
- geometry bytes
-
-
Method Detail
-
getGeometryFilter
public static GeometryFilter getGeometryFilter()
Get geometry filter- Returns:
- geometry filter
- Since:
- 4.0.0
-
setGeometryFilter
public static void setGeometryFilter(GeometryFilter geometryFilter)
Set the geometry filter- Parameters:
geometryFilter
- geometry filter- Since:
- 4.0.0
-
getDefaultSrsId
public static int getDefaultSrsId()
Get the default SRS id- Returns:
- SRS id
- Since:
- 4.0.0
-
setDefaultSrsId
public static void setDefaultSrsId(int defaultSrsId)
Set the default SRS id- Parameters:
defaultSrsId
- SRS id- Since:
- 4.0.0
-
getDefaultByteOrder
public static ByteOrder getDefaultByteOrder()
Get the default byte order- Returns:
- byte order
- Since:
- 4.0.0
-
setDefaultByteOrder
public static void setDefaultByteOrder(ByteOrder defaultByteOrder)
Set the default byte order- Parameters:
defaultByteOrder
- byte order- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create()
Create geometry data, default SRS Id ofgetDefaultSrsId()
- Returns:
- geometry data
- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(Geometry geometry)
Create geometry data, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Returns:
- geometry data
- Since:
- 4.0.0
-
createAndBuildEnvelope
public static GeoPackageGeometryData createAndBuildEnvelope(Geometry geometry)
Create geometry data and build the envelope, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Returns:
- geometry data
- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(long srsId)
Create geometry data- Parameters:
srsId
- SRS id- Returns:
- geometry data
- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(long srsId, Geometry geometry)
Create geometry data- Parameters:
srsId
- SRS idgeometry
- geometry- Returns:
- geometry data
- Since:
- 4.0.0
-
createAndBuildEnvelope
public static GeoPackageGeometryData createAndBuildEnvelope(long srsId, Geometry geometry)
Create geometry data and build the envelope- Parameters:
srsId
- SRS idgeometry
- geometry- Returns:
- geometry data
- Since:
- 4.0.0
-
createAndWrite
public static GeoPackageGeometryData createAndWrite(Geometry geometry) throws IOException
Create geometry data and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Returns:
- geometry data
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
createBuildEnvelopeAndWrite
public static GeoPackageGeometryData createBuildEnvelopeAndWrite(Geometry geometry) throws IOException
Create geometry data, build the envelope, and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Returns:
- geometry data
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
createAndWrite
public static GeoPackageGeometryData createAndWrite(long srsId, Geometry geometry) throws IOException
Create geometry data and write the GeoPackage geometry bytes- Parameters:
srsId
- SRS idgeometry
- geometry- Returns:
- geometry data
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
createBuildEnvelopeAndWrite
public static GeoPackageGeometryData createBuildEnvelopeAndWrite(long srsId, Geometry geometry) throws IOException
Create geometry data, build the envelope, and write the GeoPackage geometry bytes- Parameters:
srsId
- SRS idgeometry
- geometry- Returns:
- geometry data
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(byte[] bytes)
Create the geometry data from GeoPackage geometry bytes- Parameters:
bytes
- GeoPackage geometry bytes- Returns:
- geometry data
- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(Geometry geometry, GeometryEnvelope envelope)
Create the geometry data, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometryenvelope
- geometry envelope- Returns:
- geometry data
- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(long srsId, Geometry geometry, GeometryEnvelope envelope)
Create the geometry data- Parameters:
srsId
- SRS idgeometry
- geometryenvelope
- geometry envelope- Returns:
- geometry data
- Since:
- 4.0.0
-
create
public static GeoPackageGeometryData create(GeoPackageGeometryData geometryData)
Copy the geometry data and create- Parameters:
geometryData
- geometry data- Returns:
- geometry data
- Since:
- 4.0.0
-
createFromWkb
public static GeoPackageGeometryData createFromWkb(byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
bytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read bytes- Since:
- 4.0.0
-
createFromWkbAndBuildEnvelope
public static GeoPackageGeometryData createFromWkbAndBuildEnvelope(byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes and build the envelope, default SRS Id ofgetDefaultSrsId()
- Parameters:
bytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read bytes- Since:
- 4.0.0
-
createFromWkb
public static GeoPackageGeometryData createFromWkb(long srsId, byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes- Parameters:
srsId
- SRS idbytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read bytes- Since:
- 4.0.0
-
createFromWkbAndBuildEnvelope
public static GeoPackageGeometryData createFromWkbAndBuildEnvelope(long srsId, byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes and build the envelope- Parameters:
srsId
- SRS idbytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read bytes- Since:
- 4.0.0
-
createFromWkbAndWrite
public static GeoPackageGeometryData createFromWkbAndWrite(byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
bytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
createFromWkbBuildEnvelopeAndWrite
public static GeoPackageGeometryData createFromWkbBuildEnvelopeAndWrite(byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes, build the envelope, and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
bytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
createFromWkbAndWrite
public static GeoPackageGeometryData createFromWkbAndWrite(long srsId, byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes and write the GeoPackage geometry bytes- Parameters:
srsId
- SRS idbytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
createFromWkbBuildEnvelopeAndWrite
public static GeoPackageGeometryData createFromWkbBuildEnvelopeAndWrite(long srsId, byte[] bytes) throws IOException
Create the geometry data from Well-Known Bytes, build the envelope, and write the GeoPackage geometry bytes- Parameters:
srsId
- SRS idbytes
- well-known bytes- Returns:
- geometry data
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
createGeometryFromWkb
public static Geometry createGeometryFromWkb(byte[] bytes) throws IOException
Create a geometry from Well-Known Bytes- Parameters:
bytes
- well-known bytes- Returns:
- geometry
- Throws:
IOException
- upon failure to read bytes- Since:
- 4.0.0
-
createFromWkt
public static GeoPackageGeometryData createFromWkt(String text) throws IOException
Create the geometry data from Well-Known Text, default SRS Id ofgetDefaultSrsId()
- Parameters:
text
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text- Since:
- 4.0.0
-
createFromWktAndBuildEnvelope
public static GeoPackageGeometryData createFromWktAndBuildEnvelope(String text) throws IOException
Create the geometry data from Well-Known Text and build the envelope, default SRS Id ofgetDefaultSrsId()
- Parameters:
text
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text- Since:
- 4.0.0
-
createFromWkt
public static GeoPackageGeometryData createFromWkt(long srsId, String text) throws IOException
Create the geometry data from Well-Known Text- Parameters:
srsId
- SRS idtext
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text- Since:
- 4.0.0
-
createFromWktAndBuildEnvelope
public static GeoPackageGeometryData createFromWktAndBuildEnvelope(long srsId, String text) throws IOException
Create the geometry data from Well-Known Text and build the envelope- Parameters:
srsId
- SRS idtext
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text- Since:
- 4.0.0
-
createFromWktAndWrite
public static GeoPackageGeometryData createFromWktAndWrite(String text) throws IOException
Create the geometry data from Well-Known Text and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
text
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
createFromWktBuildEnvelopeAndWrite
public static GeoPackageGeometryData createFromWktBuildEnvelopeAndWrite(String text) throws IOException
Create the geometry data from Well-Known Text, build the envelope, and write the GeoPackage geometry bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
text
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
createFromWktAndWrite
public static GeoPackageGeometryData createFromWktAndWrite(long srsId, String text) throws IOException
Create the geometry data from Well-Known Text and write the GeoPackage geometry bytes- Parameters:
srsId
- SRS idtext
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
createFromWktBuildEnvelopeAndWrite
public static GeoPackageGeometryData createFromWktBuildEnvelopeAndWrite(long srsId, String text) throws IOException
Create the geometry data from Well-Known Text, build the envelope, and write the GeoPackage geometry bytes- Parameters:
srsId
- SRS idtext
- well-known text- Returns:
- geometry data
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
createGeometryFromWkt
public static Geometry createGeometryFromWkt(String text) throws IOException
Create a geometry from Well-Known Text- Parameters:
text
- well-known text- Returns:
- geometry
- Throws:
IOException
- upon failure to read text- Since:
- 4.0.0
-
bytes
public static byte[] bytes(Geometry geometry) throws IOException
GeoPackage geometry bytes from the geometry, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
bytesAndBuildEnvelope
public static byte[] bytesAndBuildEnvelope(Geometry geometry) throws IOException
GeoPackage geometry bytes from the geometry with built envelope, default SRS Id ofgetDefaultSrsId()
- Parameters:
geometry
- geometry- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
bytes
public static byte[] bytes(long srsId, Geometry geometry) throws IOException
GeoPackage geometry bytes from the geometry- Parameters:
srsId
- SRS idgeometry
- geometry- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
bytesAndBuildEnvelope
public static byte[] bytesAndBuildEnvelope(long srsId, Geometry geometry) throws IOException
GeoPackage geometry bytes from the geometry with built envelope- Parameters:
srsId
- SRS idgeometry
- geometry- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
bytesFromWkb
public static byte[] bytesFromWkb(byte[] bytes) throws IOException
GeoPackage geometry bytes from Well-Known bytes, default SRS Id ofgetDefaultSrsId()
- Parameters:
bytes
- well-known bytes- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
bytesFromWkbAndBuildEnvelope
public static byte[] bytesFromWkbAndBuildEnvelope(byte[] bytes) throws IOException
GeoPackage geometry bytes from Well-Known bytes with built envelope, default SRS Id ofgetDefaultSrsId()
- Parameters:
bytes
- well-known bytes- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
bytesFromWkb
public static byte[] bytesFromWkb(long srsId, byte[] bytes) throws IOException
GeoPackage geometry bytes from Well-Known bytes- Parameters:
srsId
- SRS idbytes
- well-known bytes- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
bytesFromWkbAndBuildEnvelope
public static byte[] bytesFromWkbAndBuildEnvelope(long srsId, byte[] bytes) throws IOException
GeoPackage geometry bytes from Well-Known bytes with built envelope- Parameters:
srsId
- SRS idbytes
- well-known bytes- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
bytesFromWkt
public static byte[] bytesFromWkt(String text) throws IOException
GeoPackage geometry bytes from Well-Known text, default SRS Id ofgetDefaultSrsId()
- Parameters:
text
- well-known text- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
bytesFromWktAndBuildEnvelope
public static byte[] bytesFromWktAndBuildEnvelope(String text) throws IOException
GeoPackage geometry bytes from Well-Known text with built envelope, default SRS Id ofgetDefaultSrsId()
- Parameters:
text
- well-known text- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
bytesFromWkt
public static byte[] bytesFromWkt(long srsId, String text) throws IOException
GeoPackage geometry bytes from Well-Known text- Parameters:
srsId
- SRS idtext
- well-known text- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
bytesFromWktAndBuildEnvelope
public static byte[] bytesFromWktAndBuildEnvelope(long srsId, String text) throws IOException
GeoPackage geometry bytes from Well-Known text with built envelope- Parameters:
srsId
- SRS idtext
- well-known text- Returns:
- GeoPackage geometry bytes
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
wkb
public static byte[] wkb(GeoPackageGeometryData geometryData) throws IOException
Well-Known Bytes from the geometry data- Parameters:
geometryData
- geometry data- Returns:
- well-known bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
wkb
public static byte[] wkb(Geometry geometry) throws IOException
Well-Known Bytes from the geometry- Parameters:
geometry
- geometry- Returns:
- well-known bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
wkb
public static byte[] wkb(byte[] bytes) throws IOException
Well-Known Bytes from GeoPackage geometry bytes- Parameters:
bytes
- GeoPackage geometry bytes- Returns:
- well-known bytes
- Throws:
IOException
- upon failure to read or write bytes- Since:
- 4.0.0
-
wkbFromWkt
public static byte[] wkbFromWkt(String text) throws IOException
Well-Known Bytes from Well-Known Text- Parameters:
text
- well-known text- Returns:
- well-known bytes
- Throws:
IOException
- upon failure to read text or write bytes- Since:
- 4.0.0
-
wkt
public static String wkt(GeoPackageGeometryData geometryData) throws IOException
Well-Known Text from the geometry data- Parameters:
geometryData
- geometry data- Returns:
- well-known text
- Throws:
IOException
- upon failure to write text- Since:
- 4.0.0
-
wkt
public static String wkt(Geometry geometry) throws IOException
Well-Known Text from the geometry- Parameters:
geometry
- geometry- Returns:
- well-known text
- Throws:
IOException
- upon failure to write text- Since:
- 4.0.0
-
wkt
public static String wkt(byte[] bytes) throws IOException
Well-Known Text from GeoPackage Geometry Bytes- Parameters:
bytes
- GeoPackage geometry bytes- Returns:
- well-known text
- Throws:
IOException
- upon failure to write text- Since:
- 4.0.0
-
wktFromWkb
public static String wktFromWkb(byte[] bytes) throws IOException
Well-Known Text from Well-Known Bytes- Parameters:
bytes
- well-known bytes- Returns:
- well-known text
- Throws:
IOException
- upon failure to write text- Since:
- 4.0.0
-
fromBytes
public void fromBytes(byte[] bytes)
Populate the geometry data from the bytes- Parameters:
bytes
- geometry bytes
-
toBytes
public byte[] toBytes() throws IOException
Write the geometry to bytes- Returns:
- bytes
- Throws:
IOException
- upon failure to write bytes
-
isExtended
public boolean isExtended()
Is the geometry extended- Returns:
- true if extended
-
isEmpty
public boolean isEmpty()
Is the geometry empty- Returns:
- true if empty
-
getByteOrder
public ByteOrder getByteOrder()
Get the byte order- Returns:
- byte order
-
getSrsId
public int getSrsId()
Get the SRS id- Returns:
- SRS id
-
getEnvelope
public GeometryEnvelope getEnvelope()
Get the geometry envelope- Returns:
- geometry envelope
-
getBoundingBox
public BoundingBox getBoundingBox()
Get the bounding box of the geometry envelope- Returns:
- bounding box
- Since:
- 6.2.0
-
getGeometry
public Geometry getGeometry()
Get the geometry- Returns:
- geometry
-
getOrReadGeometry
public Geometry getOrReadGeometry() throws IOException
Get the geometry or read it from geometry bytes- Returns:
- geometry
- Throws:
IOException
- upon failure to read geometry bytes- Since:
- 6.3.0
-
setExtended
public void setExtended(boolean extended)
Set the extended flag- Parameters:
extended
- extended value
-
setEmpty
public void setEmpty(boolean empty)
Set the empty flag- Parameters:
empty
- empty value
-
setByteOrder
public void setByteOrder(ByteOrder byteOrder)
Set the byte order- Parameters:
byteOrder
- byte order
-
setSrsId
public void setSrsId(int srsId)
Set the SRS id- Parameters:
srsId
- SRS id
-
setEnvelope
public void setEnvelope(GeometryEnvelope envelope)
Set the geometry envelope- Parameters:
envelope
- geometry envelope
-
setBytes
public void setBytes(byte[] bytes)
Set the bytes- Parameters:
bytes
- bytes- Since:
- 6.3.0
-
setBytes
public void setBytes(byte[] bytes, int wkbGeometryIndex)
Set the bytes- Parameters:
bytes
- byteswkbGeometryIndex
- well-known geometry bytes start index- Since:
- 6.3.0
-
setHeaderBytes
public void setHeaderBytes(byte[] bytes)
Set the geometry header bytes- Parameters:
bytes
- header bytes- Since:
- 6.3.0
-
setGeometry
public void setGeometry(Geometry geometry)
Set the geometry. Updates the empty flag. Updates the extended flag if the geometry is not null. Following invoking this method and upon setting the SRS id, calltoBytes()
to convert the geometry to bytes. Alternatively callsetGeometryToBytes(Geometry)
orsetGeometryAndBuildEnvelopeToBytes(Geometry)
to perform both operations.- Parameters:
geometry
- geometry
-
setGeometryBytes
public void setGeometryBytes(byte[] bytes)
Set the geometry bytes. Updates the empty flag. Extended flag should be manually set withsetExtended(boolean)
as needed.- Parameters:
bytes
- geometry bytes- Since:
- 6.3.0
-
setGeometryToBytes
public byte[] setGeometryToBytes(Geometry geometry) throws IOException
Set the geometry and write to bytes- Parameters:
geometry
- geometry- Returns:
- geometry bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
setGeometryAndBuildEnvelopeToBytes
public byte[] setGeometryAndBuildEnvelopeToBytes(Geometry geometry) throws IOException
Set the geometry, build the envelope, and write to bytes- Parameters:
geometry
- geometry- Returns:
- geometry bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
setGeometryFromWkb
public void setGeometryFromWkb(byte[] bytes) throws IOException
Set the geometry from Well-Known bytes- Parameters:
bytes
- well-known bytes- Throws:
IOException
- upon failure to read bytes- Since:
- 4.0.0
-
setGeometryFromWkt
public void setGeometryFromWkt(String text) throws IOException
Set the geometry from Well-Known text- Parameters:
text
- well-known text- Throws:
IOException
- upon failure to read text- Since:
- 4.0.0
-
clearBytes
public void clearBytes()
Clear the bytes- Since:
- 6.3.0
-
clearHeaderBytes
public void clearHeaderBytes()
Clear the header bytes and overall bytes- Since:
- 6.3.0
-
clearGeometryBytes
public void clearGeometryBytes()
Clear the geometry bytes and overall bytes- Since:
- 6.3.0
-
getBytes
public byte[] getBytes() throws IOException
Get the bytes of the entire GeoPackage geometry including GeoPackage header and WKB bytes- Returns:
- bytes
- Throws:
IOException
- upon failure to write bytes
-
getByteBuffer
public ByteBuffer getByteBuffer() throws IOException
Get the bytes already ordered in a Byte Buffer- Returns:
- byte buffer
- Throws:
IOException
- upon failure to write bytes- Since:
- 6.3.0
-
getHeaderBytes
public byte[] getHeaderBytes() throws IOException
Get the GeoPackage header bytes- Returns:
- header bytes
- Throws:
IOException
- upon failure to write bytes
-
getHeaderByteBuffer
public ByteBuffer getHeaderByteBuffer() throws IOException
Get the GeoPackage header bytes already ordered in a Byte Buffer- Returns:
- byte buffer
- Throws:
IOException
- upon failure to write bytes
-
getWkb
public byte[] getWkb() throws IOException
Get the Well-Known Binary Geometry bytes- Returns:
- bytes
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
getWkbBuffer
public ByteBuffer getWkbBuffer() throws IOException
Get the Well-Known Binary Geometry bytes already ordered in a Byte Buffer- Returns:
- byte buffer
- Throws:
IOException
- upon failure to write bytes- Since:
- 4.0.0
-
getWkbGeometryIndex
public int getWkbGeometryIndex()
Return the byte index where the Well-Known Binary bytes start- Returns:
- index
-
getWkt
public String getWkt()
Get a Well-Known text string from the geometry- Returns:
- well-known text string
- Since:
- 4.0.0
-
getOrBuildEnvelope
public GeometryEnvelope getOrBuildEnvelope()
Get the envelope if it exists or build, set, and retrieve it from the geometry- Returns:
- geometry envelope
- Since:
- 3.1.0
-
buildEnvelope
public GeometryEnvelope buildEnvelope()
Build, set, and retrieve the envelope from the geometry- Returns:
- geometry envelope
- Since:
- 4.0.0
-
getOrBuildBoundingBox
public BoundingBox getOrBuildBoundingBox()
Get the bounding box of the geometry envelope if it exists or build, set and retrieve it from the geometry- Returns:
- bounding box
- Since:
- 6.2.0
-
getIndicator
public static int getIndicator(GeometryEnvelope envelope)
Get the envelope flag indicator1 for xy, 2 for xyz, 3 for xym, 4 for xyzm (null would be 0)
- Parameters:
envelope
- geometry envelope- Returns:
- indicator
-
transform
public GeoPackageGeometryData transform(ProjectionTransform transform)
Transform the geometry data using the provided projection transform- Parameters:
transform
- projection transform- Returns:
- transformed geometry data
- Since:
- 4.0.0
-
transform
public GeoPackageGeometryData transform(GeometryTransform transform)
Transform the geometry data using the provided geometry projection transform- Parameters:
transform
- geometry projection transform- Returns:
- transformed geometry data
- Since:
- 6.0.0
-
-