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 interfaceNoiseMapByReceiverMaker.IComputeRaysOutFactoryA factory interface for creating objects that compute rays out for noise map computation.static interfaceNoiseMapByReceiverMaker.TableLoaderA factory interface for initializing input propagation process data for noise map computation.
-
Field Summary
Fields Modifier and Type Field Description AtomicBooleanabortedIf true, all processing are aborted and all threads will be shutdownAtomicBooleanexitWhenDoneTell 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 CutPlaneVisitorFactoryevaluateCell(Connection connection, CellIndex cellIndex, org.h2gis.api.ProgressVisitor progression, Set<Long> skipReceivers)Launch sound propagationprotected org.locationtech.jts.geom.EnvelopegetComputationEnvelope(Connection connection)Retrieves the computation envelope based on data stored in the database tables.StringgetFrequencyFieldPrepend()SceneDatabaseInputSettings.INPUT_MODEgetInputMode()NoiseMapDatabaseParametersgetNoiseMapDatabaseParameters()ProfilerThreadgetProfilerThread()Computation stacks and timing are collected by this class in order to profile the execution of the simulationNoiseMapByReceiverMaker.TableLoadergetPropagationProcessDataFactory()StringgetReceiverTableName()SceneDatabaseInputSettingsgetSceneInputSettings()StringgetSourceEmissionPrimaryKeyField()StringgetSourcesEmissionTableName()This table must contain a source identifier column named IDSOURCE, a **PERIOD** VARCHAR field, and emission spectrum in dB(A).NoiseMapByReceiverMaker.TableLoadergetTableLoader()intgetThreadCount()voidinitialize(Connection connection, org.h2gis.api.ProgressVisitor progression)Initializes the noise map computation process.booleanisBodyBarrier()true if train propagation is computed (multiple reflection between the train and a screen)SceneWithEmissionprepareCell(Connection connection, CellIndex cellIndex, Set<Long> skipReceivers)Initialisation of data structures needed for sound propagation.voidrun(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 receiversvoidsetComputeRaysOutFactory(NoiseMapByReceiverMaker.IComputeRaysOutFactory computeRaysOutFactory)voidsetFrequencyFieldPrepend(String frequencyFieldPrepend)voidsetInputMode(SceneDatabaseInputSettings.INPUT_MODE inputMode)voidsetProfilerThread(ProfilerThread profilerThread)Computation stacks and timing are collected by this class in order to profile the execution of the simulationvoidsetPropagationProcessDataFactory(NoiseMapByReceiverMaker.TableLoader tableLoader)Do not call this method afterinitialize(Connection, ProgressVisitor)has been calledvoidsetSourceEmissionPrimaryKeyField(String sourceEmissionPrimaryKeyField)voidsetSourcesEmissionTableName(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.voidsetThreadCount(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:
SQLExceptionIOException
-
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:
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
-
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:
initializein 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
-
-