Class EmissionTableGenerator
java.lang.Object
org.noise_planet.noisemodelling.jdbc.EmissionTableGenerator
Create emission table from traffic data (RAIL or ROADS)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
roadOctaveFrequencyBands
-
DEN_PERIOD
- See Also:
-
STANDARD_PERIOD_VALUE
-
DAY_RATIO
public static final double DAY_RATIO- See Also:
-
EVENING_RATIO
public static final double EVENING_RATIO -
NIGHT_RATIO
public static final double NIGHT_RATIO -
RATIOS
public static final double[] RATIOS
-
-
Constructor Details
-
EmissionTableGenerator
public EmissionTableGenerator()
-
-
Method Details
-
cacheFields
public static void cacheFields(Map<String, Integer> sourceFieldsCache, ResultSet rs) throws SQLExceptionCache 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 SQLExceptionRetrieves 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
-