class WorkflowOSM extends groovy.lang.Script
| Constructor and description |
|---|
WorkflowOSM() |
WorkflowOSM(groovy.lang.Binding context) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.lang.Object |
abstractModelTableBatchExportTable(JdbcDataSource output_datasource, java.lang.Object output_table, java.lang.Object id_zone, java.lang.Object h2gis_datasource, java.lang.Object h2gis_table_to_save, java.lang.Object filter, java.lang.Object inputSRID, java.lang.Object outputSRID, java.lang.Object reproject)Generic method to save the abstract model tables prepared in H2GIS to another database |
|
java.util.Map |
buildGeoclimateLayers(JdbcDataSource datasource, java.lang.Object zoneToExtract, float distance, int hLevMin)This process chains a set of subprocesses to extract and transform the OSM data into the geoclimate model |
|
java.lang.Object |
extractOSMZone(java.lang.Object datasource, java.lang.Object zoneToExtract, java.lang.Object distance, java.lang.Object bbox_size)Extract the OSM zone and its envelope area from Nominatim API |
|
java.lang.Object |
extractProcessingParameters(java.lang.Object processing_parameters)Read the file parameters and create a new map of parameters The map of parameters is initialized with default values |
|
java.lang.Object |
indicatorTableBatchExportTable(java.lang.Object output_datasource, java.lang.Object output_table, java.lang.Object id_zone, java.lang.Object h2gis_datasource, java.lang.Object h2gis_table_to_save, java.lang.Object filter, java.lang.Object inputSRID, java.lang.Object outputSRID, java.lang.Object reproject)Generic method to save the indicator tables prepared in H2GIS to another database |
|
static void |
main(java.lang.String[] args) |
|
java.util.Map |
osm_processing(JdbcDataSource h2gis_datasource, java.lang.Object processing_parameters, java.lang.Object id_zones, java.io.File outputFolder, java.lang.Object ouputTableFiles, java.lang.Object output_datasource, java.lang.Object outputTableNames, java.lang.Object outputSRID, java.lang.Object downloadAllOSMData, java.lang.Object deleteOutputData, java.lang.Object deleteOSMFile, java.lang.Object logTableZones, java.lang.Object bbox_size, java.lang.Object overpass_timeout, java.lang.Object overpass_maxsize)Process to extract the OSM data, build the GIS layers and run the Geoclimate algorithms |
|
java.lang.Object |
prepareTableOutput(java.lang.Object h2gis_table_to_save, java.lang.Object filter, java.lang.Object inputSRID, H2GIS h2gis_datasource, java.lang.Object output_table, java.lang.Object outputSRID, java.lang.Object output_datasource)Method to prepare a ITable aka resulset to export table in a database |
|
java.lang.Object |
run() |
|
java.lang.Object |
saveOutputFiles(java.lang.Object h2gis_datasource, java.lang.Object id_zone, java.lang.Object results, java.lang.Object outputFiles, java.lang.Object ouputFolder, java.lang.Object subFolderName, java.lang.Object outputSRID, java.lang.Object reproject, java.lang.Object deleteOutputData, java.lang.Object outputGrid)Save the geoclimate tables into geojson files |
|
java.lang.Object |
saveTablesInDatabase(JdbcDataSource output_datasource, JdbcDataSource h2gis_datasource, java.lang.Object outputTableNames, java.lang.Object h2gis_tables, java.lang.Object id_zone, java.lang.Object inputSRID, java.lang.Object outputSRID, java.lang.Object reproject)Save the output tables in a database |
|
java.util.Map |
workflow(java.lang.Object input)Extract OSM data and compute geoindicators. |
| Methods inherited from class | Name |
|---|---|
class groovy.lang.Script |
groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#println(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#run(), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#getBinding(), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(), groovy.lang.Script#wait(long), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll() |
Generic method to save the abstract model tables prepared in H2GIS to another database @return
output_datasource - connexion to a databaseoutput_table - name of the output tablesrid - srid to reprojecth2gis_datasource - local H2GIS databaseh2gis_table_to_save - name of the H2GIS table to savebatchSize - size of the batchfilter - to limit the data from H2GIS *outputSRID - srid code used to reproject the output tableThis process chains a set of subprocesses to extract and transform the OSM data into the geoclimate model @return
datasource - a connection to the database where the result files should be storedosmTablesPrefix - The prefix used for naming the 11 OSM tables build from the OSM filezoneToExtract - A zone to extract. Can be, a name of the place (neighborhood, city, etc. - cf https://wiki.openstreetmap.org/wiki/Key:level)
or a bounding box specified as a JTS envelopedistance - The integer value to expand the envelope of zoneExtract the OSM zone and its envelope area from Nominatim API @return
datasource - a connexion to the local H2GIS databasezoneToExtract - the osm filter : place or bboxdistance - to expand the OSM bboxRead the file parameters and create a new map of parameters The map of parameters is initialized with default values
processing_parameters - the file parametersGeneric method to save the indicator tables prepared in H2GIS to another database @return
output_datasource - connexion to a databaseoutput_table - name of the output tableid_zone - id of the zoneh2gis_datasource - local H2GIS databaseh2gis_table_to_save - name of the H2GIS table to savefilter - to limit the data from H2GIS *inputSRID - srid code of the inputableoutputSRID - srid code used to reproject the output tableProcess to extract the OSM data, build the GIS layers and run the Geoclimate algorithms
h2gis_datasource - the local H2GIS databaseprocessing_parameters - the geoclimate chain parametersid_zones - a list of id zones to processoutputFolder - folder to store the files, null otherwiseouputTableFiles - the name of the tables that will be savedoutput_datasource - a connexion to a database to save the resultsoutputTableNames - the name of the tables in the output_datasource to save the resultsbbox_size - the size of OSM BBox in km²Method to prepare a ITable aka resulset to export table in a database @return
Save the geoclimate tables into geojson files @return
id_zone - the id of the zoneresults - a list of tables computed by geoclimateouputFolder - the ouput folderoutputSRID - srid code to reproject the resultreproject - true if the file must reprojecteddeleteOutputData - delete the files if existoutputGrid - file format of the gridSave the output tables in a database @return
output_datasource - a connexion a databaseh2gis_datasource - local H2GIS databaseoutputTableNames - name of the output tablesh2gis_tables - name of H2GIS to saveid_zone - id of the zoneoutputSRID - srid code to reproject the data *reproject - the output tableExtract OSM data and compute geoindicators. The parameters of the processing chain is defined from a configuration file or a Map. The configuration file is stored in a json format
input - The path of the configuration file or a Map
The input file or the Map supports the following entries
* {
* [OPTIONAL ENTRY] "description" :"A description for the configuration file"
*
* [OPTIONAL ENTRY] "geoclimatedb" : { // Local H2GIS database used to run the processes
* // A default db is build when this entry is not specified
* "folder" : "/tmp/", //The folder to store the database
* "name" : "geoclimate_db;AUTO_SERVER=TRUE" // A name for the database
* "delete" :false
* },
* [REQUIRED] "input" : {
* "locations" : ["filter"] // OSM filter to extract the data. Can be a place name supported by nominatim
// e.g "osm" : ["oran", "plourivo"]
// or bbox expressed as "osm" : [[38.89557963573336,-77.03930318355559,38.89944983078282,-77.03364372253417]]
* "all":true //optional value if the user wants to download a limited set of data. Default is true to download all OSM elements
* "area" : 2000 //optional value to control the area ov the OSM BBox, default is 1000 km²
}
* ,
* [OPTIONAL ENTRY] "output" :{ //If not ouput is set the results are keep in the local database
* "srid" : //optional value to reproject the data
* "folder" : "/tmp/myResultFolder" //tmp folder to store the computed layers in a geojson format,
* "database": { //database parameters to store the computed layers.
* "user": "-",
* "password": "-",
* "url": "jdbc:postgresql://", //JDBC url to connect with the database
* "tables": { //table names to store the result layers. Create the table if it doesn't exist
* "building_indicators":"building_indicators",
* "block_indicators":"block_indicators",
* "rsu_indicators":"rsu_indicators",
* "rsu_lcz":"rsu_lcz",
* "zones":"zones"} }
* },
* ,
* [OPTIONAL ENTRY] "parameters":
* {"distance" : 1000,
* "prefixName": "",
* rsu_indicators:{
* "indicatorUse": ["LCZ", "UTRF", "TEB"],
* "svfSimplified": false,
* "mapOfWeights":
* {"sky_view_factor": 1,
* "aspect_ratio": 1,
* "building_surface_fraction": 1,
* "impervious_surface_fraction" : 1,
* "pervious_surface_fraction": 1,
* "height_of_roughness_elements": 1,
* "terrain_roughness_length": 1},
* "hLevMin": 3,
* "hLevMax": 15,
* "hThresho2": 10
}
* }
* }
The parameters entry tag contains all geoclimate chain parameters.
When a parameter is not specificied a default value is set.
- distance The integer value to expand the envelope of zone when recovering the data
- distance The integer value to expand the envelope of zone when recovering the data
(some objects may be badly truncated if they are not within the envelope)
- indicatorUse List of geoindicator types to compute (default ["LCZ", "UTRF", "TEB"]
--> "LCZ" : compute the indicators needed for the LCZ classification (Stewart et Oke, 2012)
--> "UTRF" : compute the indicators needed for the urban typology classification (Bocher et al., 2017)
--> "TEB" : compute the indicators needed for the Town Energy Balance model
- svfSimplified A boolean indicating whether or not the simplified version of the SVF should be used. This
version is faster since it is based on a simple relationship between ground SVF calculated at RSU scale and
facade density (Bernard et al. 2018).
- prefixName A prefix used to name the output table (default ""). Could be useful in case the user wants to
investigate the sensibility of the chain to some input parameters
- mapOfWeights Values that will be used to increase or decrease the weight of an indicator (which are the key
of the map) for the LCZ classification step (default : all values to 1)
- hLevMin Minimum building level height