From 3569a703acc3aaaee32a816d3cc585258e4835c5 Mon Sep 17 00:00:00 2001 From: nicolas-f <1382241+nicolas-f@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:19:03 +0100 Subject: [PATCH] Fix failed merge with geometry in output tables --- .../noisemodelling/jdbc/NoiseMapMaker.java | 2 +- .../jdbc/NoiseMapParameters.java | 22 +++++++++++++++++++ .../noisemodelling/jdbc/NoiseMapWriter.java | 21 ++++++++++++++++-- .../Noise_level_from_source.groovy | 2 +- .../Noise_level_from_traffic.groovy | 2 +- .../Road_Emission_from_Traffic.groovy | 8 +++---- .../Traffic_Probabilistic_Modelling.groovy | 5 ----- .../wps/TestAcousticTools.groovy | 7 +----- .../wps/TestNoiseModelling.groovy | 15 +++++-------- .../noisemodelling/wps/TestTutorials.groovy | 19 ++++++++-------- 10 files changed, 65 insertions(+), 38 deletions(-) diff --git a/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapMaker.java b/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapMaker.java index b49f10fc8..f37a142b6 100644 --- a/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapMaker.java +++ b/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapMaker.java @@ -26,7 +26,7 @@ import java.util.*; /** - * + * Create SQL Tables from a stream of noise levels */ public class NoiseMapMaker implements NoiseMapByReceiverMaker.PropagationProcessDataFactory, NoiseMapByReceiverMaker.IComputeRaysOutFactory, ProfilerThread.Metric { NoiseMapParameters noiseMapParameters; diff --git a/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapParameters.java b/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapParameters.java index 85d9669c2..5526fd4b5 100644 --- a/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapParameters.java +++ b/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapParameters.java @@ -69,6 +69,28 @@ public int getMaximumRaysOutputCount() { Boolean sqlOutputFileCompression = true; Boolean dropResultsTable = true; public boolean computeLAEQOnly = false; + + /** + * If true the position of the receiver (with the altitude if available) will be exported into the results tables + */ + boolean exportReceiverPosition = false; + + /** + * @return If true the position of the receiver (with the altitude if available) will be exported into the results + * tables + */ + public boolean isExportReceiverPosition() { + return exportReceiverPosition; + } + + /** + * @param exportReceiverPosition If true the position of the receiver (with the altitude if available) will be + * exported into the results tables + */ + public void setExportReceiverPosition(boolean exportReceiverPosition) { + this.exportReceiverPosition = exportReceiverPosition; + } + /** * @param maximumRaysOutputCount if export rays, do not keep more than this number of rays per computation area (0 infinite) */ diff --git a/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapWriter.java b/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapWriter.java index e5f7b911f..7c3856b21 100644 --- a/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapWriter.java +++ b/noisemodelling-jdbc/src/main/java/org/noise_planet/noisemodelling/jdbc/NoiseMapWriter.java @@ -9,7 +9,9 @@ package org.noise_planet.noisemodelling.jdbc; +import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; +import org.locationtech.jts.geom.PrecisionModel; import org.noise_planet.noisemodelling.jdbc.utils.StringPreparedStatements; import org.noise_planet.noisemodelling.propagation.cnossos.CnossosPath; import org.noise_planet.noisemodelling.propagation.Attenuation; @@ -29,7 +31,9 @@ import static org.noise_planet.noisemodelling.pathfinder.utils.AcousticIndicatorsFunctions.*; import static org.noise_planet.noisemodelling.pathfinder.utils.AcousticIndicatorsFunctions.dbaToW; - +/** + * Process that run SQL query to feed tables + */ public class NoiseMapWriter implements Runnable { Logger LOGGER = LoggerFactory.getLogger(NoiseMapWriter.class); File sqlFilePath; @@ -140,6 +144,9 @@ void processStack(String tableName, ConcurrentLinkedDeque