Class TinHandler
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 doublePOINTENVELOPE_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 voidfilterOnAllData(org.hortonmachine.gears.io.las.ALasDataManager lasHandler)Filter data on thresholds of all available data on the tin.voidfilterOnLeftOverData()voidfinalCleanup(double pFinalCleanupDist)org.locationtech.jts.index.strtree.STRtreegenerateTinIndex(java.lang.Double maxEdgeLength)Generate a spatial index on the tin geometries.intgetCurrentGroundPointsNum()Returns the current size of thetinCoordinateListrepresenting teh current ground points.intgetCurrentNonGroundPointsNum()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.voidresetTin()voidsetStartCoordinates(java.util.List<org.locationtech.jts.geom.Coordinate> coordinateList)Sets the initial coordinates to start with.org.geotools.data.simple.SimpleFeatureCollectiontoFeatureCollection()Create aFeatureCollectionfrom the current tin triangles with information about the vertexes elevation.org.geotools.data.simple.SimpleFeatureCollectiontoFeatureCollectionOthers()org.geotools.data.simple.SimpleFeatureCollectiontoFeatureCollectionTinPoints()
-
Field Details
-
POINTENVELOPE_EXPAND
public static final double POINTENVELOPE_EXPAND- See Also:
- Constant Field Values
-
-
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
tinCoordinateListfor 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 thetinCoordinateListrepresenting 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.ExceptionFilter 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 aFeatureCollectionfrom 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()
-