public class GeometryUtils
extends java.lang.Object
Constructor and Description |
---|
GeometryUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.List |
calculateGeometryGeoHashCover(byte[] geometryBytes) |
static java.lang.Long |
calculateMBRGeoHash(byte[] geometryBytes) |
static java.lang.Long |
calculatePointGeoHash(java.lang.Double y,
java.lang.Double x) |
static java.lang.String |
convertFromBinaryToGeoJSON(byte[] bytes)
Convert from Binary to GeoJSON String format
|
static java.lang.String |
convertFromBinaryToWKT(byte[] bytes)
Convert from Binary format to String WKT
|
static byte[] |
convertFromGeoJSONToBinary(java.lang.String geoJSOString)
Convert from GeoJSON string to Binary format
|
static java.lang.String |
convertFromGeoJSONToWKT(java.lang.String geoJSONString)
Convert from GeoJSON String format to WKT String
|
static byte[] |
convertFromWKTToBinary(java.lang.String wkt)
Convert from WKT String to Binary format
|
static java.lang.String |
convertFromWKTToGeoJSON(java.lang.String wkt)
Convert from WKT String to GeoJSON String
|
static java.lang.String |
convertToExternalFormat(byte[] data,
java.lang.String mboName)
Convert the binary data to the External format geometry for the Mbo
|
static byte[] |
convertToInternalFormat(java.lang.String geometryString,
java.lang.String mboName)
Convert the External geometry to the binary format that is used in the DB
|
static java.lang.String |
createBoundingBoxGeohashClause(java.lang.Double[] bboxValues) |
static java.lang.String |
createBoundingBoxWhereClause(java.lang.String objectName,
java.lang.Double bboxMinLong,
java.lang.Double bboxMinLat,
java.lang.Double bboxMaxLong,
java.lang.Double bboxMaxLat) |
static java.lang.String |
findGeometryHashTablename(java.lang.String mboName) |
static java.lang.String |
getGeoHashCenter(java.lang.Long hash,
int bitDepth,
java.lang.String externalFormat) |
static java.lang.String |
getGeoHashCenter(java.lang.Long hash,
java.lang.String externalFormat)
Get center latitude/longitude from the hash
|
static int |
getProperHashDepthLevel(double minLong,
double maxLong)
Get the proper hash depth level based on longitude.
|
static boolean |
isGeometryField(java.lang.String mboName,
java.lang.String fieldName) |
static java.lang.Double[] |
parseBBoxParam(java.lang.String bboxParam)
Parse bboxQuery parameter
|
static byte[] |
reGenerateBinary(byte[] geometry)
Method to generate again the binary value
Useful when lib changes the metadata that is stored in the bynary
|
static java.lang.String |
retrieveGeometryTypeFromBinary(byte[] binaryGeometry) |
public static byte[] reGenerateBinary(byte[] geometry) throws MXApplicationException
MXApplicationException
public static byte[] convertFromWKTToBinary(java.lang.String wkt) throws MXApplicationException, com.ibm.research.st.STException
MXApplicationException
com.ibm.research.st.STException
public static byte[] convertFromGeoJSONToBinary(java.lang.String geoJSOString) throws MXApplicationException, com.ibm.research.st.STException
geoJSOString
- MXApplicationException
com.ibm.research.st.STException
public static java.lang.String convertFromBinaryToWKT(byte[] bytes) throws MXApplicationException
bytes
- MXApplicationException
public static java.lang.String convertFromGeoJSONToWKT(java.lang.String geoJSONString) throws MXApplicationException
geoJSONString
- MXApplicationException
public static java.lang.String convertFromBinaryToGeoJSON(byte[] bytes) throws MXApplicationException
bytes
- MXApplicationException
public static java.lang.String convertFromWKTToGeoJSON(java.lang.String wkt) throws MXApplicationException
wkt
- MXApplicationException
public static boolean isGeometryField(java.lang.String mboName, java.lang.String fieldName)
mboName
- fieldName
- public static java.lang.String convertToExternalFormat(byte[] data, java.lang.String mboName) throws MXApplicationException
data
- mboName
- MXApplicationException
public static byte[] convertToInternalFormat(java.lang.String geometryString, java.lang.String mboName) throws MXApplicationException
geometryString
- mboName
- MXApplicationException
public static java.lang.String createBoundingBoxWhereClause(java.lang.String objectName, java.lang.Double bboxMinLong, java.lang.Double bboxMinLat, java.lang.Double bboxMaxLong, java.lang.Double bboxMaxLat)
objectName
- bboxMinLong
- bboxMinLat
- bboxMaxLong
- bboxMaxLat
- public static java.lang.Long calculateMBRGeoHash(byte[] geometryBytes) throws MXApplicationException
geometryBytes
- MXApplicationException
public static java.lang.Long calculatePointGeoHash(java.lang.Double y, java.lang.Double x) throws MXApplicationException
y
- x
- MXApplicationException
public static java.util.List calculateGeometryGeoHashCover(byte[] geometryBytes) throws MXApplicationException
geometryBytes
- MXApplicationException
public static java.lang.String createBoundingBoxGeohashClause(java.lang.Double[] bboxValues) throws MXApplicationException
bboxValues
- MXApplicationException
public static java.lang.String findGeometryHashTablename(java.lang.String mboName)
mboName
- public static java.lang.String getGeoHashCenter(java.lang.Long hash, java.lang.String externalFormat) throws MXApplicationException
hash
- truncated hashexternalFormat
- MXApplicationException
public static java.lang.String getGeoHashCenter(java.lang.Long hash, int bitDepth, java.lang.String externalFormat) throws MXApplicationException
hash
- truncated hashbitDepth
- bit depthexternalFormat
- MXApplicationException
public static java.lang.Double[] parseBBoxParam(java.lang.String bboxParam) throws MXApplicationException
bboxParam
- MXApplicationException
public static int getProperHashDepthLevel(double minLong, double maxLong)
minLong
- maxLong
- public static java.lang.String retrieveGeometryTypeFromBinary(byte[] binaryGeometry)
binaryGeometry
-