org.intamap
Class InterpolateRequest

java.lang.Object
  extended by org.intamap.InterpolateRequest

public class InterpolateRequest
extends Object

Models a request sent to the INTAMAP interpolation service. It is possible to request either statistic predictions or realisations, the latter of which will only be requested if requestRealisations() returns true.

Author:
Richard Jones

Constructor Summary
InterpolateRequest(ObservationCollection observationCollection)
          Creates a new interpolate request with the given observation collection.
InterpolateRequest(String sosURL, String sosRequest)
          Creates a new interpolate request with the given SOS details from which the obervations to interpolate will be retrieved.
 
Method Summary
 void addStatisticToPredict(String type)
          Adds a statistic to predict.
 void addStatisticToPredict(String type, double value)
          Adds a statistic to predict.
 void clearStatisticsToPredict()
          Clears the list of statistics to predict.
 boolean getBiasCorrection()
          Returns whether bias correction will be applied to the observations.
 com.vividsolutions.jts.geom.Geometry getDomain()
          Returns the prediction domain.
 int getMaximumTime()
          Returns the maximum time for execution.
 String getMethodName()
          Returns the name of the interpolation method to execute.
 Map<String,String> getMethodParameters()
          Returns the method parameters.
 int getNumberOfPredictions()
          Returns the number of prediction locations.
 int getNumberOfRealisations()
          Returns the number of realisations to generate at each location.
 ObservationCollection getObservationCollection()
          Returns the observation collection to be interpolated.
 boolean getOutlierDetection()
          Returns whether basic outlier detection will be performed on the data.
 String getSosRequest()
          Returns the POST payload for a SOS request to be sent to the URL given by getSosURL().
 String getSosURL()
          Returns the URL pointing towards a Sensor Observation Service to which the request given by getSosRequest() will be sent.
 List<org.uncertml.statistics.Statistic> getStatisticsToPredict()
          Returns the list of statistics to predict.
 boolean getTucAnisotropy()
          Returns whether the TUC method for anisotropy detection will be used.
 boolean requestRealisations()
          Returns if realisations will be generated in this request.
 void requestRealisations(boolean requestRealisations)
          Sets whether realisations will be generated in this request.
 void setBiasCorrection(boolean biasCorrection)
          Sets whether bias correction will be applied to the observations.
 void setDomain(com.vividsolutions.jts.geom.Geometry domain)
          Sets the prediction domain.
 void setMaximumTime(int maximumTime)
          Sets the maximum time for execution.
 void setMethodName(String methodName)
          Sets the name of the interpolation method you wish to execute.
 void setNumberOfPredictions(int numberOfPredictions)
          Sets the number of prediction locations.
 void setNumberOfRealisations(int numberOfRealisations)
          Sets the number of realisations to generate at each location.
 void setObservationCollection(ObservationCollection observationCollection)
          Sets the observation collection to be interpolated.
 void setOutlierDetection(boolean outlierDetection)
          Sets whether basic outlier detection will be performed on the data.
 void setSos(String sosURL, String sosRequest)
          Sets the SOS details from which the obervations to interpolate will be retrieved.
 void setTucAnisotropy(boolean tucAnisotropy)
          Sets whether the TUC method for anisotropy detection will be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterpolateRequest

public InterpolateRequest(ObservationCollection observationCollection)
Creates a new interpolate request with the given observation collection.

Parameters:
observationCollection - the observation collection

InterpolateRequest

public InterpolateRequest(String sosURL,
                          String sosRequest)
Creates a new interpolate request with the given SOS details from which the obervations to interpolate will be retrieved.

Parameters:
sosURL - an URL pointing towards a fully functioning Sensor Observation Service
sosRequest - the POST payload for a SOS request
See Also:
setSos(String, String)
Method Detail

getBiasCorrection

public boolean getBiasCorrection()
Returns whether bias correction will be applied to the observations.

Returns:
true if bias correction be applied, false otherwise
See Also:
setBiasCorrection(boolean)

getDomain

public com.vividsolutions.jts.geom.Geometry getDomain()
Returns the prediction domain.

Returns:
the prediction domain
See Also:
setDomain(Geometry)

getMaximumTime

public int getMaximumTime()
Returns the maximum time for execution.

Returns:
the maximum time for execution (in seconds)
See Also:
setMaximumTime(int)

getMethodName

public String getMethodName()
Returns the name of the interpolation method to execute.

Returns:
the interpolation method name
See Also:
setMethodName(String)

getMethodParameters

public Map<String,String> getMethodParameters()
Returns the method parameters. This is a collection of key/value pairs of method parameters that are used by the interpolation algorithms. To add or remove parameters, simply make the necessary changes to the value returned by this method.

Returns:
the method parameters

getNumberOfPredictions

public int getNumberOfPredictions()
Returns the number of prediction locations.

Returns:
the number of prediction locations
See Also:
setNumberOfPredictions(int)

getNumberOfRealisations

public int getNumberOfRealisations()
Returns the number of realisations to generate at each location. This is only used in a request if requestRealisations() is true.

Returns:
the number of realisations
See Also:
setNumberOfRealisations(int)

getObservationCollection

public ObservationCollection getObservationCollection()
Returns the observation collection to be interpolated.

Returns:
the observation collection

getOutlierDetection

public boolean getOutlierDetection()
Returns whether basic outlier detection will be performed on the data. Default is false.

