Class NoiseMapByReceiverMaker
- java.lang.Object
-
- org.noise_planet.noisemodelling.jdbc.GridMapMaker
-
- org.noise_planet.noisemodelling.jdbc.NoiseMapByReceiverMaker
-
public class NoiseMapByReceiverMaker extends GridMapMaker
Compute noise propagation at specified receiver points.- Author:
- Nicolas Fortin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
NoiseMapByReceiverMaker.IComputeRaysOutFactory
A factory interface for creating objects that compute rays out for noise map computation.static interface
NoiseMapByReceiverMaker.TableLoader
A factory interface for initializing input propagation process data for noise map computation.
-
Field Summary
Fields Modifier and Type Field Description AtomicBoolean
aborted
If true, all processing are aborted and all threads will be shutdownAtomicBoolean
exitWhenDone
Tell table writer thread to empty current stacks then stop waiting for new data-
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, receiverHasAbsoluteZCoordinates, soilTableName, sound_lvl_field, soundReflectionOrder, sourceHasAbsoluteZCoordinates, sourcesTableName, verbose
-
-
Constructor Summary
Constructors Constructor Description NoiseMapByReceiverMaker(String buildingsTableName, String sourcesTableName, String receiverTableName)
??
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CutPlaneVisitorFactory
evaluateCell(Connection connection, CellIndex cellIndex, org.h2gis.api.ProgressVisitor progression, Set<Long> skipReceivers)
Launch sound propagationprotected org.locationtech.jts.geom.Envelope
getComputationEnvelope(Connection connection)
Retrieves the computation envelope based on data stored in the database tables.String
getFrequencyFieldPrepend()
SceneDatabaseInputSettings.INPUT_MODE
getInputMode()
NoiseMapDatabaseParameters
getNoiseMapDatabaseParameters()
ProfilerThread
getProfilerThread()
Computation stacks and timing are collected by this class in order to profile the execution of the simulationNoiseMapByReceiverMaker.TableLoader
getPropagationProcessDataFactory()
String
getReceiverTableName()
SceneDatabaseInputSettings
getSceneInputSettings()
String
getSourceEmissionPrimaryKeyField()
String
getSourcesEmissionTableName()
This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A).NoiseMapByReceiverMaker.TableLoader
getTableLoader()
int
getThreadCount()
void
initialize(Connection connection, org.h2gis.api.ProgressVisitor progression)
Initializes the noise map computation process.boolean
isBodyBarrier()
true if train propagation is computed (multiple reflection between the train and a screen)SceneWithEmission
prepareCell(Connection connection, CellIndex cellIndex, Set<Long> skipReceivers)
Initialisation of data structures needed for sound propagation.void
run(Connection connection, org.h2gis.api.ProgressVisitor progressLogger)
Run NoiseModelling with provided parameters, return when computation is doneMap<CellIndex,Integer>
searchPopulatedCells(Connection connection)
Fetch all receivers and compute cells that contains receiversvoid
setComputeRaysOutFactory(NoiseMapByReceiverMaker.IComputeRaysOutFactory computeRaysOutFactory)
void
setFrequencyFieldPrepend(String frequencyFieldPrepend)
void
setInputMode(SceneDatabaseInputSettings.INPUT_MODE inputMode)
void
setProfilerThread(ProfilerThread profilerThread)
Computation stacks and timing are collected by this class in order to profile the execution of the simulationvoid
setPropagationProcessDataFactory(NoiseMapByReceiverMaker.TableLoader tableLoader)
Do not call this method afterinitialize(Connection, ProgressVisitor)
has been calledvoid
setSourceEmissionPrimaryKeyField(String sourceEmissionPrimaryKeyField)
void
setSourcesEmissionTableName(String sourcesEmissionTableName)
This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A) or road traffic information Spectrum column name must be LWGridMapMaker.sound_lvl_field
.void
setThreadCount(int threadCount)
-
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, 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
-
-
-
-
Field Detail
-
exitWhenDone
public AtomicBoolean exitWhenDone
Tell table writer thread to empty current stacks then stop waiting for new data
-
aborted
public AtomicBoolean aborted
If true, all processing are aborted and all threads will be shutdown
-
-
Method Detail
-
getNoiseMapDatabaseParameters
public NoiseMapDatabaseParameters getNoiseMapDatabaseParameters()
- Returns:
- Settings of the database (expected tables names; fields, global settings of the computation)
-
getSourcesEmissionTableName
public String getSourcesEmissionTableName()
This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A). Spectrum column name must be LWGridMapMaker.sound_lvl_field
. Where HERTZ is a number- Returns:
- Source emission table name*
-
getInputMode
public SceneDatabaseInputSettings.INPUT_MODE getInputMode()
-
setInputMode
public void setInputMode(SceneDatabaseInputSettings.INPUT_MODE inputMode)
-
getSourceEmissionPrimaryKeyField
public String getSourceEmissionPrimaryKeyField()
-
setSourceEmissionPrimaryKeyField
public void setSourceEmissionPrimaryKeyField(String sourceEmissionPrimaryKeyField)
-
getFrequencyFieldPrepend
public String getFrequencyFieldPrepend()
-
setFrequencyFieldPrepend
public void setFrequencyFieldPrepend(String frequencyFieldPrepend)
- Parameters:
frequencyFieldPrepend
- Text preceding the frequency in source emission table (default LW)
-
getSceneInputSettings
public SceneDatabaseInputSettings getSceneInputSettings()
-
setSourcesEmissionTableName
public void setSourcesEmissionTableName(String sourcesEmissionTableName)
This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A) or road traffic information Spectrum column name must be LWGridMapMaker.sound_lvl_field
. Where HERTZ is a number- Parameters:
sourcesEmissionTableName
- Source emission table name
-
isBodyBarrier
public boolean isBodyBarrier()
true if train propagation is computed (multiple reflection between the train and a screen)
-
getProfilerThread
public ProfilerThread getProfilerThread()
Computation stacks and timing are collected by this class in order to profile the execution of the simulation- Returns:
- Instance of ProfilerThread or null
-
getReceiverTableName
public String getReceiverTableName()
- Returns:
- Receiver table name
-
setProfilerThread
public void setProfilerThread(ProfilerThread profilerThread)
Computation stacks and timing are collected by this class in order to profile the execution of the simulation- Parameters:
profilerThread
- Instance of ProfilerThread
-
setComputeRaysOutFactory
public void setComputeRaysOutFactory(NoiseMapByReceiverMaker.IComputeRaysOutFactory computeRaysOutFactory)
-
setPropagationProcessDataFactory
public void setPropagationProcessDataFactory(NoiseMapByReceiverMaker.TableLoader tableLoader)
Do not call this method afterinitialize(Connection, ProgressVisitor)
has been called- Parameters:
tableLoader
- Object that generate scene for each sub-cell using database data
-
getPropagationProcessDataFactory
public NoiseMapByReceiverMaker.TableLoader getPropagationProcessDataFactory()
- Returns:
- Object that generate scene for each sub-cell using database data
-
getThreadCount
public int getThreadCount()
-
setThreadCount
public void setThreadCount(int threadCount)
-
prepareCell
public SceneWithEmission prepareCell(Connection connection, CellIndex cellIndex, Set<Long> skipReceivers) throws SQLException, IOException
Initialisation of data structures needed for sound propagation.- Parameters:
connection
- JDBC ConnectioncellIndex
- Computation area indexskipReceivers
- Do not process the receivers primary keys in this set and once included add the new receivers primary in it- Returns:
- Data input for cell evaluation
- Throws:
SQLException
IOException
-
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 classGridMapMaker
- Parameters:
connection
- the database connection.- Returns:
- the computation envelope containing the bounding box of the data stored in the specified tables.
- Throws:
SQLException
-
searchPopulatedCells
public Map<CellIndex,Integer> searchPopulatedCells(Connection connection) throws SQLException
Fetch all receivers and compute cells that contains receivers- Parameters:
connection
-- Returns:
- Cell index with number of receivers
- Throws:
SQLException
-
evaluateCell
public CutPlaneVisitorFactory evaluateCell(Connection connection, CellIndex cellIndex, org.h2gis.api.ProgressVisitor progression, Set<Long> skipReceivers) throws SQLException, IOException
Launch sound propagation- Parameters:
connection
- JDBC ConnectioncellIndex
- Computation area indexprogression
- Progression infoskipReceivers
- Do not process the receivers primary keys in this set and once included add the new receivers primary in it- Returns:
- Output data instance for this cell
- Throws:
SQLException
- Sql exception instanceIOException
-
getTableLoader
public NoiseMapByReceiverMaker.TableLoader getTableLoader()
- Returns:
- Class used to load tables for input data
-
initialize
public void initialize(Connection connection, org.h2gis.api.ProgressVisitor progression) throws SQLException
Initializes the noise map computation process.- Overrides:
initialize
in classGridMapMaker
- Parameters:
connection
- Active connectionprogression
-- Throws:
SQLException
-
run
public void run(Connection connection, org.h2gis.api.ProgressVisitor progressLogger) throws SQLException
Run NoiseModelling with provided parameters, return when computation is done- Throws:
SQLException
-
-