Package uk.ac.rdg.resc.edal.dataset
Class AbstractContinuousDomainDataset
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.AbstractDataset
-
- uk.ac.rdg.resc.edal.dataset.AbstractContinuousDomainDataset
-
- All Implemented Interfaces:
Serializable
,ContinuousDomainDataset
,Dataset
- Direct Known Subclasses:
PointDataset
,TrajectoryDataset
public abstract class AbstractContinuousDomainDataset extends AbstractDataset implements ContinuousDomainDataset
Partial implementation of aDataset
with a continuous domain which performs spatial indexing of features.- Author:
- Guy Griffiths
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FeatureIndexer
featureIndexer
-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.AbstractDataset
id, plugins, vars
-
-
Constructor Summary
Constructors Constructor Description AbstractContinuousDomainDataset(String id, Collection<? extends VariableMetadata> vars, FeatureIndexer featureIndexer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<? extends DiscreteFeature<?,?>>
extractMapFeatures(Set<String> varIds, BoundingBox hExtent, Extent<Double> zExtent, Double targetZ, Extent<org.joda.time.DateTime> tExtent, org.joda.time.DateTime targetT)
Extracts features to be plotted on a map.List<? extends ProfileFeature>
extractProfileFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, org.joda.time.DateTime targetTime)
ExtractsProfileFeature
(s) from theDataset
List<? extends PointSeriesFeature>
extractTimeseriesFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, Double targetZ)
ExtractsPointSeriesFeature
(s) from theDataset
protected abstract BoundingBox
getDatasetBoundingBox()
protected abstract Extent<org.joda.time.DateTime>
getDatasetTimeExtent()
protected abstract Extent<Double>
getDatasetVerticalExtent()
Set<String>
getFeatureIds()
abstract DiscreteFeatureReader<? extends DiscreteFeature<?,?>>
getFeatureReader()
DiscreteFeature<?,?>
readFeature(String featureId)
Reads an entire feature from underlying storage-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.AbstractDataset
addVariablePlugin, getId, getTopLevelVariables, getVariableIds, getVariableMetadata, isDerivedVariable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.ac.rdg.resc.edal.dataset.Dataset
getFeatureType, getMapFeatureType, supportsProfileFeatureExtraction, supportsTimeseriesExtraction
-
-
-
-
Field Detail
-
featureIndexer
protected FeatureIndexer featureIndexer
-
-
Constructor Detail
-
AbstractContinuousDomainDataset
public AbstractContinuousDomainDataset(String id, Collection<? extends VariableMetadata> vars, FeatureIndexer featureIndexer)
-
-
Method Detail
-
readFeature
public DiscreteFeature<?,?> readFeature(String featureId) throws DataReadingException
Description copied from interface:Dataset
Reads an entire feature from underlying storage- Specified by:
readFeature
in interfaceDataset
- Parameters:
featureId
- The ID of the feature to read- Returns:
- The resulting
Feature
- Throws:
DataReadingException
-
getFeatureIds
public Set<String> getFeatureIds()
- Specified by:
getFeatureIds
in interfaceDataset
- Returns:
- the IDs of features which are present in this Dataset
-
extractMapFeatures
public List<? extends DiscreteFeature<?,?>> extractMapFeatures(Set<String> varIds, BoundingBox hExtent, Extent<Double> zExtent, Double targetZ, Extent<org.joda.time.DateTime> tExtent, org.joda.time.DateTime targetT) throws DataReadingException
Extracts features to be plotted on a map.- Specified by:
extractMapFeatures
in interfaceContinuousDomainDataset
- Parameters:
varIds
- The IDs of the variables to be extracted. If this isnull
then all variable IDs will be plotted. Any non-scalar parent variables will have all of their child variables extracted.hExtent
- TheBoundingBox
describing the horizontal domain from which to extract featureszExtent
- The vertical extent from which to extract featurestExtent
- The time range from which to extract features- Returns:
- A
Collection
ofDiscreteFeature
s which can be plotted - Throws:
DataReadingException
- If there is a problem reading the underlying dataVariableNotFoundException
-
extractProfileFeatures
public List<? extends ProfileFeature> extractProfileFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, org.joda.time.DateTime targetTime) throws DataReadingException, UnsupportedOperationException, VariableNotFoundException
Description copied from interface:Dataset
ExtractsProfileFeature
(s) from theDataset
- Specified by:
extractProfileFeatures
in interfaceDataset
- Parameters:
varIds
- The variable IDs to extract. If this isnull
then all variable IDs will be plotted. Any non-scalar parent variables will have all of their child variables extracted.bbox
-- If this
BoundingBox
is non-null
, all measurements falling within it will be returned. - If it is
null
, only measurements which match the horizontal position given bytargetPos
will be extracted. - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point.
- If this
zExtent
-- If this is non-
null
, allProfileFeature
s whose domains have any intersection with this vertical extent will be extracted. The domains of the extractedProfileFeature
s will be the entire available domains, not just the intersection. - If this is
null
, no constraint will be placed on the vertical domain of theProfileFeature
s to extract.
- If this is non-
tExtent
-- If this is non-
null
, all measurements which fall entirely within its extent will be extracted - If it is
null
only profiles matching the time specified bytargetT
will be extracted. - If
tExtent
andtargetT
are bothnull
,ProfileFeature
s for all available time values will be extracted.
- If this is non-
targetPos
-- If the
bbox
argument isnull
, only measurements which match this horizontal position will be extracted. In the case of a gridded feature, this will be the profile of the grid cell which the position falls into, but for a dataset with a continuousHorizontalDomain
only exact matches will be extracted - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point. - If this is non-
null
, the resultingCollection
will be sorted according to distance (in co-ordinate units) from the target position
- If the
targetTime
-- If
tExtent
isnull
only profiles matching the time specified by this parameter will be extracted. In the case of a gridded dataset a time is considered to match if the methodTimeAxis#contains(DateTime)
on its time axis returnstrue
for the target time. For a non-gridded dataset, the feature time must exactly match the target time. - If
tExtent
andtargetT
are bothnull
,ProfileFeature
s for all available time values will be extracted.
- If
- Returns:
- A
Collection
ofProfileFeature
s, sorted by their distance from the target horizontal position, if it exists. - Throws:
DataReadingException
- if there is a problem reading the underlying dataUnsupportedOperationException
- if not all of the requested variables have a vertical domainVariableNotFoundException
- if one or more of the specified variables are not present in this dataset
-
extractTimeseriesFeatures
public List<? extends PointSeriesFeature> extractTimeseriesFeatures(Set<String> varIds, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, HorizontalPosition targetPos, Double targetZ) throws DataReadingException, UnsupportedOperationException, VariableNotFoundException
Description copied from interface:Dataset
ExtractsPointSeriesFeature
(s) from theDataset
- Specified by:
extractTimeseriesFeatures
in interfaceDataset
- Parameters:
varIds
- The variable IDs to extract. If this isnull
then all variable IDs will be plotted. Any non-scalar parent variables will have all of their child variables extracted.bbox
-- If this
BoundingBox
is non-null
, all measurements falling within it will be returned. - If it is
null
, only measurements which match the horizontal position given bytargetPos
will be extracted. - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point.
- If this
zExtent
-- If this is non-
null
, all measurements which fall entirely within its extent will be extracted - If it is
null
only timeseries matching the depth specified bytargetZ
will be extracted. - If
zExtent
andtargetZ
are bothnull
,PointSeriesFeature
s for all available depth values will be extracted.
- If this is non-
tExtent
-- If this is non-
null
, allPointSeriesFeature
s whose domains have any intersection with this time extent will be extracted. The domains of the extractedPointSeriesFeature
s will be the entire available domains, not just the intersection. - If this is
null
, no constraint will be placed on the time domain of thePointSeriesFeature
s to extract.
- If this is non-
targetPos
-- If the
bbox
argument isnull
, only measurements which match this horizontal position will be extracted. In the case of a gridded feature, this will be the profile of the grid cell which the position falls into, but for a dataset with a continuousHorizontalDomain
only exact matches will be extracted - If both
bbox
andtargetPos
arenull
no constraint is placed on horizontal positions - e.g. for a gridded field a profile will be returned for every horizontal grid point. - If this is non-
null
, the resultingCollection
will be sorted according to distance (in co-ordinate units) from the target position
- If the
targetZ
-- If
zExtent
isnull
only timeseries matching the depth specified by this parameter will be extracted. In the case of a gridded dataset a depth is considered to match if the methodVerticalAxis#contains(Double)
on its vertical axis returnstrue
for the target depth. For a non-gridded dataset, the feature depth must exactly match the target depth. - If
zExtent
andtargetZ
are bothnull
,PointSeriesFeature
s for all available time values will be extracted.
- If
- Returns:
- A
Collection
ofPointSeriesFeature
s, sorted by their distance from the target horizontal position, if it exists. - Throws:
DataReadingException
- if there is a problem reading the underlying dataUnsupportedOperationException
- if not all of the requested variables have a time domainVariableNotFoundException
- if one or more of the specified variables are not present in this dataset
-
getDatasetBoundingBox
protected abstract BoundingBox getDatasetBoundingBox()
- Returns:
- The
BoundingBox
of the entire dataset
-
getDatasetVerticalExtent
protected abstract Extent<Double> getDatasetVerticalExtent()
- Returns:
- The
Extent
of the vertical domain for the entire dataset
-
getDatasetTimeExtent
protected abstract Extent<org.joda.time.DateTime> getDatasetTimeExtent()
- Returns:
- The
Extent
of the time domain for the entire dataset
-
getFeatureReader
public abstract DiscreteFeatureReader<? extends DiscreteFeature<?,?>> getFeatureReader()
-
-