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 ofDiscreteFeaturewhich thisPointDatasetreads natively (i.e. the same type ofDiscreteFeaturewhich is returned by theDiscreteFeatureReaderassociated with thisPointDataset).
- All Implemented Interfaces:
Serializable,ContinuousDomainDataset,Dataset
public abstract class PointDataset<F extends DiscreteFeature<?,?>> extends AbstractContinuousDomainDataset
AnAbstractContinuousDomainDatasetwhose map features arePointFeatures. 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 PointFeatureconvertFeature(F feature, BoundingBox hExtent, Extent<Double> zExtent, Extent<org.joda.time.DateTime> tExtent, Double targetZ, org.joda.time.DateTime targetT)Convert aDiscreteFeatureof type F to aPointFeaturestatic PointFeatureconvertPointSeriesFeature(PointSeriesFeature feature, org.joda.time.DateTime targetT)Convenience method to convert aPointSeriesFeatureto aPointFeature.static PointFeatureconvertProfileFeature(ProfileFeature feature, Double targetZ)Convenience method to convert aProfileFeatureto 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 BoundingBoxgetDatasetBoundingBox()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:AbstractContinuousDomainDatasetExtracts features to be plotted on a map.- Specified by:
extractMapFeaturesin interfaceContinuousDomainDataset- Overrides:
extractMapFeaturesin classAbstractContinuousDomainDataset- Parameters:
varIds- The IDs of the variables to be extracted. If this isnullthen all variable IDs will be plotted. Any non-scalar parent variables will have all of their child variables extracted.hExtent- TheBoundingBoxdescribing 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
CollectionofDiscreteFeatures 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
Features returned when calling the extractMapFeatures method for the given variable ID
-
getDatasetBoundingBox
protected BoundingBox getDatasetBoundingBox()
- Specified by:
getDatasetBoundingBoxin classAbstractContinuousDomainDataset- Returns:
- The
BoundingBoxof the entire dataset
-
getDatasetVerticalExtent
protected Extent<Double> getDatasetVerticalExtent()
- Specified by:
getDatasetVerticalExtentin classAbstractContinuousDomainDataset- Returns:
- The
Extentof the vertical domain for the entire dataset
-
getDatasetTimeExtent
protected Extent<org.joda.time.DateTime> getDatasetTimeExtent()
- Specified by:
getDatasetTimeExtentin classAbstractContinuousDomainDataset- Returns:
- The
Extentof the time domain for the entire dataset
-
getFeatureReader
public abstract DiscreteFeatureReader<F> getFeatureReader()
- Specified by:
getFeatureReaderin 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 aDiscreteFeatureof type F to aPointFeature- Parameters:
feature- The feature to converthExtent- TheBoundingBoxcontaining the featurezExtent- The verticalExtentcontaining the featuretExtent- The timeExtentcontaining 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
PointFeatureready for plotting, ornullif the supplied parameters specify a location where noPointFeatureis present.
-
convertProfileFeature
public static PointFeature convertProfileFeature(ProfileFeature feature, Double targetZ)
Convenience method to convert aProfileFeatureto aPointFeature. Can be used by classes which only handleProfileFeatures to implementconvertFeature(DiscreteFeature, BoundingBox, Extent, Extent, Double, DateTime)- Parameters:
feature- TheProfileFeatureto convert.targetZ- The target elevation to extract aPointFeatureat- Returns:
- A
PointFeatureready for plotting, ornullif the supplied elevation specifies a location where noPointFeatureis present.
-
convertPointSeriesFeature
public static PointFeature convertPointSeriesFeature(PointSeriesFeature feature, org.joda.time.DateTime targetT)
Convenience method to convert aPointSeriesFeatureto aPointFeature. Can be used by classes which only handlePointSeriesFeatures to implementconvertFeature(DiscreteFeature, BoundingBox, Extent, Extent, Double, DateTime)- Parameters:
feature- ThePointSeriesFeatureto convert.targetT- The targetDateTimeto extract aPointFeatureat- Returns:
- A
PointFeatureready for plotting, ornullif the suppliedDateTimespecifies a time at which noPointFeatureis present.
-
-