Returns:
true if basic outlier detection will be performed on the data, false otherwise
See Also:
setOutlierDetection(boolean)

getSosRequest

public String getSosRequest()
Returns the POST payload for a SOS request to be sent to the URL given by getSosURL().

Returns:
the POST payload for a SOS request
See Also:
setSos(String, String)

getSosURL

public String getSosURL()
Returns the URL pointing towards a Sensor Observation Service to which the request given by getSosRequest() will be sent.

Returns:
the URL pointing towards a Sensor Observation Service

getStatisticsToPredict

public List<org.uncertml.statistics.Statistic> getStatisticsToPredict()
Returns the list of statistics to predict. Adding objects to this list allows you to specify the exact type of predictions you wish to be made. This is only used in a request if requestRealisations() is false (default).
If this list is empty INTAMAP will decide what predictions are made.

Returns:
the list of prediction statistics

addStatisticToPredict

public void addStatisticToPredict(String type)
Adds a statistic to predict. Valid types for this method are "Mean" and "Variance". Statistics which require a parameter value can be added using addStatisticToPredict(String, double).
If you require further control over the statistics to predict and are familiar with UncertML, Statistic objects can be explicitly added to the request using getStatisticsToPredict().

Parameters:
type - the type of statistic
Throws:
InvalidParameterException - if the given type is invalid

addStatisticToPredict

public void addStatisticToPredict(String type,
                                  double value)
Adds a statistic to predict. Valid types for this method are "ProbabilityGreaterThan" and "Quantile". Statistics which require no parameter value can be added using addStatisticToPredict(String).
If you require further control over the statistics to predict and are familiar with UncertML, Statistic objects can be explicitly added to the request using getStatisticsToPredict().

Parameters:
type - the type of statistic
value - the value
Throws:
InvalidParameterException - if the given type is invalid

clearStatisticsToPredict

public void clearStatisticsToPredict()
Clears the list of statistics to predict.


getTucAnisotropy

public boolean getTucAnisotropy()
Returns whether the TUC method for anisotropy detection will be used.

Returns:
true if the TUC method for anisotropy detection will be used, false otherwise

requestRealisations

public boolean requestRealisations()
Returns if realisations will be generated in this request. If not, statistics will be predicted instead.

Returns:
true if realisations will be generated, false if not
See Also:
requestRealisations(boolean)

requestRealisations

public void requestRealisations(boolean requestRealisations)
Sets whether realisations will be generated in this request.

Parameters:
requestRealisations - whether realisations will be generated

setBiasCorrection

public void setBiasCorrection(boolean biasCorrection)
Sets whether bias correction will be applied to the observations. Bias correction processing is applied to observations before predicting.
Default is false.

Parameters:
biasCorrection - whether bias correction will be applied

setDomain

public void setDomain(com.vividsolutions.jts.geom.Geometry domain)
Sets the prediction domain. The prediction domain specifies the locations at where you wish the algorithm to predict, it can be a Point, Polygon, MultiPoint, MultiPolygon or RectifiedGrid.
null by default (i.e. let the service generate a domain).

Parameters:
domain - the prediction domain

setMaximumTime

public void setMaximumTime(int maximumTime)
Sets the maximum time for execution. You can specify the maximum amount of time you are willing to allow for prediction. If the method is not able to complete within the required time an exception is raised.
Default is -1 (i.e. infinite).

Parameters:
maximumTime - the maximum time for execution (in seconds)

setMethodName

public void setMethodName(String methodName)
Sets the name of the interpolation method you wish to execute.
Default is "automatic". "automap", "copula", and "psgp" are also valid.

Parameters:
methodName - the interpolation method name

setNumberOfPredictions

public void setNumberOfPredictions(int numberOfPredictions)
Sets the number of prediction locations. When supplying polygons as a domain you can specify the number of desired prediction locations as represented using this parameter.
Default is -1 which will let the interpolation service decide (currently 10000).

Parameters:
numberOfPredictions - the number of prediction locations

setNumberOfRealisations

public void setNumberOfRealisations(int numberOfRealisations)
Sets the number of realisations to generate at each location. This is only used in a request if requestRealisations() is true.
Default is 25.

Parameters:
numberOfRealisations - the number of realisations

setObservationCollection

public void setObservationCollection(ObservationCollection observationCollection)
Sets the observation collection to be interpolated.

Parameters:
observationCollection - the observation collection

setOutlierDetection

public void setOutlierDetection(boolean outlierDetection)
Sets whether basic outlier detection will be performed on the data.
Default is false.

Parameters:
outlierDetection - whether basic outlier detection will be performed

setSos

public void setSos(String sosURL,
                   String sosRequest)
Sets the SOS details from which the obervations to interpolate will be retrieved. The result of the request once sent to the URL should be an ObservationCollection containing Measurement elements. Support is only provided for the Observations and Measurements 'Measurement' type as a result from a SOS request.
Default for both parameters is null (i.e. do not retrieve observations from an SOS).

Parameters:
sosURL - an URL pointing towards a fully functioning Sensor Observation Service
sosRequest - the POST payload for a SOS request

setTucAnisotropy

public void setTucAnisotropy(boolean tucAnisotropy)
Sets whether the TUC method for anisotropy detection will be used. Default is true.

Parameters:
tucAnisotropy - whether the TUC method for anisotropy detection will be used