@Configurable public class GeometryHandler extends Object
FeatureQueryHandler
and SpatialFilteringProfile DAO.Modifier and Type | Field and Description |
---|---|
private static ReentrantLock |
creationLock |
private int |
default3DEPSG |
private int |
defaultEPSG |
private List<Range> |
epsgsWithReversedAxisOrder |
private static GeometryHandler |
instance |
private boolean |
spatialDatasource |
Modifier | Constructor and Description |
---|---|
private |
GeometryHandler()
Private constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
featureIsInFilter(com.vividsolutions.jts.geom.Geometry geometry,
List<com.vividsolutions.jts.geom.Geometry> envelopes)
Check if geometry is in SpatialFilter envelopes
|
int |
getDefault3DEPSG()
Get configured default 3D EPSG code
|
int |
getDefaultEPSG()
Get configured default EPSG code
|
com.vividsolutions.jts.geom.Geometry |
getFilterForNonSpatialDatasource(SpatialFilter filter)
Get filter geometry for BBOX spatial filter and non spatial datasource
|
static GeometryHandler |
getInstance() |
double |
getValueAsDouble(Object value)
Get Object value as Double value
|
String |
getWktString(Object longitude,
Object latitude)
Get WKT string from longitude and latitude
|
boolean |
isAxisOrderSwitchRequired(int epsgCode) |
boolean |
isSpatialDatasource()
Is datasource a spatial datasource
|
void |
setDefault3DEpsg(int epsgCode3D)
Set default 3D EPSG code from settings
|
void |
setDefaultEpsg(int epsgCode)
Set default EPSG code from settings
|
void |
setEpsgCodesWithReversedAxisOrder(String codes)
Set the EPSG code ranges for which the coordinates should be switched
|
void |
setSpatialDatasource(boolean spatialDatasource)
Set flag if the used datasource is a spatial datasource (provides spatial
functions)
|
com.vividsolutions.jts.geom.Geometry |
switchCoordinateAxisOrderIfNeeded(com.vividsolutions.jts.geom.Geometry geom)
Switch Geometry coordinates if necessary
|
private static GeometryHandler instance
private static ReentrantLock creationLock
private int defaultEPSG
private int default3DEPSG
private boolean spatialDatasource
public static GeometryHandler getInstance()
public int getDefaultEPSG()
public int getDefault3DEPSG()
@Setting(value="service.defaultEpsg") public void setDefaultEpsg(int epsgCode) throws ConfigurationException
epsgCode
- EPSG code from settingsConfigurationException
- If an error occurs@Setting(value="service.default3DEpsg") public void setDefault3DEpsg(int epsgCode3D) throws ConfigurationException
epsgCode3D
- 3D EPSG code from settingsConfigurationException
- If an error occurs@Setting(value="misc.switchCoordinatesForEpsgCodes") public void setEpsgCodesWithReversedAxisOrder(String codes) throws ConfigurationException
codes
- EPSG code rangesConfigurationException
- If an error occurs@Setting(value="service.SpatialDatasource") public void setSpatialDatasource(boolean spatialDatasource)
spatialDatasource
- Flag if spatial datasourcepublic boolean isAxisOrderSwitchRequired(int epsgCode)
epsgCode
- public boolean isSpatialDatasource()
public com.vividsolutions.jts.geom.Geometry switchCoordinateAxisOrderIfNeeded(com.vividsolutions.jts.geom.Geometry geom) throws OwsExceptionReport
geom
- Geometry to switch coordinatesOwsExceptionReport
- If an error occurspublic double getValueAsDouble(Object value)
value
- Value to checkpublic com.vividsolutions.jts.geom.Geometry getFilterForNonSpatialDatasource(SpatialFilter filter) throws OwsExceptionReport
filter
- SpatialFilterOwsExceptionReport
- If SpatialFilter is not supportedpublic String getWktString(Object longitude, Object latitude)
longitude
- Longitude coordinatelatitude
- Latitude coordinatepublic boolean featureIsInFilter(com.vividsolutions.jts.geom.Geometry geometry, List<com.vividsolutions.jts.geom.Geometry> envelopes)
geometry
- Geometry to checkenvelopes
- SpatialFilter envelopesCopyright © 2012-2014 52north.org. All Rights Reserved.