java.lang.Object
org.hortonmachine.lesto.modules.raster.adaptivetinfilter.TinHandler

public class TinHandler extends Object
A helper class for tin handling.
Author:
Andrea Antonello (www.hydrologis.com)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TinHandler(org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm, org.opengis.referencing.crs.CoordinateReferenceSystem crs, double angleThreshold, double distanceThreshold, Double maxEdgeLength, int threadsNum)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    filterOnAllData(org.hortonmachine.gears.io.las.ALasDataManager lasHandler)
    Filter data on thresholds of all available data on the tin.
    void
     
    void
    finalCleanup(double pFinalCleanupDist)
     
    org.locationtech.jts.index.strtree.STRtree
    generateTinIndex(Double maxEdgeLength)
    Generate a spatial index on the tin geometries.
    int
    Returns the current size of the tinCoordinateList representing teh current ground points.
    int
    Returns the size of the points currently defined as being non-ground.
    double[]
     
    org.locationtech.jts.geom.Geometry[]
    Get the triangles of the current active tin.
    void
     
    void
    setStartCoordinates(List<org.locationtech.jts.geom.Coordinate> coordinateList)
    Sets the initial coordinates to start with.
    org.geotools.data.simple.SimpleFeatureCollection
    Create a FeatureCollection from the current tin triangles with information about the vertexes elevation.
    org.geotools.data.simple.SimpleFeatureCollection
     
    org.geotools.data.simple.SimpleFeatureCollection
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • TinHandler

      public TinHandler(org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm, org.opengis.referencing.crs.CoordinateReferenceSystem crs, double angleThreshold, double distanceThreshold, Double maxEdgeLength, int threadsNum)
      Constructor.
      Parameters:
      pm - the monitor.
      crs - the crs to use for feature creation.
      distanceThreshold - the fixed maximum distance threshold to use.
      maxEdgeLength - the max edge length for the longest edge of a triangle (if larger, it is ignored)
      threadsNum - the number of threads to use for parallel operations.
  • Method Details

    • setStartCoordinates

      public void setStartCoordinates(List<org.locationtech.jts.geom.Coordinate> coordinateList)
      Sets the initial coordinates to start with.

      Generates the tin on the first set of coordinates and adds the coordinates to the tinCoordinateList for future use.

      Note that it is mandatory to call this method to initialize.

      Parameters:
      coordinateList - the initial list of coordinates.
    • getTriangles

      public org.locationtech.jts.geom.Geometry[] getTriangles()
      Get the triangles of the current active tin.
      Returns:
      the array of polygons.
    • getCurrentGroundPointsNum

      public int getCurrentGroundPointsNum()
      Returns the current size of the tinCoordinateList representing teh current ground points.
      Returns:
      the size of the tin coords list.
    • getCurrentNonGroundPointsNum

      public int getCurrentNonGroundPointsNum()
      Returns the size of the points currently defined as being non-ground.
      Returns:
      the size of the non ground points list.
    • filterOnAllData

      public void filterOnAllData(org.hortonmachine.gears.io.las.ALasDataManager lasHandler) throws Exception
      Filter data on thresholds of all available data on the tin.

      Note: At the first run of this method, only thresholds are calculated.

      Parameters:
      lasHandler - the las data handler of all data.
      Throws:
      Exception
    • filterOnLeftOverData

      public void filterOnLeftOverData()
    • finalCleanup

      public void finalCleanup(double pFinalCleanupDist)
    • resetTin

      public void resetTin()
    • generateTinIndex

      public org.locationtech.jts.index.strtree.STRtree generateTinIndex(Double maxEdgeLength)
      Generate a spatial index on the tin geometries.
    • toFeatureCollection

      public org.geotools.data.simple.SimpleFeatureCollection toFeatureCollection()
      Create a FeatureCollection from the current tin triangles with information about the vertexes elevation.
      Returns:
      the feature collection of the tin.
    • toFeatureCollectionOthers

      public org.geotools.data.simple.SimpleFeatureCollection toFeatureCollectionOthers()
    • toFeatureCollectionTinPoints

      public org.geotools.data.simple.SimpleFeatureCollection toFeatureCollectionTinPoints()
    • getMinMaxElev

      public double[] getMinMaxElev()