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.
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
    • groundSurfaceSplitSideLength

      protected double groundSurfaceSplitSideLength
    • frequencyArray

      public List<Integer> frequencyArray
    • exactFrequencyArray

      public List<Double> exactFrequencyArray
    • aWeightingArray

      public List<Double> aWeightingArray
    • 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:
    • fetchSize

      protected int fetchSize
    • directionAttributes

      public Map<Integer,DirectivitySphere> 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:
      initialize in interface NoiseMapByReceiverMaker.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

      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 AttenuationParameters representing 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.TableLoader
      Called on each sub-domain in order to create cell input data.
      Specified by:
      create in interface NoiseMapByReceiverMaker.TableLoader
      Parameters:
      connection - Active connection
      cellIndex - Active cell covering the computation
      skipReceivers - 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 - Connection
      tableName - Table name
      defaultInterpolation - Interpolation if applicable
      frequencyFieldPrepend - 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 table
      fetchEnvelope - 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 table
      fetchEnvelope - 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 feed
      geometryFactory - 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 connection
      fetchEnvelope - Fetch envelope
      scene - (Out) Propagation process input data
      Throws:
      SQLException