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

      • 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)
                 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
      • getComputationEnvelope

        protected 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
      • 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)
                                        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
      • getRoadWidth

        public double getRoadWidth()
      • setRoadWidth

        public void setRoadWidth​(double roadWidth)
      • getMaximumArea

        public double getMaximumArea()
      • setMaximumArea

        public void setMaximumArea​(double maximumArea)
      • getReceiverHeight

        public double getReceiverHeight()
      • setReceiverHeight

        public void setReceiverHeight​(double receiverHeight)
      • getNbreceivers

        public long getNbreceivers()