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

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

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

    Constructors 
    Constructor Description
    TinHandler​(org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm, org.opengis.referencing.crs.CoordinateReferenceSystem crs, double angleThreshold, double distanceThreshold, java.lang.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 filterOnLeftOverData()  
    void finalCleanup​(double pFinalCleanupDist)  
    org.locationtech.jts.index.strtree.STRtree generateTinIndex​(java.lang.Double maxEdgeLength)
    Generate a spatial index on the tin geometries.
    int getCurrentGroundPointsNum()
    Returns the current size of the tinCoordinateList representing teh current ground points.
    int getCurrentNonGroundPointsNum()
    Returns the size of the points currently defined as being non-ground.
    double[] getMinMaxElev()  
    org.locationtech.jts.geom.Geometry[] getTriangles()
    Get the triangles of the current active tin.
    void resetTin()  
    void setStartCoordinates​(java.util.List<org.locationtech.jts.geom.Coordinate> coordinateList)
    Sets the initial coordinates to start with.
    org.geotools.data.simple.SimpleFeatureCollection toFeatureCollection()
    Create a FeatureCollection from the current tin triangles with information about the vertexes elevation.
    org.geotools.data.simple.SimpleFeatureCollection toFeatureCollectionOthers()  
    org.geotools.data.simple.SimpleFeatureCollection toFeatureCollectionTinPoints()  

    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, java.lang.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​(java.util.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 java.lang.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:
      java.lang.Exception
    • filterOnLeftOverData

      public void filterOnLeftOverData()
    • finalCleanup

      public void finalCleanup​(double pFinalCleanupDist)
    • resetTin

      public void resetTin()
    • generateTinIndex

      public org.locationtech.jts.index.strtree.STRtree generateTinIndex​(java.lang.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()