public class SpatialUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
EARTH_RADIUS_EQUATORIAL
The equatorial radius of the earth [6378.1370 km] (see Wikipedia) as derived from the WGS-84 ellipsoid.
|
static double |
EARTH_RADIUS_MEAN
The Authalic mean radius (A
|
static double |
EARTH_RADIUS_POLAR
The polar radius of the earth [6356.7523 km] (see Wikipedia) as derived from the WGS-84 ellipsoid.
|
| Constructor and Description |
|---|
SpatialUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Float |
convertToDegrees(Float kilometres)
Turns the number of km in a degreee representation based on a conversion factor in Australia.
|
static double |
degreesLatPerKm(double lat,
double lon)
Returns the number of degrees of latitude per km at a given
Location. |
static String |
getInverseWKT(String wkt)
Deprecated.
No longer necessary because the SOLR spatial support negated areas in the query.
|
static String |
getWKTAsUnions(String wkt)
Returns a GeometryCollection as a UNION of geometries
|
static String |
getWKTQuery(String spatialField,
String wkt,
boolean negated)
Build up a WKT query.
|
static void |
main(String[] args) |
static double |
radiusAtLocation(double lat,
double lon)
Returns the radius of the earth at the latitude of the supplied
Location (see Wikipedia for source). |
public static final double EARTH_RADIUS_MEAN
public static final double EARTH_RADIUS_EQUATORIAL
public static final double EARTH_RADIUS_POLAR
@Deprecated public static String getInverseWKT(String wkt)
wkt - public static void main(String[] args)
public static double radiusAtLocation(double lat,
double lon)
Location (see Wikipedia for source).p - the Location at which to compute the earth's
radiusLocationpublic static double degreesLatPerKm(double lat,
double lon)
Location. This can be used to convert between km-based and
degree-based grid spacing. The calculation takes into account the shape
of the earth (oblate spheroid) and scales the conversion accordingly.p - the Location at which to conversion valueLocation#radiusAtLocation(Location)public static Float convertToDegrees(Float kilometres)
kilometres - public static String getWKTAsUnions(String wkt)
wkt - public static String getWKTQuery(String spatialField, String wkt, boolean negated)
spatialField - The SOLR field that is being used to search WKTwkt - The source WKT valuenegated - Whether or not the query should be negated this effects logic operator usedCopyright © 2014. All rights reserved.