Class NoiseMapWriter

java.lang.Object
org.noise_planet.noisemodelling.jdbc.output.NoiseMapWriter
All Implemented Interfaces:
Callable<Boolean>

public class NoiseMapWriter extends Object implements Callable<Boolean>
Process that run SQL query to feed tables
  • Field Details

    • frequencyArray

      public List<Integer> frequencyArray
    • aWeightingArray

      public double[] aWeightingArray
  • Constructor Details

    • NoiseMapWriter

      public NoiseMapWriter(Connection connection, NoiseMapByReceiverMaker noiseMapByReceiverMaker, ResultsCache ResultsCache, AtomicBoolean exitWhenDone, AtomicBoolean aborted)
      Constructs a new NoiseMapWriter object with the specified parameters.
      Parameters:
      connection - the database connection used for writing data
      noiseMapByReceiverMaker - the parameters defining the noise map computation
      ResultsCache - the attenuated paths containing computed noise data
  • Method Details

    • createJsonWriter

      public static com.fasterxml.jackson.databind.ObjectWriter createJsonWriter()
    • attenuationOutputAsJSON

      public String attenuationOutputAsJSON(AttenuationOutput attenuationOutput) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • jsonToAttenuationOutput

      public static AttenuationOutput jsonToAttenuationOutput(String json) throws com.fasterxml.jackson.core.JsonProcessingException
      Deserialize AttenuationOutput object or AttenuationOutput child object. Note: the FAIL_ON_UNKNOWN_PROPERTIES feature ensure that the deserialization won't fail for children of AttenuationOutput with additional attributes.
      Parameters:
      json - The serialized AttenuationOutput
      Returns:
      Deserialized AttenuationOutput object
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the deserialization fails
    • init

      public void init() throws SQLException, IOException
      Initializes the noise map calculation by setting up required database tables based on the specified parameters.
      Throws:
      SQLException - if an SQL exception occurs while executing the query
      IOException - if an I/O error occurs while processing the query
    • call

      public Boolean call() throws Exception
      Executes the SQL writing process.
      Specified by:
      call in interface Callable<Boolean>
      Throws:
      Exception