Class RasterGetter

java.lang.Object
org.apache.sis.internal.sql.feature.ValueGetter<GridCoverage>
org.apache.sis.internal.sql.postgis.RasterGetter

final class RasterGetter extends ValueGetter<GridCoverage>
Reader of rasters encoded in Well Known Binary (WKB) format. At the time of writing this class, raster WKB is a PostGIS-specific format.

Multi-threading

RasterGetter instances shall be thread-safe.
Since:
1.2
Version:
1.2
See Also:
  • Field Details

    • defaultCRS

      private final org.opengis.referencing.crs.CoordinateReferenceSystem defaultCRS
      The Coordinate Reference System if InfoStatements cannot map the SRID. This is null if there is no default.
    • encoding

      private final BinaryEncoding encoding
      The way binary data are encoded in the raster column.
  • Constructor Details

    • RasterGetter

      RasterGetter(org.opengis.referencing.crs.CoordinateReferenceSystem defaultCRS, BinaryEncoding encoding)
      Creates a new reader. The same instance can be reused for parsing an arbitrary amount of rasters sharing the same default CRS.
      Parameters:
      defaultCRS - the CRS to use if none can be mapped from the SRID, or null if none.
      encoding - the way binary data are encoded in the raster column.
  • Method Details

    • getValue

      public GridCoverage getValue(InfoStatements stmts, ResultSet source, int columnIndex) throws Exception
      Gets the value in the column at specified index. The given result set must have its cursor position on the line to read. This method does not modify the cursor position.
      Specified by:
      getValue in class ValueGetter<GridCoverage>
      Parameters:
      stmts - prepared statements for fetching CRS from SRID, or null if none.
      source - the result set from which to get the value.
      columnIndex - index of the column in which to get the value.
      Returns:
      raster value in the given column. May be null.
      Throws:
      Exception - if an error occurred. May be an SQL error, a WKB parsing error, etc.