diff --git a/wps_scripts/src/main/groovy/org/noise_planet/noisemodelling/wps/Experimental_Matsim/Traffic_From_Events.groovy b/wps_scripts/src/main/groovy/org/noise_planet/noisemodelling/wps/Experimental_Matsim/Traffic_From_Events.groovy index ceb84073b..ae748abbf 100644 --- a/wps_scripts/src/main/groovy/org/noise_planet/noisemodelling/wps/Experimental_Matsim/Traffic_From_Events.groovy +++ b/wps_scripts/src/main/groovy/org/noise_planet/noisemodelling/wps/Experimental_Matsim/Traffic_From_Events.groovy @@ -292,7 +292,10 @@ def exec(Connection connection, input) { PreparedStatement roadStatement = connection.prepareStatement("INSERT INTO " + outTableName + " (LINK_ID, OSM_ID, THE_GEOM) VALUES (?, ?, ST_UpdateZ(ST_GeomFromText(?, " + SRID + "),0.05))") PreparedStatement lwStatement = connection.prepareStatement("INSERT INTO " + lwTableName + " (LINK_ID, LW63, LW125, LW250, LW500, LW1000, LW2000, LW4000, LW8000, TIME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") - PreparedStatement trafficStatement = connection.prepareStatement("INSERT INTO " + trafficTableName + " (LINK_ID, LV_D, LV_SPD_D, MV_D, MV_SPD_D, HGV_D, HGV_SPD_D, TIME) VALUES (?, ?, ?, ?, ?, ?, ?, ?)") + PreparedStatement trafficStatement; + if (exportTraffic) { + trafficStatement = connection.prepareStatement("INSERT INTO " + trafficTableName + " (LINK_ID, LV_D, LV_SPD_D, MV_D, MV_SPD_D, HGV_D, HGV_SPD_D, TIME) VALUES (?, ?, ?, ?, ?, ?, ?, ?)") + } PreparedStatement contribStatement; if (keepVehicleContrib) { contribStatement = connection.prepareStatement("INSERT INTO " + contribTableName + " (LINK_ID, PERSON_ID, VEHICLE_ID, LW63, LW125, LW250, LW500, LW1000, LW2000, LW4000, LW8000, TIME) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")