Class DelaunayReceiversMaker


  • public class DelaunayReceiversMaker
    extends GridMapMaker
    Create input receivers built from Delaunay for contructing a NoiseMap rendering. SQL syntax is compatible with H2 and PostGIS.
    Author:
    Nicolas Fortin, SU Qi
    • Constructor Detail

      • DelaunayReceiversMaker

        public DelaunayReceiversMaker​(String buildingsTableName,
                                      String sourcesTableName)
        Create constructor DelaunayReceiversMaker
        Parameters:
        buildingsTableName - Buildings table
        sourcesTableName - Source table name
    • Method Detail

      • isExportTrianglesGeometries

        public boolean isExportTrianglesGeometries()
        Returns:
        True if triangle geometries are exported
      • setExportTrianglesGeometries

        public void setExportTrianglesGeometries​(boolean exportTrianglesGeometries)
        Parameters:
        exportTrianglesGeometries - Set true in order to export triangle geometries
      • isIsoSurfaceInBuildings

        public boolean isIsoSurfaceInBuildings()
        Returns:
        True if isosurface will be placed into buildings
      • setIsoSurfaceInBuildings

        public void setIsoSurfaceInBuildings​(boolean isoSurfaceInBuildings)
        Parameters:
        isoSurfaceInBuildings - Set true in order to place isosurface in buildings
      • run

        public void run​(Connection connection,
                        String verticesTableName,
                        String triangleTableName,
                        org.h2gis.api.ProgressVisitor progressVisitor)
                 throws SQLException
        Executes the Delaunay triangulation process for a grid of subdomains. Each subdomain is handled independently and includes the generation of receivers and triangles based on the given configuration.
        Parameters:
        connection - The database connection used to interact with the data.
        verticesTableName - The name of the database table where the vertices will be stored.
        triangleTableName - The name of the database table where the triangles will be stored.
        Throws:
        SQLException - Thrown if a database access error or other SQL-related error occurs.
      • getExceptionDumpFolder

        public String getExceptionDumpFolder()
        Returns:
        When an exception occur, this folder with receiver the input data
      • setExceptionDumpFolder

        public void setExceptionDumpFolder​(String exceptionDumpFolder)
        Parameters:
        exceptionDumpFolder - When an exception occur, this folder with receiver the input data
      • getBuildingBuffer

        public double getBuildingBuffer()
        Returns:
        Do not add receivers closer to specified distance
      • setBuildingBuffer

        public void setBuildingBuffer​(double buildingBuffer)
        Do not add receivers closer to specified distance
        Parameters:
        buildingBuffer - Distance in meters
      • computeDelaunay

        public void computeDelaunay​(LayerDelaunay cellMesh,
                                    org.locationtech.jts.geom.Envelope mainEnvelope,
                                    int cellI,
                                    int cellJ,
                                    double maxSrcDist,
                                    Collection<org.locationtech.jts.geom.Geometry> sources,
                                    double minRecDist,
                                    double maximumArea,
                                    double buildingBuffer,
                                    List<Building> buildings)
                             throws LayerDelaunayError
        Delaunay triangulation of Sub-Domain
        Parameters:
        cellMesh - Final mesh target
        mainEnvelope - Global envelope
        cellI - I cell index
        cellJ - J cell index
        maxSrcDist - Maximum propagation distance
        minRecDist - Minimal distance receiver-source
        maximumArea - Maximum area of triangles
        Throws:
        LayerDelaunayError - if an error occurs during the Delaunay triangulation process.
      • getComputationEnvelope

        public org.locationtech.jts.geom.Envelope getComputationEnvelope​(Connection connection)
                                                                  throws SQLException
        Retrieves the computation envelope based on data stored in the database tables.
        Specified by:
        getComputationEnvelope in class GridMapMaker
        Parameters:
        connection - the database connection.
        Returns:
        the computation envelope containing the bounding box of the data stored in the specified tables.
        Throws:
        SQLException - if a database access error occurs.
      • getEpsilon

        public double getEpsilon()
      • getGeometrySimplificationDistance

        public double getGeometrySimplificationDistance()
      • setGeometrySimplificationDistance

        public void setGeometrySimplificationDistance​(double geometrySimplificationDistance)
      • generateResultTable

        public static void generateResultTable​(Connection connection,
                                               String receiverTableName,
                                               String trianglesTableName,
                                               AtomicInteger receiverPK,
                                               List<org.locationtech.jts.geom.Coordinate> vertices,
                                               org.locationtech.jts.geom.GeometryFactory geometryFactory,
                                               List<Triangle> triangles,
                                               int cellI,
                                               int cellJ,
                                               int gridDim,
                                               boolean exportTrianglesGeometries)
                                        throws SQLException
        Throws:
        SQLException
      • setEpsilon

        public void setEpsilon​(double epsilon)
        Parameters:
        epsilon - Merge points that are closer that this epsilon value
      • fetchCellSource

        public void fetchCellSource​(Connection connection,
                                    org.locationtech.jts.geom.Envelope fetchEnvelope,
                                    boolean doIntersection,
                                    List<org.locationtech.jts.geom.Geometry> sourceGeometries)
                             throws SQLException
        Fetch source geometries and power
        Parameters:
        connection - Active connection
        fetchEnvelope - Fetch envelope
        doIntersection - Truncate geometris
        sourceGeometries - List to feed
        Throws:
        SQLException - if a database access error occurs
      • getRoadWidth

        public double getRoadWidth()
      • setRoadWidth

        public void setRoadWidth​(double roadWidth)
        Set the buffer around the roads where no receivers will be placed. If this value is equal to 0m, the roads will not be integrated into the triangulation So you can exclude cells with setMinimalSourceGeometriesDistanceToComputeCell(double) and not use the road buffer.
        Parameters:
        roadWidth - Road width in meters
      • getMinimalSourceGeometriesDistanceToComputeCell

        public double getMinimalSourceGeometriesDistanceToComputeCell()
        Returns:
        Do not evaluate a computation cell if there is no source geometries at least at x meters from the cell envelope
      • setMinimalSourceGeometriesDistanceToComputeCell

        public void setMinimalSourceGeometriesDistanceToComputeCell​(double minimalSourceGeometriesDistanceToComputeCell)
        Do not evaluate a computation cell if there is no source geometries at least at x meters from the cell envelope. Evaluated on run(Connection, String, String, ProgressVisitor) It is ignored if it is NaN or if source table name is not provided or does not exists
        Parameters:
        minimalSourceGeometriesDistanceToComputeCell - Distance in meters
      • hasSourcesNearEnvelope

        public boolean hasSourcesNearEnvelope​(Connection connection,
                                              org.locationtech.jts.geom.Envelope fetchEnvelope,
                                              double minimalDistance)
                                       throws SQLException
        Check if there is at least one source geometry near the envelope
        Parameters:
        connection - Active connection
        fetchEnvelope - Fetch envelope
        minimalDistance - Minimal distance from envelope
        Returns:
        True if there is at least one source geometry near the envelope
        Throws:
        SQLException - if a database access error occurs
      • getMaximumArea

        public double getMaximumArea()
      • setMaximumArea

        public void setMaximumArea​(double maximumArea)
      • getReceiverHeight

        public double getReceiverHeight()
      • setReceiverHeight

        public void setReceiverHeight​(double receiverHeight)
      • getReceiversCount

        public long getReceiversCount()