Class AbstractGridFormat

  • All Implemented Interfaces:
    Format
    Direct Known Subclasses:
    ArcGridFormat, BaseGDALGridFormat, GeoPackageFormat, GeoTiffFormat, GrassCoverageFormat, ImageMosaicFormat, ImagePyramidFormat, JP2KFormat, MBTilesFormat, NetCDFFormat, PGRasterFormat, TPKFormat, UnknownFormat, WorldImageFormat

    public abstract class AbstractGridFormat
    extends Object
    implements Format
    AbstractGridFormat is a convenience class so subclasses only need to populate a Map class and set the read and write parameter fields.

    For example the ArcGridFormat has the following method which sets up all the required information: private void setInfo(){ HashMap info=new HashMap(); info.put("name", "ArcGrid"); info.put("description", "Arc Grid Coverage Format"); info.put("vendor", "Geotools"); info.put("docURL", "http://gdal.velocet.ca/projects/aigrid/index.html"); info.put("version", "1.0"); mInfo=info; readParameters=new GeneralParameterDescriptor[2]; readParameters[0]=ArcGridOperationParameter.getGRASSReadParam(); readParameters[0]=ArcGridOperationParameter.getCompressReadParam(); writeParameters=new GeneralParameterDescriptor[2]; writeParameters[0]=ArcGridOperationParameter.getGRASSWriteParam(); writeParameters[0]=ArcGridOperationParameter.getCompressWriteParam(); }

    Author:
    jeichar, Simone Giannecchini, GeoSolutions
    • Constructor Detail

      • AbstractGridFormat

        public AbstractGridFormat()
    • Method Detail

      • getDescription

        public String getDescription()
        Description copied from interface: Format
        Description of the file format. If no description, the value will be null.
        Specified by:
        getDescription in interface Format
        See Also:
        Format.getDescription()
      • getReader

        public abstract AbstractGridCoverage2DReader getReader​(Object source)
        Gets a GridCoverageReader for this format able to create coverages out of the source object.

        In case this Format cannot reader the provided source object null is returned.

        Parameters:
        source - The source object to parse.
        Returns:
        A reader for this Format or null.
      • getReader

        public abstract AbstractGridCoverage2DReader getReader​(Object source,
                                                               Hints hints)
        Gets a GridCoverageReader for this format able to create coverages out of the source object using the provided hints.

        In case this Format cannot reader the provided source object null is returned.

        Parameters:
        source - The source object to parse. *
        hints - The Hints to use when trying to instantiate this reader.
        Returns:
        A reader for this Format or null.
      • getWriter

        public abstract GridCoverageWriter getWriter​(Object destination)
        Retrieves a GridCoverageWriter suitable for writing to the provided destination with this format.

        In case no writers are available null is returned.

        Parameters:
        destination - The destinatin where to write.
        Returns:
        A GridCoverageWriter suitable for writing to the provided destination with this format.
      • accepts

        public boolean accepts​(Object source)
        Tells me if this Format can read the provided input.
        Parameters:
        source - The input object to test for suitability.
        Returns:
        True if this format can read this object, False otherwise.
      • accepts

        public abstract boolean accepts​(Object source,
                                        Hints hints)
        Tells me if this Format can read the provided input.
        Parameters:
        source - The input object to test for suitability.
        hints - Hints to control the accepts internal machinery.
        Returns:
        True if this format can read this object, False otherwise.
      • equals

        public boolean equals​(Format f)
        See Also:
        org.geotools.data.coverage.grid.Format#equals(org.geotools.data.coverage.grid.Format)
      • getDefaultCRS

        public static CoordinateReferenceSystem getDefaultCRS()
        getDefaultCRS

        This method provides the user with a default crs WGS84

      • getWriter

        public abstract GridCoverageWriter getWriter​(Object destination,
                                                     Hints hints)
        Call the accepts() method before asking for a writer to determine if the current object is supported.
        Parameters:
        destination - the destination object to write a WorldImage to
        hints - Hints to control the internal machinery.
        Returns:
        a new WorldImageWriter for the destination