Class VectorToRaster

java.lang.Object
nz.org.riskscape.engine.raster.VectorToRaster

public class VectorToRaster extends Object

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     
    protected boolean
    drawFeature(nz.org.riskscape.engine.Tuple feature, nz.org.riskscape.engine.rl.RealizedExpression expression, nz.org.riskscape.engine.types.Struct.StructMember geomMember)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)