TrentoPProjectFilesGenerator¶
TrentoPProjectFilesGenerator creates the spatial database of a storm sewer network for TrentoPProject and TrentoPCalibration: the empty layers of the pipes, areas and junctions, with all their fields, the table of the parameters and, for a project, the table of the commercial diameters.
The database can be a GeoPackage or H2GIS file, or a PostGIS database. In Project mode it gets the layers network_project, areas and junctions, the parameters of the design and an example series of PVC diameters, from 14 to 100 cm. In Calibration mode, the layer network_calibration, areas, junctions and the parameters of the verification. The optional parameters get their default as value, the needed ones are left empty.
An existing database is completed, not replaced: only the layers, tables and parameters it does not have yet are added. Running the module in both modes on the same database prepares the project and the calibration of a network together.
Once created, open the database in a GIS, as QGIS, draw the pipes, areas and junctions and fill their fields and the parameters, as described in preparing the data.
Details¶
The database can be a GeoPackage or H2GIS file, or a PostGIS database. For a project, it gets the layers network_project, areas and junctions, the table parameters, with the parameters of the design, and the table diameters, with an example series of PVC pipes to check and change. For a calibration, the layer network_calibration, areas, junctions and the parameters of the verification.
The optional parameters get their default as value, while the needed ones are left without value. An existing database is completed: only the layers, tables and parameters it does not have yet are added, so that the project and the calibration of a network can share one database.
Parameters¶
Creates the spatial database of a TrentoP sewer network, with its empty layers and its tables of parameters and diameters.
Toolbox folder: Hydro-Geomorphology
Status: Draft
Keywords: Sewer network, TrentoP, GeoPackage, PostGIS
Authors: Antonello Andrea, Silvia Franceschi, Daniele Andreis
Class: org.hortonmachine.modules.TrentoPProjectFilesGenerator
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
String |
The optional user of the database. |
||
|
String |
The optional password of the database. |
||
|
String |
|
The layers and parameters to create: for a project (the design of a new network) or a calibration (the verification of an existing one). Allowed values: |
|
|
CRS code |
The code of the projected reference system of the layers, in meters (ex. EPSG:32632). |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The database to create, or to complete if it exists: a GeoPackage (.gpkg) or H2GIS (.mv.db) file, or a PostGIS database, as jdbc:postgresql://host:port/database. |
Example¶
The example creates a GeoPackage for both the project and the calibration of a network:
import org.hortonmachine.modules.TrentoPProjectFilesGenerator
// the folder where to create the database: change it to yours
var folder = "/data/sewer/"
// a new GeoPackage for the design of a network, with its empty layers, the parameters
// with their defaults and an example series of diameters
var generator = new TrentoPProjectFilesGenerator()
generator.outDatabase = folder + "sewer_new.gpkg"
generator.pMode = "Project"
generator.pCode = "EPSG:32632"
generator.process()
// the same, run in Calibration mode on the same GeoPackage, adds the layer and the
// parameters of the verification
generator.pMode = "Calibration"
generator.process()
The GeoPackage has the layers network_project, network_calibration, areas and junctions, and the tables parameters and diameters.