Class DefaultTableLoader
java.lang.Object
org.noise_planet.noisemodelling.jdbc.input.DefaultTableLoader
- All Implemented Interfaces:
NoiseMapByReceiverMaker.TableLoader
Default implementation for initializing input propagation process data for noise map computation.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionDefine attenuation settings to apply for each periodstatic final intAttenuation and other attributes relative to direction on sphereprotected intprotected doubleprotected static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(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)Retrieves the A-weighting correction array used within the class.Retrieves the parameters defined for different time periods.Retrieves the exact frequency array used within the class.intRetrieves 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.voidInserts directivity attributes for noise sources for trains into the directionAttributes map.
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
groundSurfaceSplitSideLength
protected double groundSurfaceSplitSideLength -
frequencyArray
-
exactFrequencyArray
-
aWeightingArray
-
cnossosParametersPerPeriod
Define attenuation settings to apply for each period -
defaultParameters
-
DEFAULT_FETCH_SIZE
public static final int DEFAULT_FETCH_SIZE- See Also:
-
fetchSize
protected int fetchSize -
directionAttributes
Attenuation and other attributes relative to direction on sphere
-
-
Constructor Details
-
DefaultTableLoader
public DefaultTableLoader()
-
-
Method Details
-
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- if a database access error occurs during initialization.
-
getFrequencyArray
Retrieves the frequency array used within the class.- Returns:
- a list of integers representing the frequency values in the array.
-
getExactFrequencyArray
Retrieves the exact frequency array used within the class.- Returns:
- a list of doubles representing the exact frequency values in the array.
-
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
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
-
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:
- Map of directivity spheres
- 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
-