|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.helper.GeolocHelper
public class GeolocHelper
Provides useful methods for geolocalisation
Field Summary | |
---|---|
protected static org.slf4j.Logger |
logger
The logger |
Constructor Summary | |
---|---|
GeolocHelper()
|
Method Summary | |
---|---|
static com.vividsolutions.jts.geom.Geometry |
convertFromHEXEWKBToGeometry(String hewewkbt)
|
static com.vividsolutions.jts.geom.LineString |
createLineString(String wktLineString)
Create a JTS LineString from the specified String for the SRID (aka : Spatial Reference IDentifier) 4326 (WGS84) example : {"LINESTRING (0 0, 10 10, 20 20)"} |
static com.vividsolutions.jts.geom.MultiLineString |
createMultiLineString(String[] wktLineStrings)
Create a JTS MultiLineString from the specified array of linestring for the SRID (aka : Spatial Reference IDentifier) 4326 (WGS84) example : {"LINESTRING (0 0, 10 10, 20 20)","LINESTRING (30 30, 40 40, 50 50)"} |
static com.vividsolutions.jts.geom.Point |
createPoint(Float longitude,
Float latitude)
Create a JTS point from the specified longitude and latitude for the SRID (aka : Spatial Reference IDentifier) 4326 (WGS84) |
static com.vividsolutions.jts.geom.Polygon |
createPolygonBox(double lng,
double lat,
double distance)
|
static double |
distance(com.vividsolutions.jts.geom.Point point1,
com.vividsolutions.jts.geom.Point point2)
Calculate the distance between the specified point. |
static String |
getBoundingBox(String alias,
double latInDegree,
double longInDegree,
double distance)
|
static Class<? extends GisFeature> |
getClassEntityFromString(String classNameWithoutPackage)
Return the class corresponding to the specified String or null if not found. |
static byte |
getFromChar(char c)
Turns a char that encodes four bits in hexadecimal notation into a byte |
static Float |
parseInternationalDouble(String number)
parse a string and return the corresponding double value, it accepts comma or point as decimal separator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger logger
Constructor Detail |
---|
public GeolocHelper()
Method Detail |
---|
public static com.vividsolutions.jts.geom.Point createPoint(Float longitude, Float latitude)
longitude
- The longitude for the pointlatitude
- The latitude for the point
IllegalArgumentException
- if latitude is not between -90 and 90, or longitude is
not between -180 and 180SRID
public static com.vividsolutions.jts.geom.MultiLineString createMultiLineString(String[] wktLineStrings)
wktLineStrings
- The array that contains all the linestrings
IllegalArgumentException
- if the string are not correctSRID
public static com.vividsolutions.jts.geom.LineString createLineString(String wktLineString)
wktLineString
- a String that represent the lineString
IllegalArgumentException
- if the string are not correctSRID
public static double distance(com.vividsolutions.jts.geom.Point point1, com.vividsolutions.jts.geom.Point point2)
point1
- The first JTS pointpoint2
- The second JTS point
public static Class<? extends GisFeature> getClassEntityFromString(String classNameWithoutPackage)
classNameWithoutPackage
- the simple name of the Class we want to retrieve
public static Float parseInternationalDouble(String number) throws ParseException
number
- the number with a point or a comma as decimal separator
ParseException
- in case of errorspublic static com.vividsolutions.jts.geom.Polygon createPolygonBox(double lng, double lat, double distance)
lat
- the central latitude for the Polygonlng
- the central longitude for the polygondistance
- the distance in meters from the point to create the
polygon
RuntimeException
if an
error occured thros IllegalArgumentException
if lat, long
or distance is not correctpublic static String getBoundingBox(String alias, double latInDegree, double longInDegree, double distance)
alias
- the
sql aliaslatInDegree
- the latitude in degreelongInDegree
- the longitude in degreedistance
- the boundingbox distance
public static com.vividsolutions.jts.geom.Geometry convertFromHEXEWKBToGeometry(String hewewkbt)
hewewkbt
- the string in hexa well know text
SRID.WGS84_SRID
public static byte getFromChar(char c)
c
- the char to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |