public class CoordianteTransformator extends Object implements RequestResponseModifier<AbstractServiceRequest<?>,AbstractServiceResponse>
Modifier and Type | Field and Description |
---|---|
private static Set<RequestResponseModifierKeyType> |
REQUEST_RESPONSE_MODIFIER_KEY_TYPES |
Constructor and Description |
---|
CoordianteTransformator() |
Modifier and Type | Method and Description |
---|---|
private void |
checkAbstractProcess(AbstractSensorML abstractSensorML,
int targetCrs)
Check the
AbstractProcess if modifications are required |
private void |
checkAbstractSensorML(AbstractSensorML abstractSensorML,
int targetCrs)
Check the
AbstractSensorML if modifications are required |
private void |
checkCapabilitiesForObservedAreaAndTransform(AbstractSensorML abstractSensorML,
int targetCrs)
Check if the
AbstractSensorML contains SmlCapabilities
with observed area |
private void |
checkOmParameterForGeometry(Collection<NamedValue<?>> parameters,
int targetCRS)
Check if the O&M parameter contains a geometry and transform to target
EPSG code, e.g.
|
private void |
checkRequestedGeometryOfSamplingFeature(SamplingFeature samplingFeature)
Check and transform the
SamplingFeature geometry to storage EPSG
code if necessary |
private void |
checkRequestedObservations(List<OmObservation> observations)
Check all geometries in the requested
OmObservation s and
transform to storage EPSG code if necessary |
private void |
checkRequestIfCrsIsSetAndSupported(AbstractServiceRequest<?> request)
Check if the the CRS parameter is contained in the request and supported
|
private void |
checkResponseGeometryOfSamplingFeature(SamplingFeature samplingFeature,
int targetCRS)
Check and transform the
SamplingFeature geometry to requested or
default response EPSG code if necessary |
private void |
checkResponseObservations(List<OmObservation> observations,
int targetCRS)
Check all geometries in the response
OmObservation s and transform
to requested or default response EPSG code if necessary |
private ServiceConfiguration |
getConfiguration() |
private int |
getCrs(Object value)
Get the EPSG code as integer from value
|
private int |
getCrsFrom(AbstractServiceRequest<?> request)
Get the CRS from the request or if the CRS parameter is not set, return
the
EpsgConstants.NOT_SET_EPSG . |
private int |
getCrsFromString(String crs)
Get EPSG code as integer from String value
|
RequestResponseModifierFacilitator |
getFacilitator() |
private GeometryHandler |
getGeomtryHandler() |
private static Set<RequestResponseModifierKeyType> |
getKeyTypes()
Get the keys
|
private int |
getRequestedCrs(AbstractServiceRequest<?> request)
Get the target EPSG code.
|
Set<RequestResponseModifierKeyType> |
getRequestResponseModifierKeyTypes() |
private AbstractServiceResponse |
modifyDescribeSensorResponse(DescribeSensorRequest request,
DescribeSensorResponse response)
Modify the DescribeSensor response
|
private AbstractServiceResponse |
modifyGetCapabilitiesResponse(GetCapabilitiesRequest request,
GetCapabilitiesResponse response)
Modify the GetCapabilities response
|
private AbstractServiceRequest<?> |
modifyGetFeatureOfInterestRequest(GetFeatureOfInterestRequest request)
Modify the GetFeatureOfInterest request
|
private AbstractServiceResponse |
modifyGetFeatureOfInterestResponse(GetFeatureOfInterestRequest request,
GetFeatureOfInterestResponse response)
Modify the GetFeatureOfInterest response
|
private AbstractServiceResponse |
modifyGetObservationByIdResponse(GetObservationByIdRequest request,
GetObservationByIdResponse response)
Modify the GetObservationById response
|
private AbstractServiceRequest<?> |
modifyGetObservationRequest(GetObservationRequest request)
Modify the GetObservation request
|
private AbstractServiceResponse |
modifyGetObservationResponse(GetObservationRequest request,
GetObservationResponse response)
Modify the GetObservation response
|
private AbstractServiceRequest<?> |
modifyGetResultRequest(GetResultRequest request)
Modify the GetResult request
|
private AbstractServiceRequest<?> |
modifyInsertObservationRequest(InsertObservationRequest request)
Modify the InsertObservation request
|
private AbstractServiceRequest<?> |
modifyInsertResultTemplateRequest(InsertResultTemplateRequest request)
Modify the InsertResultTemplate request
|
AbstractServiceRequest<?> |
modifyRequest(AbstractServiceRequest<?> request) |
AbstractServiceResponse |
modifyResponse(AbstractServiceRequest<?> request,
AbstractServiceResponse response) |
private void |
preProcessSpatialFilter(SpatialFilter spatialFilter)
Check if the spatial filter geometry EPSG code is the same as the stored
EPSG code.
|
private void |
preProcessSpatialFilters(List<SpatialFilter> spatialFilters)
Check if the spatial filters geometries EPSG code are the same as the
stored EPSG code.
|
private void |
processAbstractFeature(AbstractFeature feature,
int targetCRS)
Check all geometries in the response
AbstractFeature s and
transform to requested or default response EPSG code if necessary |
private void |
transformLocation(SmlLocation location,
int targetCrs)
Check the
SmlLocation if modifications are required |
private void |
transformPosition(SmlPosition position,
int targetCrs)
Check the
SmlPosition if modifications are required |
private List<SweCoordinate<?>> |
transformSweCoordinates(List<SweCoordinate<?>> position,
int sourceCrs,
int targetCrs)
Transform coordinates
|
private static final Set<RequestResponseModifierKeyType> REQUEST_RESPONSE_MODIFIER_KEY_TYPES
private static Set<RequestResponseModifierKeyType> getKeyTypes()
public Set<RequestResponseModifierKeyType> getRequestResponseModifierKeyTypes()
getRequestResponseModifierKeyTypes
in interface RequestResponseModifier<AbstractServiceRequest<?>,AbstractServiceResponse>
public AbstractServiceRequest<?> modifyRequest(AbstractServiceRequest<?> request) throws OwsExceptionReport
modifyRequest
in interface RequestResponseModifier<AbstractServiceRequest<?>,AbstractServiceResponse>
OwsExceptionReport
public AbstractServiceResponse modifyResponse(AbstractServiceRequest<?> request, AbstractServiceResponse response) throws OwsExceptionReport
modifyResponse
in interface RequestResponseModifier<AbstractServiceRequest<?>,AbstractServiceResponse>
OwsExceptionReport
private AbstractServiceRequest<?> modifyGetFeatureOfInterestRequest(GetFeatureOfInterestRequest request) throws OwsExceptionReport
request
- the GetFeatureOfInterest requestOwsExceptionReport
- If the transformation failsprivate AbstractServiceRequest<?> modifyGetObservationRequest(GetObservationRequest request) throws OwsExceptionReport
request
- the GetObservation requestOwsExceptionReport
- If the transformation failsprivate AbstractServiceRequest<?> modifyGetResultRequest(GetResultRequest request) throws OwsExceptionReport
request
- the GetResult requestOwsExceptionReport
- If the transformation failsprivate AbstractServiceRequest<?> modifyInsertObservationRequest(InsertObservationRequest request) throws OwsExceptionReport
request
- the InsertObservation requestOwsExceptionReport
- If the transformation failsprivate AbstractServiceRequest<?> modifyInsertResultTemplateRequest(InsertResultTemplateRequest request) throws OwsExceptionReport
request
- the InsertResultTemplate requestOwsExceptionReport
- If the transformation failsprivate AbstractServiceResponse modifyGetFeatureOfInterestResponse(GetFeatureOfInterestRequest request, GetFeatureOfInterestResponse response) throws OwsExceptionReport
request
- the GetFeatureOfInterest requestresponse
- the GetFeatureOfInterest responseOwsExceptionReport
- If the transformation failsprivate AbstractServiceResponse modifyGetObservationResponse(GetObservationRequest request, GetObservationResponse response) throws OwsExceptionReport
request
- the GetObservation requestresponse
- the GetObservation responseOwsExceptionReport
- If the transformation failsprivate AbstractServiceResponse modifyGetObservationByIdResponse(GetObservationByIdRequest request, GetObservationByIdResponse response) throws OwsExceptionReport
request
- the GetObservationById requestresponse
- the GetObservationById responseOwsExceptionReport
- If the transformation failsprivate AbstractServiceResponse modifyGetCapabilitiesResponse(GetCapabilitiesRequest request, GetCapabilitiesResponse response) throws OwsExceptionReport
request
- the GetCapabilities requestresponse
- the GetCapabilities responseOwsExceptionReport
- If an error occursprivate AbstractServiceResponse modifyDescribeSensorResponse(DescribeSensorRequest request, DescribeSensorResponse response) throws NumberFormatException, OwsExceptionReport
request
- the DescribeSensor requestresponse
- the DescribeSensor responseOwsExceptionReport
- If the transformation failsNumberFormatException
private void checkAbstractSensorML(AbstractSensorML abstractSensorML, int targetCrs) throws OwsExceptionReport
AbstractSensorML
if modifications are requiredabstractSensorML
- AbstractSensorML
to checktargetCrs
- Target EPSG code Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void checkAbstractProcess(AbstractSensorML abstractSensorML, int targetCrs) throws OwsExceptionReport
AbstractProcess
if modifications are requiredabstractProcess
- AbstractProcess
to checktargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void transformPosition(SmlPosition position, int targetCrs) throws OwsExceptionReport
SmlPosition
if modifications are requiredposition
- SmlPosition
to checktargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate List<SweCoordinate<?>> transformSweCoordinates(List<SweCoordinate<?>> position, int sourceCrs, int targetCrs) throws OwsExceptionReport
position
- SweCoordinate
s to transformsourceCrs
- Source CRStargetCrs
- Target CRSSweCoordinate
sOwsExceptionReport
- if an error occursprivate void transformLocation(SmlLocation location, int targetCrs) throws OwsExceptionReport
SmlLocation
if modifications are requiredlocation
- SmlLocation
to checktargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void checkCapabilitiesForObservedAreaAndTransform(AbstractSensorML abstractSensorML, int targetCrs) throws OwsExceptionReport
AbstractSensorML
contains SmlCapabilities
with observed areaabstractSensorML
- AbstractSensorML
to checktargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void checkRequestIfCrsIsSetAndSupported(AbstractServiceRequest<?> request) throws OwsExceptionReport
request
- Request to checkOwsExceptionReport
- If an error occurs or the requested RS is not supportedprivate int getCrsFrom(AbstractServiceRequest<?> request) throws OwsExceptionReport
EpsgConstants.NOT_SET_EPSG
.request
- the request to checkEpsgConstants.NOT_SET_EPSG
OwsExceptionReport
- If an error occurs when parsing the requestprivate int getRequestedCrs(AbstractServiceRequest<?> request) throws OwsExceptionReport
request
- the request to get CRS fromOwsExceptionReport
private int getCrs(Object value) throws OwsExceptionReport
value
- EPSG codeOwsExceptionReport
- If an error occursprivate int getCrsFromString(String crs) throws OwsExceptionReport
crs
- String EPSG codeOwsExceptionReport
- If an error occurs when parsingprivate void preProcessSpatialFilters(List<SpatialFilter> spatialFilters) throws OwsExceptionReport
spatialFilters
- Spatial filters to checkOwsExceptionReport
- If the transformation failsprivate void preProcessSpatialFilter(SpatialFilter spatialFilter) throws OwsExceptionReport
spatialFilter
- Spatial filter to checkOwsExceptionReport
- If the transformation failsprivate void checkRequestedObservations(List<OmObservation> observations) throws OwsExceptionReport
OmObservation
s and
transform to storage EPSG code if necessaryobservations
- Requested OmObservation
sOwsExceptionReport
- If the transformation failsprivate void checkResponseObservations(List<OmObservation> observations, int targetCRS) throws OwsExceptionReport
OmObservation
s and transform
to requested or default response EPSG code if necessaryobservations
- Response OmObservation
stargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void checkRequestedGeometryOfSamplingFeature(SamplingFeature samplingFeature) throws OwsExceptionReport
SamplingFeature
geometry to storage EPSG
code if necessarysamplingFeature
- the SamplingFeature
OwsExceptionReport
- If the transformation failsprivate void checkResponseGeometryOfSamplingFeature(SamplingFeature samplingFeature, int targetCRS) throws OwsExceptionReport
SamplingFeature
geometry to requested or
default response EPSG code if necessarysamplingFeature
- the SamplingFeature
targetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void processAbstractFeature(AbstractFeature feature, int targetCRS) throws OwsExceptionReport
AbstractFeature
s and
transform to requested or default response EPSG code if necessaryfeature
- the response AbstractFeature
stargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate void checkOmParameterForGeometry(Collection<NamedValue<?>> parameters, int targetCRS) throws OwsExceptionReport
parameters
- O&M parameter to checktargetCrs
- Target EPSG codeOwsExceptionReport
- If the transformation failsprivate GeometryHandler getGeomtryHandler()
private ServiceConfiguration getConfiguration()
public RequestResponseModifierFacilitator getFacilitator()
getFacilitator
in interface RequestResponseModifier<AbstractServiceRequest<?>,AbstractServiceResponse>
Copyright © 2012-2015 52north.org. All Rights Reserved.