### Build Documentation with Sphinx Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Readme.md Navigate to the Docs directory, install dependencies, and build the HTML documentation using Sphinx. ```bash cd Docs/ pip install -r requirements.txt sphinx-build -M html ./ build ``` -------------------------------- ### Launch NoiseModelling GUI on Windows Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Get_Started_GUI.md Execute this command in a Windows command prompt to start the NoiseModelling local server and access the GUI. ```batch NoiseModelling.exe ``` ```batch NoiseModelling_xxx\start_windows.bat ``` -------------------------------- ### Automate NoiseModelling workflow with Bash script Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Get_Started_Script.md A Bash script to automate the 'Get Started' tutorial steps. It sequentially imports various shapefiles and GeoJSON data, runs the noise level calculation, and exports the results. Use the appropriate `ScriptRunner` executable for your OS. ```bash #! /bin/bash # Run the get started turorial # https://noisemodelling.readthedocs.io/en/latest/Get_Started_Tutorial.html # Step 4: Upload files to database # create (or load existing) database and load a shape file into the database ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Import_File.groovy --pathFile resources/ground_type.shp ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Import_File.groovy --pathFile resources/buildings.shp ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Import_File.groovy --pathFile resources/receivers.shp ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Import_File.groovy --pathFile resources/ROADS2.shp ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Import_File.groovy --pathFile resources/dem.geojson # Step 5: Run Calculation ./bin/ScriptRunner -w ./ -s scripts/NoiseModelling/Noise_level_from_traffic.groovy --tableBuilding BUILDINGS --tableRoads ROADS2 --tableReceivers RECEIVERS --tableDEM DEM --tableGroundAbs GROUND_TYPE # Step 6: Export (& see) the results ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Export_Table.groovy --exportPath RECEIVERS_LEVEL.shp --tableToExport RECEIVERS_LEVEL ``` -------------------------------- ### Launch NoiseModelling GUI on Linux/macOS Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Get_Started_GUI.md Run this command in a Linux or macOS terminal to start the NoiseModelling local server. Ensure the script has execute permissions. ```bash NoiseModelling_xxx/start_linux_macos.sh ``` -------------------------------- ### Start NoiseModelling Service with Docker Compose Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Architecture.md Use this command to start the NoiseModelling service in detached mode. Ensure docker-compose.yml is in the current directory. ```bash docker compose up -d ``` -------------------------------- ### Start NoiseModelling Service with Podman Compose Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Architecture.md Use this command to start the NoiseModelling service in detached mode with Podman. Ensure docker-compose.yml is in the current directory. ```bash podman compose up -d ``` -------------------------------- ### Verify JAVA_HOME Setting Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Requirements.md Confirm that the JAVA_HOME environment variable has been set correctly by echoing its value. The output should display the path to your Java installation directory. ```default echo $JAVA_HOME ``` -------------------------------- ### Set JAVA_HOME and PATH on Linux Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Requirements.md Configure the JAVA_HOME environment variable and update the system's PATH to include the Java binary directory. Adapt the path to your specific Java installation. ```default export JAVA_HOME=/usr/lib/jvm/java-22-openjdk-amd64 export PATH="$JAVA_HOME/bin:$PATH" ``` -------------------------------- ### Check Java Version Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Requirements.md Verify if Java is already installed and check its version. The command should output a version number starting with 11 or higher. ```default java -version ``` -------------------------------- ### Custom Initialization with jQuery Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/noisemodelling-scripts/src/main/resources/org/noise_planet/noisemodelling/webserver/static/wpsbuilder/vendor/highlight/README.md This example demonstrates how to manually highlight code blocks using highlightBlock within a jQuery document ready function. It iterates over all pre code elements. ```javascript $(document).ready(function() { $('pre code').each(function(i, block) { hljs.highlightBlock(block); }); }); ``` -------------------------------- ### Find Java Installation Path on Linux Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Requirements.md Determine the installation path of the Java executable on Linux. This path is used to set the JAVA_HOME environment variable. ```default readlink -f "$(command -v java)" ``` -------------------------------- ### NoiseModelling Unit Tests Reference Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Validation.md Links to the NoiseModelling project repository for unit tests and specific examples of implementation validation. ```markdown [code](https://github.com/Universite-Gustave-Eiffel/NoiseModelling/) ``` ```markdown here](https://github.com/Universite-Gustave-Eiffel/NoiseModelling/blob/4.X/noisemodelling-jdbc/src/test/java/org/noise_planet/noisemodelling/jdbc/EvaluateAttenuationCnossosTest.java) ``` ```markdown TCxx](https://github.com/Universite-Gustave-Eiffel/NoiseModelling/blob/621ec99568ac14d72ef78557cfc2ee910a72c138/noisemodelling-jdbc/src/test/java/org/noise_planet/noisemodelling/jdbc/EvaluateAttenuationCnossosTest.java#L453) ``` ```markdown [ISO/TR 17534-4:2020](https://www.iso.org/standard/72115.html) ``` -------------------------------- ### Get Java Home Directory on macOS Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Requirements.md Retrieve the directory path for the Java installation on macOS, which is used to set the JAVA_HOME environment variable. ```default /usr/libexec/java_home -v latest ``` -------------------------------- ### Initialize WPS Client and UI Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/noisemodelling-scripts/src/main/resources/org/noise_planet/noisemodelling/webserver/thymeleaf/wpsbuilder_index.html Sets up the WPS client and UI components. It fetches grouped processes from the server, sorts them alphabetically, and dynamically creates the UI elements for each process category and individual process. This code is essential for the interactive builder functionality. ```javascript var url = 'ows'; var wpsclient = new wps.client({ servers: { 'wpsgui': url } }); var wpsui; wpsclient.getGroupedProcesses('wpsgui', function(groups) { wpsui = new wps.ui({ client: wpsclient, defaultServer: 'wpsgui', getVectorLayers: true, parentContainer: $('.palette-scroll'), dropZone: $("#chart") }); // Sort groups alphabetically const sortedGroups = Object.keys(groups).sort(); for (let group of sortedGroups) { let content = wpsui.createProcessCategory(group); // Sort processes alphabetically by identifier.value groups[group].sort((a, b) => { const idA = a.value.identifier.value.toUpperCase(); const idB = b.value.identifier.value.toUpperCase(); return idA.localeCompare(idB); }); for (let i=0, ii=groups[group].length; i 0: print(f" Allowed values: {data_input.allowedValues}") if hasattr(data_input, 'defaultValue') and data_input.defaultValue is not None: print(f" Default : {data_input.defaultValue}") print("") if __name__ == "__main__": main() ``` -------------------------------- ### Execute All Possible Configuration WPS Script Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Data_Assimilation.md Run the All_Possible_Configuration WPS script using command line arguments to generate all traffic and temperature combinations. ```bash ./bin/wps_scripts -w ./ -s scripts/Data_Assimilation/All_Possible_Configuration.groovy -trafficValues "0.01,1,2" -temperatureValues "10,15,20" ``` -------------------------------- ### GeoJSON Point Source Data Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Noise_Map_From_Point_Source.md This is an example of a GeoJSON file representing a single point source with its attributes and geometry. It can be opened and viewed in most text editors. ```default { "type": "FeatureCollection", "name": "Point_Source", "crs": {"type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::2154" } }, "features": [{"type": "Feature", "properties": { "PK": 1, "HZD500": 90.0 }, "geometry": {"type": "Point", "coordinates": [223771.0727, 6757583.2983, 0.0]} }] } ``` -------------------------------- ### Compile and Run Unit Tests Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/noisemodelling-tutorial-01/Readme.md Compiles the project with Maven and executes the unit tests. ```bash mvn clean test ``` -------------------------------- ### Basic Highlight.js Initialization Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/noisemodelling-scripts/src/main/resources/org/noise_planet/noisemodelling/webserver/static/wpsbuilder/vendor/highlight/README.md Include these files and call initHighlightingOnLoad to automatically highlight code blocks on your web page. Specify a default CSS style for the highlighting. ```html ``` -------------------------------- ### Extract Best Configuration using Extract_Best_Configuration Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Data_Assimilation.md Execute the Extract_Best_Configuration WPS script to identify the best noise map. This script compares simulated noise levels with observed measurements and selects the map with the smallest median LAEQ difference, considering a temperature tolerance. ```groovy new Extract_Best_Configuration().exec(connection,[ "observationTable": "SENSORS_MEASUREMENTS_TRAINING", "noiseMapTable": "RECEIVERS_LEVEL", "tempToleranceThreshold" : 5 ]) ``` -------------------------------- ### View NoiseModelling Service Logs with Podman Compose Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Architecture.md Follow the instructions in the logs to register the administrator account. This command shows logs for the noisemodelling service when using Podman Compose. ```bash podman compose logs noisemodelling ``` -------------------------------- ### Run a single Groovy script with ScriptRunner Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Get_Started_Script.md Execute a specific WPS script like `Import_File.groovy` using `ScriptRunner`. Ensure the working directory and script paths are correct. Adapt the installation path for your system. ```bash cd /home/user/NoiseModelling/ ./bin/ScriptRunner -w ./ -s scripts/Import_and_Export/Import_File.groovy --pathFile resources/ground_type.shp ``` -------------------------------- ### View NoiseModelling Service Logs with Docker Compose Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Architecture.md Follow the instructions in the logs to register the administrator account. This command shows logs for the noisemodelling service when using Docker Compose. ```bash docker compose logs noisemodelling ``` -------------------------------- ### H2GIS Database Connection and Queries Source: https://context7.com/universite-gustave-eiffel/noisemodelling/llms.txt Provides connection settings for accessing the embedded H2GIS database externally using DBeaver or the H2/H2GIS web client. Includes example SQL queries to inspect table names, receiver levels, and count receivers exceeding a certain dB threshold. ```text # DBeaver connection settings (H2GIS Embedded driver): Path: /home/user/.noisemodelling/user_001;AUTO_SERVER=TRUE User: sa Password: sa # H2/H2GIS web client JDBC URL: jdbc:h2:/home/user/.noisemodelling/user_001;AUTO_SERVER=TRUE # Useful SQL queries in the database console: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC'; -- Inspect receiver levels for the DEN period SELECT r.IDRECEIVER, r.LAEQ, r.THE_GEOM FROM RECEIVERS_LEVEL r WHERE r.PERIOD = 'DEN' ORDER BY r.LAEQ DESC LIMIT 20; -- Count receivers above 65 dB(A) Lden SELECT COUNT(*) AS exposed_count FROM RECEIVERS_LEVEL WHERE PERIOD = 'DEN' AND LAEQ > 65; ``` -------------------------------- ### Import Buildings Shapefile Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Get_Started_GUI.md Configure and run the 'Import File' block in the WPS Builder to load the buildings.shp file into the NoiseModelling database. Ensure the 'pathFile' field is correctly set. ```json { "pathFile": "resources/buildings.shp" } ``` -------------------------------- ### Execute All Possible Configuration with Groovy Script Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Data_Assimilation.md Execute the All_Possible_Configuration WPS script within a Groovy environment, passing traffic and temperature values as a map. ```groovy new All_Possible_Configuration().exec(connection,[ "trafficValues": "0.01,1.0,2.0", "temperatureValues": "10,15,20" ]) ``` -------------------------------- ### Run PostGIS Docker Container Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/noisemodelling-tutorial-01/Readme.md Launches a PostGIS Docker container for unit tests. Ensure the container is stopped and removed after use. ```bash docker run -d --name noisemodelling-postgres \ -p 5432:5432 \ -e POSTGRES_USER=noisemodelling \ -e POSTGRES_PASSWORD=noisemodelling \ -e POSTGRES_DB=noisemodelling_db \ --health-cmd='pg_isready' \ --health-interval=10s \ --health-timeout=5s \ --health-retries=5 \ postgis/postgis:16-3.4 ``` -------------------------------- ### Deploy NoiseModelling with Docker Compose Source: https://context7.com/universite-gustave-eiffel/noisemodelling/llms.txt Set up NoiseModelling as a containerized service using Docker. Configure environment variables for URL routing and security. Access the GUI via the specified port and path. ```yaml # docker-compose.yml (download from repository root) services: noisemodelling: image: ghcr.io/universite-gustave-eiffel/noisemodelling:latest ports: - "8000:8000" environment: PROXY_BASE_URL: "http://localhost" # Set to your domain for production ROOT_URL: "/noisemodelling" # URL prefix; empty = base URL UNSECURE_MODE: "false" # true = disable TOTP registration ``` ```bash docker compose up -d docker compose logs noisemodelling # Follow logs to complete admin registration # Access GUI at http://localhost:8000/noisemodelling ``` -------------------------------- ### Implement Main Execution Method for WPS Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Own_Wps.md The main 'exec' method handles the core logic, accepting a SQL connection, input parameters, and a progress visitor. It returns a map of results. ```groovy /** * Main method * @param connection SQL Connection * @param input Map of inputs, should provide the same keys as described in the input metadata * @param progress Can be used to display the progression of the computation, and to check if the user canceled the execution * @return A map as described in the result metadata * @throws SQLException if something went wrong */ def exec(Connection connection, Map inputs, ProgressVisitor progress) { Sql sql = new Sql(connection) // Get the parameter value. For optional parameters, do not forget to provide a default value in the metadata. def myTableName = inputs.my_optional_parameter sql.execute("CREATE TABLE IF NOT EXISTS $myTableName(PK SERIAL PRIMARY KEY, DATA INTEGER)".toString()) return [result : '$myTableName'] } ``` -------------------------------- ### Execute WPS Process Asynchronously with OwsLib Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/WPS_Builder.md This script demonstrates how to execute a WPS process asynchronously using the OwsLib library. It includes monitoring the execution progress and retrieving results upon successful completion. Ensure the JWT token is correctly set for authentication. ```python import logging import sys from owslib.wps import WebProcessingService, monitorExecution def main(): # Configure the root logger to output to stdout logging.basicConfig(stream=sys.stdout, level=logging.INFO) url = "http://localhost:8000/builder/ows" # use java web token for authentification jwt_token = "" wps = WebProcessingService(url, skip_caps=False, headers={"Authorization": jwt_token}) target_id = "Database_Manager:Display_Database" inputs = [('showColumns', "true")] # Execute (sync or async) execution = wps.execute(target_id, inputs) # Monitor progress if it's a long task monitorExecution(execution, sleepSecs=2) if execution.isSucceded(): for output in execution.processOutputs: print(f"Result {output.identifier}: {output.data}") else: print("Execution failed.") if __name__ == "__main__": main() ``` -------------------------------- ### Import Ground Type Shapefile Source: https://github.com/universite-gustave-eiffel/noisemodelling/blob/main/Docs/Tutorial_Get_Started_GUI.md Configure and run the 'Import File' block to load the ground_type.shp file. Set the 'pathFile' field to the correct resource path. ```json { "pathFile": "resources/ground_type.shp" } ```