Class DelaunayReceiversMaker
- java.lang.Object
-
- org.noise_planet.noisemodelling.jdbc.GridMapMaker
-
- org.noise_planet.noisemodelling.jdbc.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
-
-
Field Summary
-
Fields inherited from class org.noise_planet.noisemodelling.jdbc.GridMapMaker
bodyBarrier, buildingTableParameters, computeHorizontalDiffraction, computeVerticalDiffraction, demTable, geometryFactory, gridDim, groundSurfaceSplitSideLength, gs, mainEnvelope, maximumPropagationDistance, maximumReflectionDistance, MINIMAL_BUFFER_RATIO, receiverHasSeaLevelZCoordinates, soilTableName, sound_lvl_field, soundReflectionOrder, sourceHasSeaLevelZCoordinates, sourcesTableName, verbose
-
-
Constructor Summary
Constructors Constructor Description DelaunayReceiversMaker(String buildingsTableName, String sourcesTableName)Create constructor DelaunayReceiversMaker
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeDelaunay(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)Delaunay triangulation of Sub-DomainvoidfetchCellSource(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, boolean doIntersection, List<org.locationtech.jts.geom.Geometry> sourceGeometries)Fetch source geometries and powervoidgenerateReceivers(Connection connection, int cellI, int cellJ, String receiverTableName, String trianglesTableName, AtomicInteger receiverPK)static voidgenerateResultTable(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)doublegetBuildingBuffer()org.locationtech.jts.geom.EnvelopegetComputationEnvelope(Connection connection)Retrieves the computation envelope based on data stored in the database tables.doublegetEpsilon()StringgetExceptionDumpFolder()doublegetGeometrySimplificationDistance()doublegetMaximumArea()doublegetMinimalSourceGeometriesDistanceToComputeCell()doublegetReceiverHeight()longgetReceiversCount()doublegetRoadWidth()booleanhasSourcesNearEnvelope(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, double minimalDistance)Check if there is at least one source geometry near the envelopebooleanisExportTrianglesGeometries()booleanisIsoSurfaceInBuildings()voidrun(Connection connection, String verticesTableName, String triangleTableName, org.h2gis.api.ProgressVisitor progressVisitor)Executes the Delaunay triangulation process for a grid of subdomains.voidsetBuildingBuffer(double buildingBuffer)Do not add receivers closer to specified distancevoidsetEpsilon(double epsilon)voidsetExceptionDumpFolder(String exceptionDumpFolder)voidsetExportTrianglesGeometries(boolean exportTrianglesGeometries)voidsetGeometrySimplificationDistance(double geometrySimplificationDistance)voidsetIsoSurfaceInBuildings(boolean isoSurfaceInBuildings)voidsetMaximumArea(double maximumArea)voidsetMinimalSourceGeometriesDistanceToComputeCell(double minimalSourceGeometriesDistanceToComputeCell)Do not evaluate a computation cell if there is no source geometries at least at x meters from the cell envelope.voidsetReceiverHeight(double receiverHeight)voidsetRoadWidth(double roadWidth)Set the buffer around the roads where no receivers will be placed.-
Methods inherited from class org.noise_planet.noisemodelling.jdbc.GridMapMaker
getBuildingsTableName, getBuildingTableParameters, getCellEnv, getCellEnv, getCellHeight, getCellWidth, getDemTable, getGeometryFactory, getGridDim, getGroundSurfaceSplitSideLength, getGs, getHeightField, getMainEnvelope, getMaximumPropagationDistance, getMaximumReflectionDistance, getSoilTableName, getSound_lvl_field, getSoundReflectionOrder, getSourcesTableName, getWallAbsorption, initialize, isComputeHorizontalDiffraction, isComputeVerticalDiffraction, isReceiverHasAbsoluteZCoordinates, isSourceHasAbsoluteZCoordinates, isVerbose, iszBuildings, setBodyBarrier, setComputeHorizontalDiffraction, setComputeVerticalDiffraction, setDemTable, setGridDim, setGroundSurfaceSplitSideLength, setGs, setHeightField, setMainEnvelope, setMaximumPropagationDistance, setMaximumReflectionDistance, setReceiverHasAbsoluteZCoordinates, setSoilTableName, setSound_lvl_field, setSoundReflectionOrder, setSourceHasAbsoluteZCoordinates, setVerbose, setWallAbsorption, setzBuildings
-
-
-
-
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 targetmainEnvelope- Global envelopecellI- I cell indexcellJ- J cell indexmaxSrcDist- Maximum propagation distanceminRecDist- Minimal distance receiver-sourcemaximumArea- 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:
getComputationEnvelopein classGridMapMaker- 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 connectionfetchEnvelope- Fetch envelopedoIntersection- Truncate geometrissourceGeometries- List to feed- Throws:
SQLException- if a database access error occurs
-
generateReceivers
public void generateReceivers(Connection connection, int cellI, int cellJ, String receiverTableName, String trianglesTableName, AtomicInteger receiverPK) throws SQLException, LayerDelaunayError, IOException
-
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 withsetMinimalSourceGeometriesDistanceToComputeCell(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 onrun(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 connectionfetchEnvelope- Fetch envelopeminimalDistance- 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()
-
-