Skip to content

Commit

Permalink
Merge branch 'test_pipeline_IAvH' of https://github.com/PEM-Humboldt/…
Browse files Browse the repository at this point in the history
…biab-2.0 into test_pipeline_IAvH
  • Loading branch information
biorey committed Oct 24, 2023
2 parents 1729a96 + 740c305 commit 52173cf
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 4 deletions.
167 changes: 167 additions & 0 deletions pipelines/dpc 2410.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"nodes": [
{
"id": "0",
"type": "io",
"position": {
"x": 681.7666625976562,
"y": 152.8333282470703
},
"data": {
"descriptionFile": "00_spatial_to_DistanceMatrix>spatial_to_DistanceMatrix.yml"
}
},
{
"id": "1",
"type": "io",
"position": {
"x": 136.76666259765625,
"y": 163.8333282470703
},
"data": {
"descriptionFile": "00_studyarea_to_WKT>studyarea_to_WKT.yml"
}
},
{
"id": "3",
"type": "io",
"position": {
"x": 1237.7666625976562,
"y": 150.8333282470703
},
"data": {
"descriptionFile": "00_dpc_analyisis>dpc_analyisis.yml"
}
},
{
"id": "4",
"type": "output",
"position": {
"x": 1733.7666625976562,
"y": 138.8333282470703
},
"data": {
"label": "Output"
}
}
],
"edges": [
{
"source": "1",
"sourceHandle": "val_wkt_path",
"target": "0",
"targetHandle": "studyarea_wkt",
"id": "reactflow__edge-1val_wkt_path-0studyarea_wkt"
},
{
"source": "1",
"sourceHandle": "val_studyarea_epsg",
"target": "0",
"targetHandle": "studyarea_epsg",
"id": "reactflow__edge-1val_studyarea_epsg-0studyarea_epsg"
},
{
"source": "0",
"sourceHandle": "spatialunits_studyarea_data",
"target": "3",
"targetHandle": "data_spatial_unit",
"id": "reactflow__edge-0spatialunits_studyarea_data-3data_spatial_unit"
},
{
"source": "3",
"sourceHandle": "dpc_result",
"target": "4",
"targetHandle": null,
"id": "reactflow__edge-3dpc_result-4"
},
{
"source": "0",
"sourceHandle": "spatial_unit",
"target": "3",
"targetHandle": "column_spatial_unit",
"id": "reactflow__edge-0spatial_unit-3column_spatial_unit"
},
{
"source": "0",
"sourceHandle": "area_study_area",
"target": "3",
"targetHandle": "area_study_area",
"id": "reactflow__edge-0area_study_area-3area_study_area"
},
{
"source": "0",
"sourceHandle": "column_area",
"target": "3",
"targetHandle": "column_area",
"id": "reactflow__edge-0column_area-3column_area"
}
],
"inputs": {
"00_spatial_to_DistanceMatrix>spatial_to_DistanceMatrix.yml@0|unit_distance": {
"description": "String value that defines the measurement unit for calculating distances between spatial units (m or km) and estimating their areas (m2 or km2) in the study area.",
"label": "unit_distance",
"type": "options",
"options": [
"m",
"km"
],
"example": "m"
},
"00_spatial_to_DistanceMatrix>spatial_to_DistanceMatrix.yml@0|spatial_file": {
"description": "String path represents the file location of a spatial file containing spatial units, which is used to calculate the distance matrix",
"label": "spatial_file",
"type": "text",
"example": "/scripts/00_spatial_to_DistanceMatrix/input/Colombian_protected_areas.gpkg"
},
"00_spatial_to_DistanceMatrix>spatial_to_DistanceMatrix.yml@0|column_group": {
"description": "String that refers to the name of the column in the spatial file with the levels used to define the spatial units. In cases where there are multiple polygons per level, they will be grouped together, and the attributes of the first listed polygon will be taken into account.",
"label": "column_group",
"type": "text[]",
"example": [
"id_pa",
"name"
]
},
"00_studyarea_to_WKT>studyarea_to_WKT.yml@1|studyarea_path": {
"description": "Text string representing the file path to the spatial file containing the spatial boundaries pertaining to the study area. Accepted file types include shapefile (.shp), raster (.tif/GeoTIFF) or GeoPackage (.gpkg). This path specifies the complete path location of the file within the file system and is utilized for identifying and accessing the spatial boundaries contained within the file.",
"label": "study area geometry",
"type": "text",
"example": "/scripts/00_studyarea_to_WKT/input/Arauca.gpkg"
},
"00_studyarea_to_WKT>studyarea_to_WKT.yml@1|studyarea_epsg": {
"description": "Numerical value referring to the EPSG code (European Petroleum Survey Group) associated with the spatial reference system that will be used as a reference for the study area. This numerical value specifies the projection and geodetic datum used to define the coordinates and spatial representation of the data in the study area. For further information on coordinate systems and EPSG codes, you can access the official database on the EPSG website at https://epsg.org/home.html. The website provides documentation, resources, and tools for searching and understanding the EPSG codes used in various geospatial contexts.",
"label": "study area EPSG in",
"type": "int",
"example": 3395
},
"00_dpc_analyisis>dpc_analyisis.yml@3|column_date": {
"description": "String refering to the name of the column that contains the date. The date is a mandatory field if you want an temporal analysis by time periods. The date can be entered as 'Year-Month-Day', just year, or just year-month; if given in a different format the row is ignored. If (NULL) is not specified, a single period is assumed for the entire data set and the following arguments will be ignored.",
"label": "Date column name",
"type": "text",
"example": "created_date"
},
"00_dpc_analyisis>dpc_analyisis.yml@3|time_interval": {
"description": "String refering to the periods or intervals used for analysis. It specifies the length and units of time that will be considered for analyzing the data. For example, time intervals like 10Y (10 years), 5Y (5 years), 4M (4 months) can be used to define the time granularity for conducting the analysis. If no interval (time_interval) is specified, '1Y' is used by default.",
"label": "Time interval",
"type": "text",
"example": "10Y"
},
"00_dpc_analyisis>dpc_analyisis.yml@3|time_start": {
"description": "Refering to the starting date of the time interval. If this value is null or not provided, the minimum date from the column_date will be automatically taken as the starting date for the analysis. This argument is ignored if column_date=NULL.",
"label": "Start of time interval",
"type": "text"
},
"00_dpc_analyisis>dpc_analyisis.yml@3|time_end": {
"description": "Refering to the ending date of the time interval. If this value is null or not provided, the minimum date from the column_date will be automatically taken as the starting date for the analysis. This argument is ignored if column_date=NULL.",
"label": "End of time interval",
"type": "text"
}
},
"outputs": {
"00_dpc_analyisis>dpc_analyisis.yml@3|dpc_result": {
"description": "Refering to the table that contains the results of the dPC indicator within the study area",
"label": "Final table with dpC result",
"type": "text/csv"
}
}
}
2 changes: 1 addition & 1 deletion scripts/00_dpc_analyisis/dpc_analyisis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
area_study_area:
label: Total area of study area
description: "Numeric refering to the total area of the query area, this value is mandatory for the dPC calculation. Check that the area units are the same as those used in the data_spatial_unit parameter."
type: image/tiff;application=geotiff
type: int
column_spatial_unit:
label: ID colunm name
description: "String refering to the name of the column in the data spatial unit file that contains the unique identifier ID of the spatial units or nodes that intersect the area of interest."
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lapply(packagesList, library, character.only = TRUE) # Load libraries - package
Sys.getenv("SCRIPT_LOCATION")

