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
MXApplicationExceptionpublic static byte[] convertFromWKTToBinary(java.lang.String wkt)
throws MXApplicationException,
com.ibm.research.st.STException
MXApplicationExceptioncom.ibm.research.st.STExceptionpublic static byte[] convertFromGeoJSONToBinary(java.lang.String geoJSOString)
throws MXApplicationException,
com.ibm.research.st.STException
geoJSOString - MXApplicationExceptioncom.ibm.research.st.STExceptionpublic static java.lang.String convertFromBinaryToWKT(byte[] bytes)
throws MXApplicationException
bytes - MXApplicationExceptionpublic static java.lang.String convertFromGeoJSONToWKT(java.lang.String geoJSONString)
throws MXApplicationException
geoJSONString - MXApplicationExceptionpublic static java.lang.String convertFromBinaryToGeoJSON(byte[] bytes)
throws MXApplicationException
bytes - MXApplicationExceptionpublic static java.lang.String convertFromWKTToGeoJSON(java.lang.String wkt)
throws MXApplicationException
wkt - MXApplicationExceptionpublic 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 - MXApplicationExceptionpublic static byte[] convertToInternalFormat(java.lang.String geometryString,
java.lang.String mboName)
throws MXApplicationException
geometryString - mboName - MXApplicationExceptionpublic 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 - MXApplicationExceptionpublic static java.lang.Long calculatePointGeoHash(java.lang.Double y,
java.lang.Double x)
throws MXApplicationException
y - x - MXApplicationExceptionpublic static java.util.List calculateGeometryGeoHashCover(byte[] geometryBytes)
throws MXApplicationException
geometryBytes - MXApplicationExceptionpublic static java.lang.String createBoundingBoxGeohashClause(java.lang.Double[] bboxValues)
throws MXApplicationException
bboxValues - MXApplicationExceptionpublic 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 - MXApplicationExceptionpublic static java.lang.String getGeoHashCenter(java.lang.Long hash,
int bitDepth,
java.lang.String externalFormat)
throws MXApplicationException
hash - truncated hashbitDepth - bit depthexternalFormat - MXApplicationExceptionpublic static java.lang.Double[] parseBBoxParam(java.lang.String bboxParam)
throws MXApplicationException
bboxParam - MXApplicationExceptionpublic static int getProperHashDepthLevel(double minLong,
double maxLong)
minLong - maxLong - public static java.lang.String retrieveGeometryTypeFromBinary(byte[] binaryGeometry)
binaryGeometry -