Package uk.ac.rdg.resc.edal.dataset
Class PointDataset<F extends DiscreteFeature<?,?>>
- java.lang.Object
-
- uk.ac.rdg.resc.edal.dataset.AbstractDataset
-
- uk.ac.rdg.resc.edal.dataset.AbstractContinuousDomainDataset
-
- uk.ac.rdg.resc.edal.dataset.PointDataset<F>
-
- Type Parameters:
F
- The type ofDiscreteFeature
which thisPointDataset
reads natively (i.e. the same type ofDiscreteFeature
which is returned by theDiscreteFeatureReader
associated with thisPointDataset
).
- All Implemented Interfaces:
Serializable
,ContinuousDomainDataset
,Dataset
public abstract class PointDataset<F extends DiscreteFeature<?,?>> extends AbstractContinuousDomainDataset
AnAbstractContinuousDomainDataset
whose map features arePointFeature
s. Subclasses must provide a method to convert from their underlying feature type to aPointFeature
, given a set of parameters.- Author:
- Guy Griffiths
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.AbstractContinuousDomainDataset
featureIndexer
-
Fields inherited from class uk.ac.rdg.resc.edal.dataset.AbstractDataset
id, plugins, vars
-
-
Constructor Summary
Constructors Constructor Description PointDataset(String id, Collection<? extends VariableMetadata> vars, FeatureIndexer featureIndexer)
PointDataset(String id, Collection<? extends VariableMetadata> vars, FeatureIndexer featureIndexer, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract PointFeature
convertFeature(F feature, BoundingBox hExtent, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, Double targetZ, org.joda.time.DateTime targetT)
Convert aDiscreteFeature
of type F to aPointFeature
static PointFeature
convertPointSeriesFeature(PointSeriesFeature feature, org.joda.time.DateTime targetT)
Convenience method to convert aPointSeriesFeature
to aPointFeature
.static PointFeature
convertProfileFeature(ProfileFeature feature, Double targetZ)
Convenience method to convert aProfileFeature
to aPointFeature
.List<PointFeature>
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.protected BoundingBox
getDatasetBoundingBox()
protected Extent<org.joda.time.DateTime>
getDatasetTimeExtent()
protected Extent<Double>
getDatasetVerticalExtent()
abstract DiscreteFeatureReader<F>
getFeatureReader()
Class<PointFeature>
getMapFeatureType(String variableId)
Determines the type of feature returned by the extractMapFeatures() methods (defined in subclasses) for a particular variable-
Methods inherited from class uk.ac.rdg.resc.edal.dataset.AbstractContinuousDomainDataset
extractProfileFeatures, extractTimeseriesFeatures, getFeatureIds, readFeature
-
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, supportsProfileFeatureExtraction, supportsTimeseriesExtraction
-
-
-
-
Constructor Detail
-
PointDataset
public PointDataset(String id, Collection<? extends VariableMetadata> vars, FeatureIndexer featureIndexer, BoundingBox bbox, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent)
-
PointDataset
public PointDataset(String id, Collection<? extends VariableMetadata> vars, FeatureIndexer featureIndexer)
-
-
Method Detail
-
extractMapFeatures
public List<PointFeature> extractMapFeatures(Set<String> varIds, BoundingBox hExtent, Extent<Double> zExtent, Double targetZ, Extent<org.joda.time.DateTime> tExtent, org.joda.time.DateTime targetT) throws DataReadingException
Description copied from class:AbstractContinuousDomainDataset
Extracts features to be plotted on a map.- Specified by:
extractMapFeatures
in interfaceContinuousDomainDataset
- Overrides:
extractMapFeatures
in classAbstractContinuousDomainDataset
- 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 data
-
getMapFeatureType
public final Class<PointFeature> getMapFeatureType(String variableId)
Determines the type of feature returned by the extractMapFeatures() methods (defined in subclasses) for a particular variableAlways returns a PointFeature - this is the point of this class. For mixed feature types, extend directly from AbstractContinuousDomainDataset.
- Parameters:
variableId
- The ID of the variable- Returns:
- The class of the
Feature
s returned when calling the extractMapFeatures method for the given variable ID
-
getDatasetBoundingBox
protected BoundingBox getDatasetBoundingBox()
- Specified by:
getDatasetBoundingBox
in classAbstractContinuousDomainDataset
- Returns:
- The
BoundingBox
of the entire dataset
-
getDatasetVerticalExtent
protected Extent<Double> getDatasetVerticalExtent()
- Specified by:
getDatasetVerticalExtent
in classAbstractContinuousDomainDataset
- Returns:
- The
Extent
of the vertical domain for the entire dataset
-
getDatasetTimeExtent
protected Extent<org.joda.time.DateTime> getDatasetTimeExtent()
- Specified by:
getDatasetTimeExtent
in classAbstractContinuousDomainDataset
- Returns:
- The
Extent
of the time domain for the entire dataset
-
getFeatureReader
public abstract DiscreteFeatureReader<F> getFeatureReader()
- Specified by:
getFeatureReader
in classAbstractContinuousDomainDataset
-
convertFeature
protected abstract PointFeature convertFeature(F feature, BoundingBox hExtent, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, Double targetZ, org.joda.time.DateTime targetT)
Convert aDiscreteFeature
of type F to aPointFeature
- Parameters:
feature
- The feature to converthExtent
- TheBoundingBox
containing the featurezExtent
- The verticalExtent
containing the featuretExtent
- The timeExtent
containing the featuretargetZ
- The target depth if multiple features are present in the vertical extenttargetT
- The target time if multiple features are present in the time extent- Returns:
- A
PointFeature
ready for plotting, ornull
if the supplied parameters specify a location where noPointFeature
is present.
-
convertProfileFeature
public static PointFeature convertProfileFeature(ProfileFeature feature, Double targetZ)
Convenience method to convert aProfileFeature
to aPointFeature
. Can be used by classes which only handleProfileFeature
s to implementconvertFeature(DiscreteFeature, BoundingBox, Extent, Extent, Double, DateTime)
- Parameters:
feature
- TheProfileFeature
to convert.targetZ
- The target elevation to extract aPointFeature
at- Returns:
- A
PointFeature
ready for plotting, ornull
if the supplied elevation specifies a location where noPointFeature
is present.
-
convertPointSeriesFeature
public static PointFeature convertPointSeriesFeature(PointSeriesFeature feature, org.joda.time.DateTime targetT)
Convenience method to convert aPointSeriesFeature
to aPointFeature
. Can be used by classes which only handlePointSeriesFeature
s to implementconvertFeature(DiscreteFeature, BoundingBox, Extent, Extent, Double, DateTime)
- Parameters:
feature
- ThePointSeriesFeature
to convert.targetT
- The targetDateTime
to extract aPointFeature
at- Returns:
- A
PointFeature
ready for plotting, ornull
if the suppliedDateTime
specifies a time at which noPointFeature
is present.
-
-