Class RasterGetter
java.lang.Object
org.apache.sis.internal.sql.feature.ValueGetter<GridCoverage>
org.apache.sis.internal.sql.postgis.RasterGetter
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:
-
GeometryGetter<G,
V extends G>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.opengis.referencing.crs.CoordinateReferenceSystem
The Coordinate Reference System ifInfoStatements
cannot map the SRID.private final BinaryEncoding
The way binary data are encoded in the raster column.Fields inherited from class org.apache.sis.internal.sql.feature.ValueGetter
valueType
-
Constructor Summary
ConstructorsConstructorDescriptionRasterGetter
(org.opengis.referencing.crs.CoordinateReferenceSystem defaultCRS, BinaryEncoding encoding) Creates a new reader. -
Method Summary
Modifier and TypeMethodDescriptiongetValue
(InfoStatements stmts, ResultSet source, int columnIndex) Gets the value in the column at specified index.Methods inherited from class org.apache.sis.internal.sql.feature.ValueGetter
toCollection
-
Field Details
-
defaultCRS
private final org.opengis.referencing.crs.CoordinateReferenceSystem defaultCRSThe Coordinate Reference System ifInfoStatements
cannot map the SRID. This isnull
if there is no default. -
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, ornull
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 classValueGetter<GridCoverage>
- Parameters:
stmts
- prepared statements for fetching CRS from SRID, ornull
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.
-