Class EmissionTableGenerator
- java.lang.Object
-
- org.noise_planet.noisemodelling.jdbc.EmissionTableGenerator
-
public class EmissionTableGenerator extends Object
Create emission table from traffic data (RAIL or ROADS)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEmissionTableGenerator.STANDARD_PERIOD
-
Field Summary
Fields Modifier and Type Field Description static doubleDAY_RATIOstatic StringDEN_PERIODstatic doubleEVENING_RATIOstatic doubleNIGHT_RATIOstatic double[]RATIOSstatic List<Integer>roadOctaveFrequencyBandsstatic String[]STANDARD_PERIOD_VALUE
-
Constructor Summary
Constructors Constructor Description EmissionTableGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcacheFields(Map<String,Integer> sourceFieldsCache, ResultSet rs)Cache table fields in upper case in Mapstatic double[][]computeLw(org.h2gis.utilities.SpatialResultSet rs, int coefficientVersion, Map<String,Integer> sourceFieldsCache)Computes the sound levels (Lw) for different periods based on the provided spatial result set.static double[]getEmissionFromTrafficTable(ResultSet rs, String period, double slope, int coefficientVersion, Map<String,Integer> sourceFieldsCache)Retrieves the emissions for the specified period from the given result setstatic doublegetSlope(org.h2gis.utilities.SpatialResultSet rs)static doublegetSlope(org.locationtech.jts.geom.Geometry g)static voidmakeTrainLWTable(Connection connection, String railSectionTableName, String railTrafficTableName, String outputTable, String frequencyPrepend, String vehicleDataFile, String trainSetDataFile, String railwayEmissionDataFile)Generate Train emission from train geometry tracks and train traffic
-
-
-
Field Detail
-
DEN_PERIOD
public static final String DEN_PERIOD
- See Also:
- Constant Field Values
-
STANDARD_PERIOD_VALUE
public static final String[] STANDARD_PERIOD_VALUE
-
DAY_RATIO
public static final double DAY_RATIO
- See Also:
- Constant Field Values
-
EVENING_RATIO
public static final double EVENING_RATIO
-
NIGHT_RATIO
public static final double NIGHT_RATIO
-
RATIOS
public static final double[] RATIOS
-
-
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- maprs- 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 sourceperiod- optional column name to add after attribute fields _D or _E or _Nslope- 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 SQLExceptionComputes the sound levels (Lw) for different periods based on the provided spatial result set.- Parameters:
rs- Result set on a road recordcoefficientVersion- 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 connectionrailSectionTableName- Table name of rail sectionsrailTrafficTableName- Table name of rail trafficoutputTable- Output table namefrequencyPrepend- 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
-
-