Class DefaultTableLoader
- java.lang.Object
-
- org.noise_planet.noisemodelling.jdbc.input.DefaultTableLoader
-
- All Implemented Interfaces:
NoiseMapByReceiverMaker.TableLoader
public class DefaultTableLoader extends Object implements NoiseMapByReceiverMaker.TableLoader
Default implementation for initializing input propagation process data for noise map computation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultTableLoader.BuildingTableParameters
-
Field Summary
Fields Modifier and Type Field Description List<Double>aWeightingArrayMap<String,AttenuationParameters>cnossosParametersPerPeriodDefine attenuation settings to apply for each periodstatic intDEFAULT_FETCH_SIZEAttenuationParametersdefaultParametersMap<Integer,DirectivitySphere>directionAttributesAttenuation and other attributes relative to direction on sphereList<Double>exactFrequencyArrayprotected intfetchSizeList<Integer>frequencyArrayprotected doublegroundSurfaceSplitSideLengthprotected static org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description DefaultTableLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SceneWithEmissioncreate(Connection connection, CellIndex cellIndex, Set<Long> skipReceivers)Called on each sub-domain in order to create cell input data.static voidfetchCellBuildings(Connection connection, DefaultTableLoader.BuildingTableParameters buildingTableParameters, org.locationtech.jts.geom.Envelope fetchEnvelope, List<Building> buildings, List<Wall> walls, org.locationtech.jts.geom.GeometryFactory geometryFactory)Fetches building data for the specified cell envelope and adds them to the provided list of buildings.static voidfetchCellBuildings(Connection connection, DefaultTableLoader.BuildingTableParameters buildingTableParameters, org.locationtech.jts.geom.Envelope fetchEnvelope, ProfileBuilder builder, org.locationtech.jts.geom.GeometryFactory geometryFactory)Fetches buildings data for the specified cell envelope and adds them to the profile builder.protected voidfetchCellDem(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, ProfileBuilder profileBuilder)Fetches digital elevation model (DEM) data for the specified cell envelope and adds it to the mesh.protected voidfetchCellSoilAreas(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, ProfileBuilder builder)Fetches soil areas data for the specified cell envelope and adds them to the profile builder.voidfetchCellSource(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, SceneWithEmission scene, boolean doIntersection)Fetch source geometries and powerstatic Map<Integer,DirectivitySphere>fetchDirectivity(Connection connection, String tableName, int defaultInterpolation, String frequencyFieldPrepend)The table shall contain the following fields : DIR_ID : identifier of the directivity sphere (INTEGER) THETA : Horizontal angle in degree. 0° front and 90° right (0-360) (FLOAT) PHI : Vertical angle in degree. 0° front and 90° top -90° bottom (-90 - 90) (FLOAT) HZ63, HZ125, HZ250, HZ500, HZ1000, HZ2000, HZ4000, HZ8000 : attenuation levels in dB for each octave or third octave (FLOAT)List<Double>getaWeightingArray()Retrieves the A-weighting correction array used within the class.Map<String,AttenuationParameters>getCnossosParametersPerPeriod()Retrieves the parameters defined for different time periods.Map<Integer,DirectivitySphere>getDirectionAttributes()List<Double>getExactFrequencyArray()Retrieves the exact frequency array used within the class.intgetFetchSize()List<Integer>getFrequencyArray()Retrieves the frequency array used within the class.voidinitialize(Connection connection, NoiseMapByReceiverMaker noiseMapByReceiverMaker)Initializes the NoiseMap parameters and attenuation data based on the input mode specified in the NoiseMap parameters.voidinsertTrainDirectivity()Inserts directivity attributes for noise sources for trains into the directionAttributes map.
-
-
-
Field Detail
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
groundSurfaceSplitSideLength
protected double groundSurfaceSplitSideLength
-
cnossosParametersPerPeriod
public Map<String,AttenuationParameters> cnossosParametersPerPeriod
Define attenuation settings to apply for each period
-
defaultParameters
public AttenuationParameters defaultParameters
-
DEFAULT_FETCH_SIZE
public static final int DEFAULT_FETCH_SIZE
- See Also:
- Constant Field Values
-
fetchSize
protected int fetchSize
-
directionAttributes
public Map<Integer,DirectivitySphere> directionAttributes
Attenuation and other attributes relative to direction on sphere
-
-
Method Detail
-
insertTrainDirectivity
public void insertTrainDirectivity()
Inserts directivity attributes for noise sources for trains into the directionAttributes map.
-
initialize
public void initialize(Connection connection, NoiseMapByReceiverMaker noiseMapByReceiverMaker) throws SQLException
Initializes the NoiseMap parameters and attenuation data based on the input mode specified in the NoiseMap parameters.- Specified by:
initializein interfaceNoiseMapByReceiverMaker.TableLoader- Parameters:
connection- the database connection to be used for initialization.noiseMapByReceiverMaker- the noise map by receiver maker object associated with the computation process.- Throws:
SQLException
-
getFrequencyArray
public List<Integer> getFrequencyArray()
Retrieves the frequency array used within the class.- Returns:
- a list of integers representing the frequency values in the array.
-
getExactFrequencyArray
public List<Double> getExactFrequencyArray()
Retrieves the exact frequency array used within the class.- Returns:
- a list of doubles representing the exact frequency values in the array.
-
getaWeightingArray
public List<Double> getaWeightingArray()
Retrieves the A-weighting correction array used within the class. A-weighting is applied to account for the varying sensitivity of human hearing to different frequencies, commonly used in acoustic measurements.- Returns:
- a list of doubles representing the A-weighting correction values.
-
getCnossosParametersPerPeriod
public Map<String,AttenuationParameters> getCnossosParametersPerPeriod()
Retrieves the parameters defined for different time periods.- Returns:
- a map where the keys represent the time periods (e.g., "D", "E", "N") as strings,
and the values are instances of
AttenuationParametersrepresenting the corresponding parameters.
-
getFetchSize
public int getFetchSize()
-
getDirectionAttributes
public Map<Integer,DirectivitySphere> getDirectionAttributes()
-
create
public SceneWithEmission create(Connection connection, CellIndex cellIndex, Set<Long> skipReceivers) throws SQLException
Description copied from interface:NoiseMapByReceiverMaker.TableLoaderCalled on each sub-domain in order to create cell input data.- Specified by:
createin interfaceNoiseMapByReceiverMaker.TableLoader- Parameters:
connection- Active connectioncellIndex- Active cell covering the computationskipReceivers- Do not process the receivers primary keys in this set and once included add the new receivers primary in it- Returns:
- Scene to feed the data
- Throws:
SQLException
-
fetchDirectivity
public static Map<Integer,DirectivitySphere> fetchDirectivity(Connection connection, String tableName, int defaultInterpolation, String frequencyFieldPrepend) throws SQLException
The table shall contain the following fields : DIR_ID : identifier of the directivity sphere (INTEGER) THETA : Horizontal angle in degree. 0° front and 90° right (0-360) (FLOAT) PHI : Vertical angle in degree. 0° front and 90° top -90° bottom (-90 - 90) (FLOAT) HZ63, HZ125, HZ250, HZ500, HZ1000, HZ2000, HZ4000, HZ8000 : attenuation levels in dB for each octave or third octave (FLOAT)- Parameters:
connection- ConnectiontableName- Table namedefaultInterpolation- Interpolation if applicablefrequencyFieldPrepend- Frequency field name ex. HZ for HZ1000- Returns:
- Throws:
SQLException
-
fetchCellBuildings
public static void fetchCellBuildings(Connection connection, DefaultTableLoader.BuildingTableParameters buildingTableParameters, org.locationtech.jts.geom.Envelope fetchEnvelope, ProfileBuilder builder, org.locationtech.jts.geom.GeometryFactory geometryFactory) throws SQLException
Fetches buildings data for the specified cell envelope and adds them to the profile builder.- Parameters:
connection- the database connection to use for querying the buildings data.buildingTableParameters- Database settings for the building tablefetchEnvelope- the envelope representing the cell to fetch buildings data for.builder- the profile builder to which the buildings data will be added.geometryFactory- geometry factory instance with SRID set.- Throws:
SQLException- if an SQL exception occurs while fetching the buildings data.
-
fetchCellBuildings
public static void fetchCellBuildings(Connection connection, DefaultTableLoader.BuildingTableParameters buildingTableParameters, org.locationtech.jts.geom.Envelope fetchEnvelope, List<Building> buildings, List<Wall> walls, org.locationtech.jts.geom.GeometryFactory geometryFactory) throws SQLException
Fetches building data for the specified cell envelope and adds them to the provided list of buildings.- Parameters:
connection- the database connection to use for querying the building data.buildingTableParameters- Database settings for the building tablefetchEnvelope- the envelope representing the cell to fetch building data for.buildings- the list to which the fetched buildings will be added.walls- Wall list to feedgeometryFactory- geometry factory instance with SRID set.- Throws:
SQLException- if an SQL exception occurs while fetching the building data.
-
fetchCellDem
protected void fetchCellDem(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, ProfileBuilder profileBuilder) throws SQLException
Fetches digital elevation model (DEM) data for the specified cell envelope and adds it to the mesh.- Parameters:
connection- the database connection to use for querying the DEM data.fetchEnvelope- the envelope representing the cell to fetch DEM data for.profileBuilder- the profile builder mesh to which the DEM data will be added.- Throws:
SQLException- if an SQL exception occurs while fetching the DEM data.
-
fetchCellSoilAreas
protected void fetchCellSoilAreas(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, ProfileBuilder builder) throws SQLException
Fetches soil areas data for the specified cell envelope and adds them to the profile builder.- Parameters:
connection- the database connection to use for querying the soil areas data.fetchEnvelope- the envelope representing the cell to fetch soil areas data for.builder- the profile builder to which the soil areas data will be added.- Throws:
SQLException- if an SQL exception occurs while fetching the soil areas data.
-
fetchCellSource
public void fetchCellSource(Connection connection, org.locationtech.jts.geom.Envelope fetchEnvelope, SceneWithEmission scene, boolean doIntersection) throws SQLException
Fetch source geometries and power- Parameters:
connection- Active connectionfetchEnvelope- Fetch envelopescene- (Out) Propagation process input data- Throws:
SQLException
-
-