public class NetCDFReader extends AbstractGridCoverage2DReader implements StructuredGridCoverage2DReader
closeMe, coverageFactory, coverageName, crs, dtLayout, EPS, gzipped, highestRes, hints, inStream, inStreamSPI, numOverviews, originalEnvelope, originalGridRange, overViewResolutions, raster2Model, source
ELEVATION_DOMAIN, ELEVATION_DOMAIN_MAXIMUM, ELEVATION_DOMAIN_MINIMUM, ELEVATION_DOMAIN_RESOLUTION, FILE_SOURCE_PROPERTY, HAS_ELEVATION_DOMAIN, HAS_TIME_DOMAIN, MULTICRS_READER, REPROJECTING_READER, SOURCE_URL_PROPERTY, TIME_DOMAIN, TIME_DOMAIN_MAXIMUM, TIME_DOMAIN_MINIMUM, TIME_DOMAIN_RESOLUTION
Constructor and Description |
---|
NetCDFReader(Object input,
Hints uHints) |
Modifier and Type | Method and Description |
---|---|
void |
createCoverage(String coverageName,
SimpleFeatureType schema)
Creates a granule store for a new coverage with the given feature type
|
void |
delete(boolean deleteData)
delete all stuff (database content, indexer files, property files, associated auxiliary files
and so on).
|
void |
dispose()
Disposes this reader.
|
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
CoordinateReferenceSystem |
getCoordinateReferenceSystem(String coverageName)
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
List<DimensionDescriptor> |
getDimensionDescriptors(String coverageName)
Describes the dimensions supported by the specified coverage, if any.
|
Set<ParameterDescriptor<List>> |
getDynamicParameters(String coverageName)
Return the set of dynamic parameterDescriptors (the ones related to domains) for this reader.
|
Format |
getFormat()
Returns the format handled by this
GridCoverageReader . |
GranuleSource |
getGranules(String coverageName,
boolean readOnly)
Returns the granule source for the specified coverage (might be null, if there is only one
supported coverage)
|
int |
getGridCoverageCount()
Retrieve the number of coverages contained within the input source.
|
String[] |
getGridCoverageNames()
Retrieve the list of coverages contained within the input source.
|
ImageLayout |
getImageLayout()
Retrieve the
ImageLayout for the default coverage. |
ImageLayout |
getImageLayout(String coverageName)
Retrieve the
ImageLayout for the specified coverage. |
ResourceInfo |
getInfo(String coverageName)
Default implementation returns a FileResourceInfo containing same fileGroup list contained in
the ServiceInfo object.
|
String[] |
getMetadataNames(String coverageName)
Returns the list of metadata keywords associated with a specific gridCoverage referred by
name.
|
String |
getMetadataValue(String coverageName,
String name)
Retrieve the metadata value for a given metadata name for a specified coverage.
|
int |
getNumOverviews()
Number of predetermined overviews for the default coverage.
|
int |
getNumOverviews(String coverageName)
Number of predetermined overviews for the specified coverage.
|
GeneralEnvelope |
getOriginalEnvelope()
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
GeneralEnvelope |
getOriginalEnvelope(String coverageName)
Retrieves the
GeneralEnvelope for this AbstractGridCoverage2DReader . |
GridEnvelope |
getOriginalGridRange()
Retrieves the
GeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset. |
GridEnvelope |
getOriginalGridRange(String coverageName)
Retrieves the
GeneralGridEnvelope that represents the raster grid dimensions of the
highest resolution level in this dataset. |
MathTransform |
getOriginalGridToWorld(PixelInCell pixInCell)
Retrieves the original grid to world transformation for this
AbstractGridCoverage2DReader . |
MathTransform |
getOriginalGridToWorld(String coverageName,
PixelInCell pixInCell)
Retrieves the original grid to world transformation for this
AbstractGridCoverage2DReader . |
double[] |
getReadingResolutions(OverviewPolicy policy,
double[] requestedResolution)
Returns the actual resolution used to read the data given the specified target resolution and
the specified overview policy
|
double[] |
getReadingResolutions(String coverageName,
OverviewPolicy policy,
double[] requestedResolution)
Returns the actual resolution used to read the data given the specified target resolution and
the specified overview policy
|
double[][] |
getResolutionLevels()
Retrieve the resolution levels for the default coverage.
|
double[][] |
getResolutionLevels(String coverageName)
Retrieve the resolution levels for the specified coverage.
|
List<HarvestedSource> |
harvest(String defaultCoverage,
Object source,
Hints hints)
Harvests the specified source into the reader.
|
boolean |
isReadOnly()
Return whether this reader can modify the granule source
|
GridCoverage2D |
read(GeneralParameterValue[] parameters)
Read a GridCoverage2D base on the specified read parameters.
|
GridCoverage2D |
read(String coverageName,
GeneralParameterValue[] parameters)
Retrieves the
GridEnvelope associated to the specified coverageName for this GridCoverage2DReader . |
boolean |
removeCoverage(String coverageName) |
boolean |
removeCoverage(String coverageName,
boolean forceDelete)
removes a granule store for the specified coverageName
|
addAllSiblings, addSiblings, checkName, createImageCoverage, createImageCoverage, createImageCoverage, createImageCoverage, decimationOnReadingControl, finalize, getCrs, getCurrentSubname, getDatasetLayout, getDatasetLayout, getDynamicParameters, getFiles, getGroundControlPoints, getGroundControlPoints, getHighestRes, getInfo, getMetadataNames, getMetadataValue, getMultiLevelROIProvider, getOverviewGridEnvelope, getOverviewGridEnvelope, getRescaledRasterToModel, getResolution, getSibling, getSource, getSourceAsFile, hasMoreGridCoverages, listSubNames, setlayout, setLayout, setReadParams, setReadParams, skip
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDatasetLayout, getDatasetLayout, getDynamicParameters, getInfo
getCurrentSubname, getMetadataNames, getMetadataValue, getSource, hasMoreGridCoverages, listSubNames, skip
public NetCDFReader(Object input, Hints uHints) throws DataSourceException
DataSourceException
public Format getFormat()
GridCoverageReader
GridCoverageReader
.getFormat
in interface GridCoverageReader
public String[] getMetadataNames(String coverageName)
GridCoverageReader
getMetadataNames
in interface GridCoverageReader
getMetadataNames
in class AbstractGridCoverage2DReader
public String getMetadataValue(String coverageName, String name)
GridCoverageReader
getMetadataValue
in interface GridCoverageReader
getMetadataValue
in class AbstractGridCoverage2DReader
name
- Metadata keyword for which to retrieve metadata.GridCoverageReader.getMetadataNames()
.public String[] getGridCoverageNames()
GridCoverageReader
getGridCoverageNames
in interface GridCoverageReader
getGridCoverageNames
in class AbstractGridCoverage2DReader
public Set<ParameterDescriptor<List>> getDynamicParameters(String coverageName) throws IOException
AbstractGridCoverage2DReader
getDynamicParameters
in interface GridCoverage2DReader
getDynamicParameters
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withSet
of dynamic read parameters supported by this GridCoverage2DReader
.IOException
- in case an error occurs while creating the Set
of dynamic
parameters.public int getGridCoverageCount()
GridCoverageReader
getGridCoverageCount
in interface GridCoverageReader
getGridCoverageCount
in class AbstractGridCoverage2DReader
GridCoverageReader.getGridCoverageCount()
public GridCoverage2D read(String coverageName, GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException
GridCoverage2DReader
GridEnvelope
associated to the specified coverageName for this GridCoverage2DReader
.read
in interface GridCoverage2DReader
read
in interface GridCoverageReader
read
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withparameters
- an array of GeneralParameterValue
that uses a subset of the
available read params for this GridCoverage2DReader
as specified by the Format
GridCoverage2D
for the underlying default coverage for this GridCoverage2DReader
or null
in case no GridCoverage2D
can be read
for the provided parameters.IllegalArgumentException
- if the specified coverageName does not existIOException
- if a read operation failed for some other input/output reason, including
FileNotFoundException
if no file with the given name
can be found, or
IIOException
if an error was thrown by the underlying image
library.public GridCoverage2D read(GeneralParameterValue[] parameters) throws IllegalArgumentException, IOException
read
in interface GridCoverage2DReader
read
in interface GridCoverageReader
read
in class AbstractGridCoverage2DReader
parameters
- Optional parameters matching Format.getReadParameters()
.InvalidParameterNameException
- if a parameter in parameters
doesn't have a
recognized name.InvalidParameterValueException
- if a parameter in parameters
doesn't have a
valid value.ParameterNotFoundException
- if a parameter was required for the operation but was not
provided in the parameters
list.IOException
- if a read operation failed for some other input/output reason, including
FileNotFoundException
if no file with the given name
can be found, or
IIOException
if an error was thrown by the underlying image
library.IllegalArgumentException
public void dispose()
AbstractGridCoverage2DReader
This method just tries to close the underlying ImageInputStream
.
dispose
in interface GridCoverageReader
dispose
in class AbstractGridCoverage2DReader
public GeneralEnvelope getOriginalEnvelope()
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getOriginalEnvelope
in interface GridCoverage2DReader
getOriginalEnvelope
in class AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.public GeneralEnvelope getOriginalEnvelope(String coverageName)
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getOriginalEnvelope
in interface GridCoverage2DReader
getOriginalEnvelope
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work on.GeneralEnvelope
for this AbstractGridCoverage2DReader
.public GridEnvelope getOriginalGridRange()
AbstractGridCoverage2DReader
GeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.getOriginalGridRange
in interface GridCoverage2DReader
getOriginalGridRange
in class AbstractGridCoverage2DReader
GeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.public GridEnvelope getOriginalGridRange(String coverageName)
AbstractGridCoverage2DReader
GeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.getOriginalGridRange
in interface GridCoverage2DReader
getOriginalGridRange
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withGeneralGridEnvelope
that represents the raster grid dimensions of the
highest resolution level in this dataset.public double[] getReadingResolutions(OverviewPolicy policy, double[] requestedResolution)
AbstractGridCoverage2DReader
getReadingResolutions
in interface GridCoverage2DReader
getReadingResolutions
in class AbstractGridCoverage2DReader
policy
- the OverviewPolicy
to use during evaluation.requestedResolution
- the requested resolutionpublic double[] getReadingResolutions(String coverageName, OverviewPolicy policy, double[] requestedResolution) throws IOException
AbstractGridCoverage2DReader
getReadingResolutions
in interface GridCoverage2DReader
getReadingResolutions
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work on.policy
- the OverviewPolicy
to use during evaluation.requestedResolution
- the requested resolutionIOException
- in case an error occurs.public int getNumOverviews()
GridCoverage2DReader
getNumOverviews
in interface GridCoverage2DReader
getNumOverviews
in class AbstractGridCoverage2DReader
public int getNumOverviews(String coverageName)
GridCoverage2DReader
getNumOverviews
in interface GridCoverage2DReader
getNumOverviews
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage for which we do want to get the number of
overviews.public double[][] getResolutionLevels() throws IOException
GridCoverage2DReader
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getResolutionLevels
in interface GridCoverage2DReader
getResolutionLevels
in class AbstractGridCoverage2DReader
IOException
public double[][] getResolutionLevels(String coverageName) throws IOException
GridCoverage2DReader
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getResolutionLevels
in interface GridCoverage2DReader
getResolutionLevels
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage for which we want to know the resolution levels.IOException
public ImageLayout getImageLayout() throws IOException
GridCoverage2DReader
ImageLayout
for the default coverage.
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getImageLayout
in interface GridCoverage2DReader
getImageLayout
in class AbstractGridCoverage2DReader
ImageLayout
that is useful for actually knowing the ColorModel
,
the SampleModel
as well as the tile grid for the default coverage.IOException
public ImageLayout getImageLayout(String coverageName) throws IOException
GridCoverage2DReader
ImageLayout
for the specified coverage.
Throw an IllegalArgumentException
in case the name is wrong and/or no such a
coverage exists.
getImageLayout
in interface GridCoverage2DReader
getImageLayout
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage for which we want to know the GridEnvelope
.ImageLayout
that is useful for actually knowing the ColorModel
,
the SampleModel
as well as the tile grid for a certain coverage.IOException
public CoordinateReferenceSystem getCoordinateReferenceSystem()
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getCoordinateReferenceSystem
in interface GridCoverage2DReader
getCoordinateReferenceSystem
in class AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.public CoordinateReferenceSystem getCoordinateReferenceSystem(String coverageName)
AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.getCoordinateReferenceSystem
in interface GridCoverage2DReader
getCoordinateReferenceSystem
in class AbstractGridCoverage2DReader
GeneralEnvelope
for this AbstractGridCoverage2DReader
.public MathTransform getOriginalGridToWorld(PixelInCell pixInCell)
AbstractGridCoverage2DReader
AbstractGridCoverage2DReader
.getOriginalGridToWorld
in interface GridCoverage2DReader
getOriginalGridToWorld
in class AbstractGridCoverage2DReader
pixInCell
- specifies the datum of the transformation we want.AbstractGridCoverage2DReader
.public MathTransform getOriginalGridToWorld(String coverageName, PixelInCell pixInCell)
AbstractGridCoverage2DReader
AbstractGridCoverage2DReader
.getOriginalGridToWorld
in interface GridCoverage2DReader
getOriginalGridToWorld
in class AbstractGridCoverage2DReader
coverageName
- the name of the coverage to work withpixInCell
- specifies the datum of the transformation we want.AbstractGridCoverage2DReader
.public GranuleSource getGranules(String coverageName, boolean readOnly) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
getGranules
in interface StructuredGridCoverage2DReader
coverageName
- the name of the specified coveragereadOnly
- a boolean indicating whether we may want modify the GranuleSourceGranuleSource
IOException
UnsupportedOperationException
public boolean isReadOnly()
StructuredGridCoverage2DReader
isReadOnly
in interface StructuredGridCoverage2DReader
public void createCoverage(String coverageName, SimpleFeatureType schema) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
createCoverage
in interface StructuredGridCoverage2DReader
IOException
UnsupportedOperationException
public List<HarvestedSource> harvest(String defaultCoverage, Object source, Hints hints) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
harvest
in interface StructuredGridCoverage2DReader
source
- The source can be any kind of object, it's up to the reader implementation to
understand and use it. Commons source types could be a single file, or a folder.hints
- Used to provide implementation specific hints on how to harvest the sourcesIOException
UnsupportedOperationException
public List<DimensionDescriptor> getDimensionDescriptors(String coverageName) throws IOException
StructuredGridCoverage2DReader
getDimensionDescriptors
in interface StructuredGridCoverage2DReader
IOException
public boolean removeCoverage(String coverageName, boolean forceDelete) throws IOException, UnsupportedOperationException
StructuredGridCoverage2DReader
removeCoverage
in interface StructuredGridCoverage2DReader
IOException
UnsupportedOperationException
public void delete(boolean deleteData) throws IOException
StructuredGridCoverage2DReader
delete
in interface StructuredGridCoverage2DReader
deleteData
- specifies whether data (granules) should be deleted too.IOException
public boolean removeCoverage(String coverageName) throws IOException, UnsupportedOperationException
removeCoverage
in interface StructuredGridCoverage2DReader
IOException
UnsupportedOperationException
public ResourceInfo getInfo(String coverageName)
AbstractGridCoverage2DReader
getInfo
in interface GridCoverage2DReader
getInfo
in class AbstractGridCoverage2DReader
Copyright © 1996–2019 Geotools. All rights reserved.