Class EmissionTableGenerator


  • public class EmissionTableGenerator
    extends Object
    Create emission table from traffic data (RAIL or ROADS)
    • Field Detail

      • roadOctaveFrequencyBands

        public static final List<Integer> roadOctaveFrequencyBands
      • STANDARD_PERIOD_VALUE

        public static final String[] STANDARD_PERIOD_VALUE
      • EVENING_RATIO

        public static final double EVENING_RATIO
      • NIGHT_RATIO

        public static final double NIGHT_RATIO
      • RATIOS

        public static final double[] RATIOS
    • Constructor Detail

      • EmissionTableGenerator

        public EmissionTableGenerator()
    • Method Detail

      • cacheFields

        public static void cacheFields​(Map<String,​Integer> sourceFieldsCache,
                                       ResultSet rs)
                                throws SQLException
        Cache table fields in upper case in Map
        Parameters:
        sourceFieldsCache - map
        rs - table to load
        Throws:
        SQLException - If error occurred
      • getEmissionFromTrafficTable

        public static double[] getEmissionFromTrafficTable​(ResultSet rs,
                                                           String period,
                                                           double slope,
                                                           int coefficientVersion,
                                                           Map<String,​Integer> sourceFieldsCache)
                                                    throws SQLException
        Retrieves the emissions for the specified period from the given result set
        Parameters:
        rs - result set of source
        period - optional column name to add after attribute fields _D or _E or _N
        slope - Default, gradient percentage of road from -12 % to 12 %
        coefficientVersion - Cnossos coefficient version (1 = 2015, 2 = 2020)
        Returns:
        Emission spectrum in dB
        Throws:
        SQLException
      • computeLw

        public static double[][] computeLw​(org.h2gis.utilities.SpatialResultSet rs,
                                           int coefficientVersion,
                                           Map<String,​Integer> sourceFieldsCache)
                                    throws SQLException
        Computes the sound levels (Lw) for different periods based on the provided spatial result set.
        Parameters:
        rs - Result set on a road record
        coefficientVersion - Cnossos coefficient version (1 = 2015, 2 = 2020)
        sourceFieldsCache - SQL Fields cache
        Returns:
        a two-dimensional array containing the sound levels (Ld, Le, Ln) for each frequency level.
        Throws:
        SQLException - Exception while evaluating the lw
      • getSlope

        public static double getSlope​(org.h2gis.utilities.SpatialResultSet rs)
      • getSlope

        public static double getSlope​(org.locationtech.jts.geom.Geometry g)
      • makeTrainLWTable

        public static void makeTrainLWTable​(Connection connection,
                                            String railSectionTableName,
                                            String railTrafficTableName,
                                            String outputTable,
                                            String frequencyPrepend,
                                            String vehicleDataFile,
                                            String trainSetDataFile,
                                            String railwayEmissionDataFile)
                                     throws SQLException
        Generate Train emission from train geometry tracks and train traffic
        Parameters:
        connection - Database connection
        railSectionTableName - Table name of rail sections
        railTrafficTableName - Table name of rail traffic
        outputTable - Output table name
        frequencyPrepend - Prepend to frequency columns (e.g. "HZ_")
        vehicleDataFile - File path Url or resource filename (from org.noise_planet.noisemodelling.emission.railway package) for vehicle data configuration.
        trainSetDataFile - File path Url or resource filename (from org.noise_planet.noisemodelling.emission.railway package) for train set data configuration.
        railwayEmissionDataFile - File path Url or resource filename (from org.noise_planet.noisemodelling.emission.railway package) for railway metadata configuration.
        Throws:
        SQLException - If error occurred