Class CoverageValueProviderHelper

java.lang.Object
nz.org.riskscape.engine.data.coverage.CoverageValueProviderHelper

public class CoverageValueProviderHelper extends Object

Provides utility functions useful to TypedCoverage implementations.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Exception to throw if the helper is given an empty geometry.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CoverageValueProviderHelper(org.geotools.geometry.jts.ReferencedEnvelope envelope, nz.org.riskscape.engine.SRIDSet sridSet)
    Get a helper for a coverage that covers the envelope.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(org.geotools.api.geometry.Position position)
     
    org.geotools.geometry.jts.ReferencedEnvelope
     
    org.geotools.api.geometry.Position
    pointToDirectPosition(org.locationtech.jts.geom.Point point)
     
    org.locationtech.jts.geom.Geometry
    reprojectIfNecessary(org.locationtech.jts.geom.Geometry geom)
    Will reproject geom into the CoordinateReferenceSystem of the coverage if necessary.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CoverageValueProviderHelper

      public CoverageValueProviderHelper(org.geotools.geometry.jts.ReferencedEnvelope envelope, nz.org.riskscape.engine.SRIDSet sridSet)

      Get a helper for a coverage that covers the envelope.

      Parameters:
      envelope - containing the coverage
      sridSet -
  • Method Details

    • reprojectIfNecessary

      public org.locationtech.jts.geom.Geometry reprojectIfNecessary(org.locationtech.jts.geom.Geometry geom) throws CoverageValueProviderHelper.EmptyGeometryException

      Will reproject geom into the CoordinateReferenceSystem of the coverage if necessary.

      Parameters:
      geom -
      Returns:
      geom, or reproject geom if necessary
      Throws:
      CoverageValueProviderHelper.EmptyGeometryException - if geom is empty
    • contains

      public boolean contains(org.geotools.api.geometry.Position position)
      Parameters:
      position -
      Returns:
      true if position is within the envelope
    • pointToDirectPosition

      public org.geotools.api.geometry.Position pointToDirectPosition(org.locationtech.jts.geom.Point point)
    • getEnvelope

      public org.geotools.geometry.jts.ReferencedEnvelope getEnvelope()