Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public interface StructuredGridCoverage2DReader extends GridCoverage2DReader {
    /**
     * Returns the granule source for the specified coverage (might be null, if there is only one supported coverage)
     * 
     * @param coverageName the name of the specified coverage
     * @param readOnly a boolean indicating whether we may want modify the GranuleSource
     * @return the requested {@link GranuleSource}
     * @throws IOException
     * @throws UnsupportedOperationException
     */
    GranuleSource getGranules(String coverageName, boolean readOnly) throws IOException, UnsupportedOperationException;
    /**
     * Return whether this reader can modify the granule source 
     * @return
     */
    boolean isReadOnly();
    /**
     * Creates a granule store for a new coverage with the given feature type
     */
    void createCoverage(String coverageName, SimpleFeatureType schema) throws
                                               IOException, UnsupportedOperationException;
    /**
     * removes a granule store for the specified coverageName
     */
    boolean removeCoverage(String coverageName) throws IOException, UnsupportedOperationException;
    
    /**
     * Harvests the specified file into the reader. Depending on the implementation, the original file
     * is harvested in place (e.g., image mosaic), or might be copied into the reader persistent storage (e.g., database raster handling)
     *
     * @param defaultCoverage Default target coverage, to be used in case the files being harvested are not structured ones. The parameter is optional,
     *                        in case it's missing the reader will use the first coverage as the default target. 
     *                        
     * @param source The source can be a single file, or a folder. The file types supported by the harvest operation
     *               vary depending on the implementation, but generally speaking, all coverages having a reader should be supported.
     * @param hints Used to provide implementation specific hints on how to harvest the files
     * @throws IOException
     * @throws UnsupportedOperationException
     */
    List<HarvestedFile> harvest(String defaultTargetCoverage, File source, Hints hints) throws IOException,
            UnsupportedOperationException;

    /**
     * Describes the dimensions supported by the specified coverage, if any.
     * (coverageName might be null, if there is only one supported coverage)
     */
    List<DimensionDescriptor> getDimensionDescriptors(String coverageName) throws IOException;
 }
 
public interface HarvestedFile {
    /**
     * The file that has been processed
     * 
     * @return
     */
    File getFile();
    /**
     * If true, the file has been ingested and generated new granules in the reader, false otherwise
     * 
     * @return
     */
    boolean success();
    /**
     * In case the file was not ingested, provides a reason why it was skipped
     * 
     * @return
     */
    String getMessage();
}

/**
 * Describes a "dimension" exposed by a structured grid coverage reader. 
 */
public interface DimensionDescriptor {
    /**
    * The dimension name
    *
    * @return
    */
   String getName();
   /**
    * The dimension unit symbol
    *
    * @return
    */
   String getUnitSymbol();
   /**
    * The dimension units
    *
    * @return
    */
   String getUnits();
   /**
    * The start attribute 
    *
    * @return
    */
   String getStartAttribute();
   /**
    * The end attribute (In case of dimensions with ranges) 
    *
    * @return
    */
   String getEndAttribute();
}  

GranuleSource

 

AFTER:

Code Block
public interface GranuleSource {
    /**
     * Retrieves granules, in the form of a {@code SimpleFeatureCollection}, based on a {@code Query}.
     * 
     * @param q the {@link Query} to select granules
     * @return the resulting granules.
     * @throws IOException
     */
    public SimpleFeatureCollection getGranules(Query q) throws IOException;
    /**
     * Gets the number of the granules that would be returned by the given {@code Query}, taking into account any settings for max features and start
     * index set on the {@code Query}.
     * 
     * @param q the {@link Query} to select granules
     * @return the number of granules
     * @throws IOException
     */
    public int getCount(Query q) throws IOException;
    /**
     * Get the spatial bounds of the granules that would be returned by the given {@code Query}.
     * 
     * @param q the {@link Query} to select granules
     * @return The bounding envelope of the requested data
     * @throws IOException
     */
    public ReferencedEnvelope getBounds(Query q) throws IOException;
    /**
     * Retrieves the schema (feature type) that will apply to granules retrieved from this {@code GranuleSource}.
     * 
     * @return
     * @throws IOException
     */
    public SimpleFeatureType getSchema() throws IOException;
    /**
     * This will free/release any resource (cached granules, ...).
     * 
     * @throws IOException
     */
    public void dispose() throws IOException;
} 

...