Package nz.org.riskscape.engine.raster
Class VectorToRaster
java.lang.Object
nz.org.riskscape.engine.raster.VectorToRaster
Utility for producing a GridCoverage2D
from a Relation
, adapted from some geotools code in an
unsupported module
Support for integer encoding has been removed in favour of a floating point only. Note that only the 4-byte wide float type is supported here, although it accepts the 8 bit double value - this is because a raster encoded in sRGB will only be 4 bytes, so some loss of precision of value is possible when rasterizing.
TODO This class should probably be split in to a couple of different classes, particularly one for drawing jts shapes, and maybe another for iterating and producing the coverage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.geotools.coverage.grid.GridCoverage2D
convert
(nz.org.riskscape.engine.relation.Relation relation, nz.org.riskscape.engine.rl.RealizedExpression expression, double scale, org.geotools.geometry.jts.ReferencedEnvelope bounds, String covName) protected boolean
drawFeature
(nz.org.riskscape.engine.Tuple feature, nz.org.riskscape.engine.rl.RealizedExpression expression, nz.org.riskscape.engine.types.Struct.StructMember geomMember)
-
Constructor Details
-
VectorToRaster
public VectorToRaster()
-
-
Method Details
-
convert
public org.geotools.coverage.grid.GridCoverage2D convert(nz.org.riskscape.engine.relation.Relation relation, nz.org.riskscape.engine.rl.RealizedExpression expression, double scale, org.geotools.geometry.jts.ReferencedEnvelope bounds, String covName) -
drawFeature
protected boolean drawFeature(nz.org.riskscape.engine.Tuple feature, nz.org.riskscape.engine.rl.RealizedExpression expression, nz.org.riskscape.engine.types.Struct.StructMember geomMember)
-