Class SampleNClosest

java.lang.Object
nz.org.riskscape.engine.function.geometry.BaseSamplingFunction
nz.org.riskscape.engine.function.geometry.SampleNClosest
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.function.RiskscapeFunction, nz.org.riskscape.engine.function.UntypedFunction, nz.org.riskscape.engine.rl.RealizableFunction

public class SampleNClosest extends BaseSamplingFunction

Returns the n closest samples from a coverage at a given point, sorted closest-first.

Each result is a SampledValue struct with the sampled value and its geometry.

Throws a RiskscapeException if the coverage does not support n-closest sampling.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface nz.org.riskscape.engine.rl.RealizableFunction

    nz.org.riskscape.engine.rl.RealizableFunction.MetadataIdentifiedRealizableFunction
  • Field Summary

    Fields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction

    BUILT_IN, LOG
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.engine.function.ArgumentList
     
    nz.org.riskscape.engine.types.Type
     
    protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction>
    realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, nz.org.riskscape.engine.types.Geom geomType, nz.org.riskscape.engine.types.CoverageType coverageType)
     
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction>
    realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, nz.org.riskscape.engine.types.Geom geomType, nz.org.riskscape.engine.types.CoverageType coverageType, List<nz.org.riskscape.engine.types.Type> givenTypes)
     

    Methods inherited from class nz.org.riskscape.engine.function.geometry.BaseSamplingFunction

    call, getArgumentTypes, realize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.rl.RealizableFunction

    isDoTypeAdaptation

    Methods inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction

    builtin, close, getAggregationFunction, getOverloaded, getRealizable, getTypesFromArguments, identified, identified, isA, setProblemReporter, validate
  • Constructor Details

    • SampleNClosest

      public SampleNClosest()
  • Method Details

    • getReturnType

      public nz.org.riskscape.engine.types.Type getReturnType()
      Specified by:
      getReturnType in interface nz.org.riskscape.engine.function.RiskscapeFunction
      Overrides:
      getReturnType in class BaseSamplingFunction
    • realize

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, nz.org.riskscape.engine.types.Geom geomType, nz.org.riskscape.engine.types.CoverageType coverageType, List<nz.org.riskscape.engine.types.Type> givenTypes)
      Overrides:
      realize in class BaseSamplingFunction
    • realize

      protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, nz.org.riskscape.engine.types.Geom geomType, nz.org.riskscape.engine.types.CoverageType coverageType)
      Specified by:
      realize in class BaseSamplingFunction
    • getArguments

      public nz.org.riskscape.engine.function.ArgumentList getArguments()
      Specified by:
      getArguments in interface nz.org.riskscape.engine.function.RiskscapeFunction
      Overrides:
      getArguments in class BaseSamplingFunction