# Option 2: Recommended for debugging purposes to be used as a testing environment. This is designed to facilitate script testing and correction
# outputFolder<- {x<- this.path::this.path(); file_prev<- paste0(gsub("/scripts.*", "/output", x), gsub("^.*/scripts", "", x) ); options<- tools::file_path_sans_ext(file_prev) %>% {c(paste0(., ".R"), paste0(., "_R"))}; folder_out<- options %>% {.[file.exists(.)]} %>% {.[which.max(sapply(., function(info) file.info(info)$mtime))]}; folder_final<- list.files(folder_out, full.names = T) %>% {.[which.max(sapply(., function(info) file.info(info)$mtime))]} }
# outputFolder<- {x<- this.path::this.path(); file_prev<- paste0(gsub("/scripts.*", "/output", x), gsub("^.*/scripts", "", x) ) %>% dirname(); options<- list.files(file_prev, full.names = T); folder_out<- options %>% {.[file.exists(.)]} %>% {.[which.max(sapply(., function(info) file.info(info)$mtime))]}; folder_final<- list.files(folder_out, full.names = T) %>% {.[which.max(sapply(., function(info) file.info(info)$mtime))]} }



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
studyarea_wkt:
label: studyarea_wkt
description: WKT (Well-Known Text) string or the file path to a .txt file containing the WKT representation of the study area boundaries. The WKT format is a text-based format used to describe the geometry of the study area's boundaries. The structure of the WKT file includes a geometry type label (MULTIPOLYGON), which is associated with the coordinate values of the vertices that define the study area's boundary mask.
type: text
type: text/wkt
example: "/scripts/00_spatial_to_DistanceMatrix/input/wkt_polygon_test.txt"
studyarea_epsg:
label: studyarea_EPSG
Expand Down

0 comments on commit 52173cf

Please sign in to comment.