diff --git a/README.md b/README.md index b66d5f7..8a65c91 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,9 @@ If you are interested in using openEO together with Google Earth Engine, [expres ## Demo -* The most recent version (openEO API v1.0.0) is running at https://earthengine.openeo.org/v1.0 -* The previous stable version (openEO API v0.4.2) is running at https://earthengine.openeo.org/v0.4 +The demo instance is running at https://earthengine.openeo.org (supporting openEO API versions 0.4 and 1.0) -Multiple user accounts are available to be used (`group1`, `group2`, ... until `group15`), each with password `test123`. +Several user accounts are available to be used (`group1`, `group2`, ...), each with password `test123`. ## Setting up an instance @@ -38,134 +37,41 @@ The server needs to authenticate with a [service accounts](https://developers.go More information about authentication can be found in the [Earth Engine documentation](https://developers.google.com/earth-engine/app_engine_intro). -### Starting up the server +#v## Starting up the server -After configuration, the server can be started. Run `npm run start` to start the server. +After configuration, the server can be started. Run `npm run start` to start the server. + +After finishing work, you can stop the server by running `npm run stop`. ## Usage For both the demo servers or your own instance you can use the [openEO API](https://open-eo.github.io/openeo-api/apireference/index.html) to communicate with Google Earth Engine. -An exemplary process graph to create an on-demand XYZ web-service looks like this: - -``` -{ - "load_collection": { - "arguments": { - "id": "COPERNICUS/S2", - "temporal_extent": ["2018-04-30", "2018-06-26"], - "spatial_extent": { - "west": -2.763447, - "south": 43.040791, - "east": -1.120991, - "north": 43.838489 - }, - "bands": ["B8", "B4"] - }, - "process_id": "load_collection" - }, - "b1": { - "arguments": { - "data": {"from_node": "load_collection"}, - "bands": ["B8"] - }, - "process_id": "filter_bands" - }, - "b2": { - "arguments": { - "data": {"from_node": "load_collection"}, - "bands": ["B4"] - }, - "process_id": "filter_bands" - }, - "normalized_difference": { - "arguments": { - "band1": {"from_node": "b1"}, - "band2": {"from_node": "b2"} - }, - "process_id": "normalized_difference" - }, - "reduce": { - "arguments": { - "data": {"from_node": "normalized_difference"}, - "dimension": "t", - "reducer": { - "process_graph": { - "max": { - "arguments": { - "data": {"from_parameter": "data"} - }, - "process_id": "max", - "result": true - } - } - } - }, - "process_id": "reduce" - }, - "linear_scaling": { - "arguments": { - "data": {"from_node": "reduce"}, - "process": { - "process_graph": { - "lsr": { - "arguments": { - "x": {"from_parameter": "x"}, - "inputMin": -1, - "inputMax": 1, - "outputMin": 0, - "outputMax": 255 - }, - "process_id": "linear_scale_range", - "result": true - } - } - } - }, - "process_id": "apply" - }, - "save_result": { - "arguments": { - "data": {"from_node": "linear_scaling"}, - "format": "png" - }, - "process_id": "save_result", - "result": true - } -} -``` +An exemplary process to create an on-demand XYZ web-service looks like this: [sample-processgraph.json](tests/data/sample-processgraph.json) This translates into the following [Google Earth Engine Playground](https://code.earthengine.google.com/) script: ``` // load_collection -var img = ee.ImageCollection("COPERNICUS/S2"); -img = img.filterDate("2018-04-30", "2018-06-26"); -var geom = ee.Geometry.Rectangle([-2.763447,43.040791,-1.120991,43.838489], "EPSG:4326"); -img = img.filterBounds(geom); +var col = ee.ImageCollection("COPERNICUS/S2"); +col = col.filterDate("2018-01-01", "2018-01-31"); // filter_bands (2x) -var band1 = img.select(["B8"]); -var band2 = img.select(["B4"]); - -// normalized_difference -var combined = band1.combine(band2); -img = combined.map(function(image) { - var normalizedDifference = image.normalizedDifference().rename("normalized_difference"); - return image.addBands(normalizedDifference).select("normalized_difference"); -}); +col = col.select(["B4", "B8"]); -// reduce with callback max -img = img.reduce('max'); +// reduce over bands with callback normalized_difference +col = col.map(function(image) { + var red = image.select("B4"); + var nir = image.select("B8"); + return nir.subtract(red).divide(nir.add(red)); +}); -// apply linear scaling -var numerator = img.subtract(-1); -var ratio = numerator.divide(1 - -1); -img = ratio.multiply(255 - 0).add(0); +// reduce over time with callback max +var img = col.reduce('max'); // save_result // Either download data with img.getDownloadURL() or show it in in the playground with: Map.addLayer(img); ``` -**[Further documentation](docs/README.md) can be found in the [docs/](docs/) directory, but is currently work in progress.** +**[Further documentation](docs/README.md) and more examples can be found in the [docs/](docs/) directory, but it is work in progress.** diff --git a/docs/era5-monthly-anomalies.json b/docs/era5-monthly-anomalies.json index ab36a5c..52cf0e0 100644 --- a/docs/era5-monthly-anomalies.json +++ b/docs/era5-monthly-anomalies.json @@ -1,105 +1,107 @@ { - "load": { - "process_id": "load_collection", - "description": "Load ERA5 monthly 2m air temperature from 1979 to 2019", - "arguments": { - "id": "ECMWF/ERA5/MONTHLY", - "spatial_extent": null, - "temporal_extent": ["1979-01-01","2020-01-01"], - "bands": ["mean_2m_air_temperature"] - } - }, - "convert": { - "process_id": "apply", - "description": "Convert temperature from K to degree celsius", - "arguments": { - "data": {"from_node": "load"}, - "process": { - "process_graph": { - "k_to_degC": { - "process_id": "subtract", - "arguments": { - "x": {"from_parameter": "x"}, - "y": 273.15 - }, - "result": true + "process_graph": { + "load": { + "process_id": "load_collection", + "description": "Load ERA5 monthly 2m air temperature from 1979 to 2019", + "arguments": { + "id": "ECMWF/ERA5/MONTHLY", + "spatial_extent": null, + "temporal_extent": ["1979-01-01","2020-01-01"], + "bands": ["mean_2m_air_temperature"] + } + }, + "convert": { + "process_id": "apply", + "description": "Convert temperature from K to degree celsius", + "arguments": { + "data": {"from_node": "load"}, + "process": { + "process_graph": { + "k_to_degC": { + "process_id": "subtract", + "arguments": { + "x": {"from_parameter": "x"}, + "y": 273.15 + }, + "result": true + } } } } - } - }, - "normals": { - "process_id": "climatological_normal", - "description": "Create the climatological period normals.", - "arguments": { - "data": {"from_node": "convert"}, - "period": "monthly" - } - }, - "anomaly": { - "process_id": "anomaly", - "description": "For each month in the time-series, calculate the anomaly", - "arguments": { - "data": {"from_node": "convert"}, - "normals": {"from_node": "normals"}, - "period": "monthly" - } - }, - "reduce": { - "process_id": "reduce_dimension", - "description": "Reduce to first month - for visualization purposes only", - "arguments": { - "data": {"from_node": "anomaly"}, - "reducer": { - "process_graph": { - "first": { - "process_id": "first", - "arguments": { - "data": { - "from_parameter": "data" - } - }, - "result": true + }, + "normals": { + "process_id": "climatological_normal", + "description": "Create the climatological period normals.", + "arguments": { + "data": {"from_node": "convert"}, + "period": "monthly" + } + }, + "anomaly": { + "process_id": "anomaly", + "description": "For each month in the time-series, calculate the anomaly", + "arguments": { + "data": {"from_node": "convert"}, + "normals": {"from_node": "normals"}, + "period": "monthly" + } + }, + "reduce": { + "process_id": "reduce_dimension", + "description": "Reduce to first month - for visualization purposes only", + "arguments": { + "data": {"from_node": "anomaly"}, + "reducer": { + "process_graph": { + "first": { + "process_id": "first", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } } - } - }, - "dimension": "t" - } - }, - "stretch": { - "process_id": "apply", - "description": "Stretch range from -1 / 1 to 0 / 255 for PNG visualization.", - "arguments": { - "data": {"from_node": "reduce"}, - "process": { - "process_graph": { - "linear_scale_range": { - "process_id": "linear_scale_range", - "arguments": { - "x": { - "from_parameter": "x" + }, + "dimension": "t" + } + }, + "stretch": { + "process_id": "apply", + "description": "Stretch range from -1 / 1 to 0 / 255 for PNG visualization.", + "arguments": { + "data": {"from_node": "reduce"}, + "process": { + "process_graph": { + "linear_scale_range": { + "process_id": "linear_scale_range", + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -10, + "inputMax": 10, + "outputMax": 255 }, - "inputMin": -10, - "inputMax": 10, - "outputMax": 255 - }, - "result": true + "result": true + } } } } - } - }, - "save": { - "process_id": "save_result", - "arguments": { - "data": { - "from_node": "stretch" - }, - "format": "PNG", - "options": { - "palette": ["#2166AC","#4393C3","#92C5DE","#D1E5F0","#F7F7F7","#FDDBC7","#F4A582","#D6604D","#B2182B"] - } }, - "result": true + "save": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "stretch" + }, + "format": "PNG", + "options": { + "palette": ["#2166AC","#4393C3","#92C5DE","#D1E5F0","#F7F7F7","#FDDBC7","#F4A582","#D6604D","#B2182B"] + } + }, + "result": true + } } } \ No newline at end of file diff --git a/docs/l8-rgb-median-with-clouds-australia.json b/docs/l8-rgb-median-with-clouds-australia.json index 8d0f756..75ad8f6 100644 --- a/docs/l8-rgb-median-with-clouds-australia.json +++ b/docs/l8-rgb-median-with-clouds-australia.json @@ -1,85 +1,87 @@ { - "4": { - "process_id": "load_collection", - "arguments": { - "id": "LANDSAT/LC08/C01/T1_SR", - "spatial_extent": { - "west": 110.654296875, - "south": -45.58328975600631, - "east": 155.47851562499994, - "north": -6.31529853833004 - }, - "temporal_extent": [ - "2016-01-01T00:00:00Z", - "2016-12-31T23:59:59Z" - ], - "bands": [ - "B4", - "B3", - "B2" - ] - } - }, - "5": { - "process_id": "save_result", - "arguments": { - "data": { - "from_node": "7" - }, - "format": "PNG", - "options": { - "red": "B4", - "green": "B3", - "blue": "B2", - "gray": null + "process_graph": { + "4": { + "process_id": "load_collection", + "arguments": { + "id": "LANDSAT/LC08/C01/T1_SR", + "spatial_extent": { + "west": 110.654296875, + "south": -45.58328975600631, + "east": 155.47851562499994, + "north": -6.31529853833004 + }, + "temporal_extent": [ + "2016-01-01T00:00:00Z", + "2016-12-31T23:59:59Z" + ], + "bands": [ + "B4", + "B3", + "B2" + ] } }, - "result": true - }, - "6": { - "process_id": "reduce_dimension", - "arguments": { - "data": { - "from_node": "4" - }, - "reducer": { - "process_graph": { - "2": { - "process_id": "median", - "arguments": { - "data": { - "from_parameter": "data" - } - }, - "result": true - } + "5": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "7" + }, + "format": "PNG", + "options": { + "red": "B4", + "green": "B3", + "blue": "B2", + "gray": null } }, - "dimension": "t" - } - }, - "7": { - "process_id": "apply", - "arguments": { - "data": { - "from_node": "6" - }, - "process": { - "process_graph": { - "2": { - "process_id": "linear_scale_range", - "arguments": { - "x": { - "from_parameter": "x" + "result": true + }, + "6": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "4" + }, + "reducer": { + "process_graph": { + "2": { + "process_id": "median", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t" + } + }, + "7": { + "process_id": "apply", + "arguments": { + "data": { + "from_node": "6" + }, + "process": { + "process_graph": { + "2": { + "process_id": "linear_scale_range", + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": 0, + "inputMax": 3000, + "outputMax": 255 }, - "inputMin": 0, - "inputMax": 3000, - "outputMax": 255 - }, - "result": true + "result": true + } } } } } } -} +} \ No newline at end of file diff --git a/docs/naip-rgb-usa.json b/docs/naip-rgb-usa.json index c794d75..bb64cf2 100644 --- a/docs/naip-rgb-usa.json +++ b/docs/naip-rgb-usa.json @@ -1,35 +1,37 @@ { - "1": { - "process_id": "load_collection", - "arguments": { - "id": "USDA/NAIP/DOQQ", - "spatial_extent": { - "west": -125.37597656250003, - "south": 24.206889622398023, - "east": -66.75292968750001, - "north": 49.38237278700956 - }, - "temporal_extent": [ - "2017-01-01T00:00:00Z", - "2017-12-31T23:59:59Z" - ], - "bands": null - } - }, - "2": { - "process_id": "save_result", - "arguments": { - "data": { - "from_node": "1" - }, - "format": "PNG", - "options": { - "red": "R", - "green": "G", - "blue": "B", - "gray": null + "process_graph": { + "1": { + "process_id": "load_collection", + "arguments": { + "id": "USDA/NAIP/DOQQ", + "spatial_extent": { + "west": -125.37597656250003, + "south": 24.206889622398023, + "east": -66.75292968750001, + "north": 49.38237278700956 + }, + "temporal_extent": [ + "2017-01-01T00:00:00Z", + "2017-12-31T23:59:59Z" + ], + "bands": null } }, - "result": true + "2": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "1" + }, + "format": "PNG", + "options": { + "red": "R", + "green": "G", + "blue": "B", + "gray": null + } + }, + "result": true + } } -} +} \ No newline at end of file diff --git a/docs/s1-uc1-polarization.json b/docs/s1-uc1-polarization.json index 80203d1..8c28a89 100644 --- a/docs/s1-uc1-polarization.json +++ b/docs/s1-uc1-polarization.json @@ -1,243 +1,245 @@ { - "load_collection": { - "arguments": { - "id": "COPERNICUS/S1_GRD", - "spatial_extent": { - "west": 16.06, - "south": 48.06, - "east": 16.65, - "north": 48.35 + "process_graph": { + "load_collection": { + "arguments": { + "id": "COPERNICUS/S1_GRD", + "spatial_extent": { + "west": 16.06, + "south": 48.06, + "east": 16.65, + "north": 48.35 + }, + "bands" : ["VV", "VH"], + "temporal_extent": ["2017-03-01", "2017-04-01"] }, - "bands" : ["VV", "VH"], - "temporal_extent": ["2017-03-01", "2017-04-01"] + "process_id": "load_collection" }, - "process_id": "load_collection" - }, - "mean": { - "arguments": { - "data": { - "from_node": "load_collection" - }, - "dimension": "t", - "reducer": { - "process_graph": { - "mean": { - "arguments": { - "data": { - "from_parameter": "data" - } - }, - "process_id": "mean", - "result": true + "mean": { + "arguments": { + "data": { + "from_node": "load_collection" + }, + "dimension": "t", + "reducer": { + "process_graph": { + "mean": { + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "process_id": "mean", + "result": true + } } } - } - }, - "process_id": "reduce_dimension" - }, - "cr": { - "arguments": { - "data": { - "from_node": "mean" }, - "dimension": "bands", - "reducer": { - "process_graph": { - "VV": { - "arguments": { - "data": { - "from_parameter": "data" + "process_id": "reduce_dimension" + }, + "cr": { + "arguments": { + "data": { + "from_node": "mean" + }, + "dimension": "bands", + "reducer": { + "process_graph": { + "VV": { + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "VV" }, - "label": "VV" + "process_id": "array_element" }, - "process_id": "array_element" - }, - "VH": { - "arguments": { - "data": { - "from_parameter": "data" + "VH": { + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "VH" }, - "label": "VH" + "process_id": "array_element" }, - "process_id": "array_element" - }, - "cr": { - "arguments": { - "x": {"from_node": "VH"}, - "y": {"from_node": "VV"} - }, - "process_id": "subtract", - "result": true + "cr": { + "arguments": { + "x": {"from_node": "VH"}, + "y": {"from_node": "VV"} + }, + "process_id": "subtract", + "result": true + } } } - } - }, - "process_id": "reduce_dimension" - }, - "add_dim_cr": { - "arguments": { - "data": { - "from_node": "cr" }, - "name": "bands", - "type": "bands" + "process_id": "reduce_dimension" }, - "process_id": "add_dimension" - }, - "rename_label_cr": { - "arguments": { - "data": { - "from_node": "add_dim_cr" + "add_dim_cr": { + "arguments": { + "data": { + "from_node": "cr" + }, + "name": "bands", + "type": "bands" }, - "dimension": "bands", - "target": ["B"] + "process_id": "add_dimension" }, - "process_id": "rename_labels" - }, - "VV": { - "arguments": { - "data": { - "from_node": "mean" + "rename_label_cr": { + "arguments": { + "data": { + "from_node": "add_dim_cr" + }, + "dimension": "bands", + "target": ["B"] }, - "bands": ["VV"] + "process_id": "rename_labels" }, - "process_id": "filter_bands" - }, - "rename_label_VV": { - "arguments": { - "data": { - "from_node": "VV" + "VV": { + "arguments": { + "data": { + "from_node": "mean" + }, + "bands": ["VV"] }, - "dimension": "bands", - "target": ["R"] + "process_id": "filter_bands" }, - "process_id": "rename_labels" - }, - "VH": { - "arguments": { - "data": { - "from_node": "mean" + "rename_label_VV": { + "arguments": { + "data": { + "from_node": "VV" + }, + "dimension": "bands", + "target": ["R"] }, - "bands": ["VH"] + "process_id": "rename_labels" }, - "process_id": "filter_bands" - }, - "rename_label_VH": { - "arguments": { - "data": { - "from_node": "VH" + "VH": { + "arguments": { + "data": { + "from_node": "mean" + }, + "bands": ["VH"] }, - "dimension": "bands", - "target": ["G"] + "process_id": "filter_bands" }, - "process_id": "rename_labels" - }, - "R_band": { - "arguments": { - "data": { - "from_node": "rename_label_VV" + "rename_label_VH": { + "arguments": { + "data": { + "from_node": "VH" + }, + "dimension": "bands", + "target": ["G"] }, - "process": { - "process_graph": { - "linear_scale_range": { - "arguments": { - "x": { - "from_parameter": "x" + "process_id": "rename_labels" + }, + "R_band": { + "arguments": { + "data": { + "from_node": "rename_label_VV" + }, + "process": { + "process_graph": { + "linear_scale_range": { + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -20, + "inputMax": -5, + "outputMin": 0, + "outputMax": 255 }, - "inputMin": -20, - "inputMax": -5, - "outputMin": 0, - "outputMax": 255 - }, - "process_id": "linear_scale_range", - "result": true + "process_id": "linear_scale_range", + "result": true + } } } - } - }, - "process_id": "apply" - }, - "G_band": { - "arguments": { - "data": { - "from_node": "rename_label_VH" }, - "process": { - "process_graph": { - "linear_scale_range": { - "arguments": { - "x": { - "from_parameter": "x" + "process_id": "apply" + }, + "G_band": { + "arguments": { + "data": { + "from_node": "rename_label_VH" + }, + "process": { + "process_graph": { + "linear_scale_range": { + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -26, + "inputMax": -11, + "outputMin": 0, + "outputMax": 255 }, - "inputMin": -26, - "inputMax": -11, - "outputMin": 0, - "outputMax": 255 - }, - "process_id": "linear_scale_range", - "result": true + "process_id": "linear_scale_range", + "result": true + } } } - } - }, - "process_id": "apply" - }, - "B_band": { - "arguments": { - "data": { - "from_node": "rename_label_cr" }, - "process": { - "process_graph": { - "linear_scale_range": { - "arguments": { - "x": { - "from_parameter": "x" + "process_id": "apply" + }, + "B_band": { + "arguments": { + "data": { + "from_node": "rename_label_cr" + }, + "process": { + "process_graph": { + "linear_scale_range": { + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -5, + "inputMax": 0, + "outputMin": 0, + "outputMax": 255 }, - "inputMin": -5, - "inputMax": 0, - "outputMin": 0, - "outputMax": 255 - }, - "process_id": "linear_scale_range", - "result": true + "process_id": "linear_scale_range", + "result": true + } } } - } - }, - "process_id": "apply" - }, - "RG": { - "arguments": { - "cube1": { - "from_node": "R_band" }, - "cube2": { - "from_node": "G_band" - } + "process_id": "apply" }, - "process_id": "merge_cubes" - }, - "RGB": { - "arguments": { - "cube1": { - "from_node": "RG" + "RG": { + "arguments": { + "cube1": { + "from_node": "R_band" + }, + "cube2": { + "from_node": "G_band" + } }, - "cube2": { - "from_node": "B_band" - } + "process_id": "merge_cubes" }, - "process_id": "merge_cubes" - }, - "save_result": { - "arguments": { - "data": { - "from_node": "RGB" + "RGB": { + "arguments": { + "cube1": { + "from_node": "RG" + }, + "cube2": { + "from_node": "B_band" + } }, - "format": "png", - "options": {"red": "R", "green": "G", "blue": "B"} + "process_id": "merge_cubes" }, - "process_id": "save_result", - "result": true + "save_result": { + "arguments": { + "data": { + "from_node": "RGB" + }, + "format": "png", + "options": {"red": "R", "green": "G", "blue": "B"} + }, + "process_id": "save_result", + "result": true + } } } \ No newline at end of file diff --git a/docs/s1-uc1-temporal.json b/docs/s1-uc1-temporal.json index 1f55efd..cd05a1f 100644 --- a/docs/s1-uc1-temporal.json +++ b/docs/s1-uc1-temporal.json @@ -1,223 +1,225 @@ { - "march":{ - "arguments":{ - "id":"COPERNICUS/S1_GRD", - "spatial_extent":{ - "west":16.06, - "south":48.06, - "east":16.65, - "north":48.35 + "process_graph": { + "march":{ + "arguments":{ + "id":"COPERNICUS/S1_GRD", + "spatial_extent":{ + "west":16.06, + "south":48.06, + "east":16.65, + "north":48.35 + }, + "bands":[ + "VV" + ], + "temporal_extent":[ + "2017-03-01", + "2017-04-01" + ] }, - "bands":[ - "VV" - ], - "temporal_extent":[ - "2017-03-01", - "2017-04-01" - ] + "process_id":"load_collection" }, - "process_id":"load_collection" - }, - "april":{ - "arguments":{ - "id":"COPERNICUS/S1_GRD", - "spatial_extent":{ - "west":16.06, - "south":48.06, - "east":16.65, - "north":48.35 + "april":{ + "arguments":{ + "id":"COPERNICUS/S1_GRD", + "spatial_extent":{ + "west":16.06, + "south":48.06, + "east":16.65, + "north":48.35 + }, + "bands":[ + "VV" + ], + "temporal_extent":[ + "2017-04-01", + "2017-05-01" + ] }, - "bands":[ - "VV" - ], - "temporal_extent":[ - "2017-04-01", - "2017-05-01" - ] + "process_id":"load_collection" }, - "process_id":"load_collection" - }, - "may":{ - "arguments":{ - "id":"COPERNICUS/S1_GRD", - "spatial_extent":{ - "west":16.06, - "south":48.06, - "east":16.65, - "north":48.35 + "may":{ + "arguments":{ + "id":"COPERNICUS/S1_GRD", + "spatial_extent":{ + "west":16.06, + "south":48.06, + "east":16.65, + "north":48.35 + }, + "bands":[ + "VV" + ], + "temporal_extent":[ + "2017-05-01", + "2017-06-01" + ] }, - "bands":[ - "VV" - ], - "temporal_extent":[ - "2017-05-01", - "2017-06-01" - ] + "process_id":"load_collection" }, - "process_id":"load_collection" - }, - "mean_march":{ - "arguments":{ - "data":{ - "from_node":"march" - }, - "dimension":"t", - "reducer":{ - "process_graph":{ - "mean":{ - "arguments":{ - "data":{ - "from_parameter":"data" - } - }, - "process_id":"mean", - "result":true + "mean_march":{ + "arguments":{ + "data":{ + "from_node":"march" + }, + "dimension":"t", + "reducer":{ + "process_graph":{ + "mean":{ + "arguments":{ + "data":{ + "from_parameter":"data" + } + }, + "process_id":"mean", + "result":true + } } } - } - }, - "process_id":"reduce_dimension" - }, - "mean_april":{ - "arguments":{ - "data":{ - "from_node":"april" }, - "dimension":"t", - "reducer":{ - "process_graph":{ - "mean":{ - "arguments":{ - "data":{ - "from_parameter":"data" - } - }, - "process_id":"mean", - "result":true + "process_id":"reduce_dimension" + }, + "mean_april":{ + "arguments":{ + "data":{ + "from_node":"april" + }, + "dimension":"t", + "reducer":{ + "process_graph":{ + "mean":{ + "arguments":{ + "data":{ + "from_parameter":"data" + } + }, + "process_id":"mean", + "result":true + } } } - } - }, - "process_id":"reduce_dimension" - }, - "mean_may":{ - "arguments":{ - "data":{ - "from_node":"may" }, - "dimension":"t", - "reducer":{ - "process_graph":{ - "mean":{ - "arguments":{ - "data":{ - "from_parameter":"data" - } - }, - "process_id":"mean", - "result":true + "process_id":"reduce_dimension" + }, + "mean_may":{ + "arguments":{ + "data":{ + "from_node":"may" + }, + "dimension":"t", + "reducer":{ + "process_graph":{ + "mean":{ + "arguments":{ + "data":{ + "from_parameter":"data" + } + }, + "process_id":"mean", + "result":true + } } } - } - }, - "process_id":"reduce_dimension" - }, - "R_band":{ - "arguments":{ - "data":{ - "from_node":"mean_march" }, - "dimension":"bands", - "target":[ - "R" - ] + "process_id":"reduce_dimension" }, - "process_id":"rename_labels" - }, - "G_band":{ - "arguments":{ - "data":{ - "from_node":"mean_april" + "R_band":{ + "arguments":{ + "data":{ + "from_node":"mean_march" + }, + "dimension":"bands", + "target":[ + "R" + ] }, - "dimension":"bands", - "target":[ - "G" - ] + "process_id":"rename_labels" }, - "process_id":"rename_labels" - }, - "B_band":{ - "arguments":{ - "data":{ - "from_node":"mean_may" + "G_band":{ + "arguments":{ + "data":{ + "from_node":"mean_april" + }, + "dimension":"bands", + "target":[ + "G" + ] }, - "dimension":"bands", - "target":[ - "B" - ] + "process_id":"rename_labels" }, - "process_id":"rename_labels" - }, - "RG":{ - "arguments":{ - "cube1":{ - "from_node":"R_band" + "B_band":{ + "arguments":{ + "data":{ + "from_node":"mean_may" + }, + "dimension":"bands", + "target":[ + "B" + ] }, - "cube2":{ - "from_node":"G_band" - } + "process_id":"rename_labels" }, - "process_id":"merge_cubes" - }, - "RGB":{ - "arguments":{ - "cube1":{ - "from_node":"RG" + "RG":{ + "arguments":{ + "cube1":{ + "from_node":"R_band" + }, + "cube2":{ + "from_node":"G_band" + } }, - "cube2":{ - "from_node":"B_band" - } + "process_id":"merge_cubes" }, - "process_id":"merge_cubes" - }, - "colour_stretching":{ - "arguments":{ - "data":{ - "from_node":"RGB" + "RGB":{ + "arguments":{ + "cube1":{ + "from_node":"RG" + }, + "cube2":{ + "from_node":"B_band" + } }, - "process":{ - "process_graph":{ - "linear_scale_range":{ - "arguments":{ - "x":{ - "from_parameter":"x" + "process_id":"merge_cubes" + }, + "colour_stretching":{ + "arguments":{ + "data":{ + "from_node":"RGB" + }, + "process":{ + "process_graph":{ + "linear_scale_range":{ + "arguments":{ + "x":{ + "from_parameter":"x" + }, + "inputMin":-20, + "inputMax":-5, + "outputMin":0, + "outputMax":255 }, - "inputMin":-20, - "inputMax":-5, - "outputMin":0, - "outputMax":255 - }, - "process_id":"linear_scale_range", - "result":true + "process_id":"linear_scale_range", + "result":true + } } } - } - }, - "process_id":"apply" - }, - "save_result":{ - "arguments":{ - "data":{ - "from_node":"colour_stretching" }, - "format":"png", - "options":{ - "red":"R", - "green":"G", - "blue":"B" - } + "process_id":"apply" }, - "process_id":"save_result", - "result":true + "save_result":{ + "arguments":{ + "data":{ + "from_node":"colour_stretching" + }, + "format":"png", + "options":{ + "red":"R", + "green":"G", + "blue":"B" + } + }, + "process_id":"save_result", + "result":true + } } } \ No newline at end of file diff --git a/docs/s2-evi.json b/docs/s2-evi.json index c4de90c..3d70c1b 100644 --- a/docs/s2-evi.json +++ b/docs/s2-evi.json @@ -1,196 +1,198 @@ { - "1": { - "process_id": "apply", - "arguments": { - "data": { - "from_node": "mintime" - }, - "process": { - "process_graph": { - "2": { - "process_id": "linear_scale_range", - "arguments": { - "x": { - "from_parameter": "x" + "process_graph": { + "1": { + "process_id": "apply", + "arguments": { + "data": { + "from_node": "mintime" + }, + "process": { + "process_graph": { + "2": { + "process_id": "linear_scale_range", + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -1, + "inputMax": 1, + "outputMax": 255 }, - "inputMin": -1, - "inputMax": 1, - "outputMax": 255 - }, - "result": true + "result": true + } } } - } - }, - "description": "Stretch range from -1 / 1 to 0 / 255 for PNG visualization." - }, - "dc": { - "process_id": "load_collection", - "arguments": { - "id": "COPERNICUS/S2", - "spatial_extent": { - "west": 16.06, - "south": 48.06, - "east": 16.65, - "north": 48.35 }, - "temporal_extent": [ - "2018-01-01T00:00:00Z", - "2018-01-31T23:59:59Z" - ], - "bands": [ - "B8", - "B4", - "B2" - ] + "description": "Stretch range from -1 / 1 to 0 / 255 for PNG visualization." }, - "description": "Loading the data; The order of the specified bands is important for the following reduce operation." - }, - "evi": { - "process_id": "reduce_dimension", - "arguments": { - "data": { - "from_node": "dc" + "dc": { + "process_id": "load_collection", + "arguments": { + "id": "COPERNICUS/S2", + "spatial_extent": { + "west": 16.06, + "south": 48.06, + "east": 16.65, + "north": 48.35 + }, + "temporal_extent": [ + "2018-01-01T00:00:00Z", + "2018-01-31T23:59:59Z" + ], + "bands": [ + "B8", + "B4", + "B2" + ] }, - "reducer": { - "process_graph": { - "nir": { - "process_id": "array_element", - "arguments": { - "data": { - "from_parameter": "data" - }, - "index": 0 - } - }, - "sub": { - "process_id": "subtract", - "arguments": { - "x": { - "from_node": "nir" - }, - "y": { - "from_node": "red" - } - } - }, - "div": { - "process_id": "divide", - "arguments": { - "x": { - "from_node": "sub" - }, - "y": { - "from_node": "sum" - } - } - }, - "p3": { - "process_id": "multiply", - "arguments": { - "x": 2.5, - "y": { - "from_node": "div" + "description": "Loading the data; The order of the specified bands is important for the following reduce operation." + }, + "evi": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "dc" + }, + "reducer": { + "process_graph": { + "nir": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "index": 0 } }, - "result": true - }, - "sum": { - "process_id": "sum", - "arguments": { - "data": [ - 1, - { + "sub": { + "process_id": "subtract", + "arguments": { + "x": { "from_node": "nir" }, - { - "from_node": "p1" + "y": { + "from_node": "red" + } + } + }, + "div": { + "process_id": "divide", + "arguments": { + "x": { + "from_node": "sub" }, - { - "from_node": "p2" + "y": { + "from_node": "sum" } - ] - } - }, - "red": { - "process_id": "array_element", - "arguments": { - "data": { - "from_parameter": "data" - }, - "index": 1 - } - }, - "p1": { - "process_id": "multiply", - "arguments": { - "x": 6, - "y": { - "from_node": "red" } - } - }, - "blue": { - "process_id": "array_element", - "arguments": { - "data": { - "from_parameter": "data" + }, + "p3": { + "process_id": "multiply", + "arguments": { + "x": 2.5, + "y": { + "from_node": "div" + } }, - "index": 2 - } - }, - "p2": { - "process_id": "multiply", - "arguments": { - "x": -7.5, - "y": { - "from_node": "blue" + "result": true + }, + "sum": { + "process_id": "sum", + "arguments": { + "data": [ + 1, + { + "from_node": "nir" + }, + { + "from_node": "p1" + }, + { + "from_node": "p2" + } + ] + } + }, + "red": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "index": 1 + } + }, + "p1": { + "process_id": "multiply", + "arguments": { + "x": 6, + "y": { + "from_node": "red" + } + } + }, + "blue": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "index": 2 + } + }, + "p2": { + "process_id": "multiply", + "arguments": { + "x": -7.5, + "y": { + "from_node": "blue" + } } } } - } + }, + "dimension": "bands" }, - "dimension": "bands" + "description": "Compute the EVI. Formula: 2.5 * (NIR - RED) / (1 + NIR + 6*RED + -7.5*BLUE)" }, - "description": "Compute the EVI. Formula: 2.5 * (NIR - RED) / (1 + NIR + 6*RED + -7.5*BLUE)" - }, - "mintime": { - "process_id": "reduce_dimension", - "arguments": { - "data": { - "from_node": "evi" - }, - "reducer": { - "process_graph": { - "min": { - "process_id": "min", - "arguments": { - "data": { - "from_parameter": "data" - } - }, - "result": true + "mintime": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "evi" + }, + "reducer": { + "process_graph": { + "min": { + "process_id": "min", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } } - } + }, + "dimension": "t" }, - "dimension": "t" + "description": "Compute a minimum time composite by reducing the temporal dimension" }, - "description": "Compute a minimum time composite by reducing the temporal dimension" - }, - "save": { - "process_id": "save_result", - "arguments": { - "data": { - "from_node": "1" + "save": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "1" + }, + "format": "PNG", + "options": { + "red": null, + "green": null, + "blue": null, + "gray": null + } }, - "format": "PNG", - "options": { - "red": null, - "green": null, - "blue": null, - "gray": null - } - }, - "result": true + "result": true + } } } \ No newline at end of file diff --git a/docs/s2-max-ndvi.json b/docs/s2-max-ndvi.json index 1f6d594..714cb99 100644 --- a/docs/s2-max-ndvi.json +++ b/docs/s2-max-ndvi.json @@ -1,154 +1,156 @@ { - "apply": { - "process_id": "apply", - "arguments": { - "data": { - "from_node": "reduce_time" - }, - "process": { - "process_graph": { - "linear_scale_range": { - "process_id": "linear_scale_range", - "arguments": { - "x": { - "from_parameter": "x" + "process_graph": { + "apply": { + "process_id": "apply", + "arguments": { + "data": { + "from_node": "reduce_time" + }, + "process": { + "process_graph": { + "linear_scale_range": { + "process_id": "linear_scale_range", + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -1, + "inputMax": 1, + "outputMax": 255 }, - "inputMin": -1, - "inputMax": 1, - "outputMax": 255 - }, - "result": true + "result": true + } } } - } + }, + "description": "Stretch range from -1 / 1 to 0 / 255 for PNG visualization." }, - "description": "Stretch range from -1 / 1 to 0 / 255 for PNG visualization." - }, - "load_collection": { - "process_id": "load_collection", - "arguments": { - "id": "COPERNICUS/S2", - "spatial_extent": { - "type": "Polygon", - "coordinates": [ - [ - [ - 7.246856689453125, - 47.167543112150554 - ], - [ - 7.218189239501953, - 47.13520594493793 - ], - [ - 7.23552703857422, - 47.11570074493338 - ], + "load_collection": { + "process_id": "load_collection", + "arguments": { + "id": "COPERNICUS/S2", + "spatial_extent": { + "type": "Polygon", + "coordinates": [ [ - 7.2803306579589835, - 47.11488300552253 - ], - [ - 7.305736541748048, - 47.14793302647546 - ], - [ - 7.279300689697265, - 47.16999386399103 - ], - [ - 7.246856689453125, - 47.167543112150554 + [ + 7.246856689453125, + 47.167543112150554 + ], + [ + 7.218189239501953, + 47.13520594493793 + ], + [ + 7.23552703857422, + 47.11570074493338 + ], + [ + 7.2803306579589835, + 47.11488300552253 + ], + [ + 7.305736541748048, + 47.14793302647546 + ], + [ + 7.279300689697265, + 47.16999386399103 + ], + [ + 7.246856689453125, + 47.167543112150554 + ] ] ] + }, + "temporal_extent": [ + "2018-01-01T00:00:00Z", + "2018-01-31T23:59:59Z" + ], + "bands": [ + "B4", + "B8" ] }, - "temporal_extent": [ - "2018-01-01T00:00:00Z", - "2018-01-31T23:59:59Z" - ], - "bands": [ - "B4", - "B8" - ] + "description": "Loading the data; The order of the specified bands is important for the following reduce operation." }, - "description": "Loading the data; The order of the specified bands is important for the following reduce operation." - }, - "reduce_bands": { - "process_id": "reduce_dimension", - "arguments": { - "data": { - "from_node": "load_collection" - }, - "reducer": { - "process_graph": { - "red": { - "process_id": "array_element", - "arguments": { - "data": { - "from_parameter": "data" - }, - "label": "B4" - } - }, - "nir": { - "process_id": "array_element", - "arguments": { - "data": { - "from_parameter": "data" - }, - "label": "B8" - } - }, - "ndvi": { - "process_id": "normalized_difference", - "arguments": { - "x": { - "from_node": "nir" - }, - "y": { - "from_node": "red" + "reduce_bands": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "load_collection" + }, + "reducer": { + "process_graph": { + "red": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "B4" } }, - "result": true - } - } - }, - "dimension": "bands" - }, - "description": "Compute the NDVI: (NIR - RED) / (NIR + RED)" - }, - "reduce_time": { - "process_id": "reduce_dimension", - "arguments": { - "data": { - "from_node": "reduce_bands" - }, - "reducer": { - "process_graph": { - "max": { - "process_id": "max", - "arguments": { - "data": { - "from_parameter": "data" + "nir": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "B8" } }, - "result": true + "ndvi": { + "process_id": "normalized_difference", + "arguments": { + "x": { + "from_node": "nir" + }, + "y": { + "from_node": "red" + } + }, + "result": true + } } - } + }, + "dimension": "bands" }, - "dimension": "t" + "description": "Compute the NDVI: (NIR - RED) / (NIR + RED)" }, - "description": "Compute a minimum time composite by reducing the temporal dimension" - }, - "save": { - "process_id": "save_result", - "arguments": { - "data": { - "from_node": "apply" + "reduce_time": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "reduce_bands" + }, + "reducer": { + "process_graph": { + "max": { + "process_id": "max", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t" }, - "format": "PNG" + "description": "Compute a minimum time composite by reducing the temporal dimension" }, - "result": true + "save": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "apply" + }, + "format": "PNG" + }, + "result": true + } } } \ No newline at end of file diff --git a/docs/s5-ch4-methane-usa.json b/docs/s5-ch4-methane-usa.json index b8cd444..b819346 100644 --- a/docs/s5-ch4-methane-usa.json +++ b/docs/s5-ch4-methane-usa.json @@ -1,80 +1,82 @@ { - "4":{ - "process_id":"reduce_dimension", - "arguments":{ - "data":{ - "from_node":"9" - }, - "reducer":{ - "process_graph":{ - "3":{ - "process_id":"mean", - "arguments":{ - "data":{ - "from_parameter":"data" - } - }, - "result":true + "process_graph": { + "4":{ + "process_id":"reduce_dimension", + "arguments":{ + "data":{ + "from_node":"9" + }, + "reducer":{ + "process_graph":{ + "3":{ + "process_id":"mean", + "arguments":{ + "data":{ + "from_parameter":"data" + } + }, + "result":true + } } - } - }, - "dimension":"t" - } - }, - "5":{ - "process_id":"save_result", - "arguments":{ - "data":{ - "from_node":8 - }, - "format":"JPEG", - "options":{ - + }, + "dimension":"t" } }, - "result":true - }, - "8":{ - "process_id":"apply", - "arguments":{ - "data":{ - "from_node":4 + "5":{ + "process_id":"save_result", + "arguments":{ + "data":{ + "from_node":8 + }, + "format":"JPEG", + "options":{ + + } }, - "process":{ - "process_graph":{ - "2":{ - "process_id":"linear_scale_range", - "arguments":{ - "x":{ - "from_parameter":"x" + "result":true + }, + "8":{ + "process_id":"apply", + "arguments":{ + "data":{ + "from_node":4 + }, + "process":{ + "process_graph":{ + "2":{ + "process_id":"linear_scale_range", + "arguments":{ + "x":{ + "from_parameter":"x" + }, + "inputMin":1900, + "inputMax":1750, + "outputMax":255 }, - "inputMin":1900, - "inputMax":1750, - "outputMax":255 - }, - "result":true + "result":true + } } } } - } - }, - "9":{ - "process_id":"load_collection", - "arguments":{ - "id":"COPERNICUS/S5P/OFFL/L3_CH4", - "spatial_extent":{ - "west":-125.37597656250003, - "south":24.206889622398023, - "east":-66.75292968750001, - "north":49.38237278700956 - }, - "temporal_extent":[ - "2019-01-01T00:00:00Z", - "2019-03-31T23:59:59Z" - ], - "bands":[ - "CH4_column_volume_mixing_ratio_dry_air" - ] + }, + "9":{ + "process_id":"load_collection", + "arguments":{ + "id":"COPERNICUS/S5P/OFFL/L3_CH4", + "spatial_extent":{ + "west":-125.37597656250003, + "south":24.206889622398023, + "east":-66.75292968750001, + "north":49.38237278700956 + }, + "temporal_extent":[ + "2019-01-01T00:00:00Z", + "2019-03-31T23:59:59Z" + ], + "bands":[ + "CH4_column_volume_mixing_ratio_dry_air" + ] + } } } } \ No newline at end of file diff --git a/docs/s5-co-usa.json b/docs/s5-co-usa.json index de55de7..0a88946 100644 --- a/docs/s5-co-usa.json +++ b/docs/s5-co-usa.json @@ -1,75 +1,77 @@ { - "4":{ - "process_id":"reduce", - "arguments":{ - "data":{ - "from_node":"9" - }, - "reducer":{ - "process_graph":{ - "3":{ - "process_id":"mean", - "arguments":{ - "data":{ - "from_parameter":"data" - } - }, - "result":true + "process_graph": { + "4":{ + "process_id":"reduce", + "arguments":{ + "data":{ + "from_node":"9" + }, + "reducer":{ + "process_graph":{ + "3":{ + "process_id":"mean", + "arguments":{ + "data":{ + "from_parameter":"data" + } + }, + "result":true + } } - } - }, - "dimension":"t" - } - }, - "5":{ - "process_id":"save_result", - "arguments":{ - "data":{ - "from_node":8 - }, - "format":"JPEG", - "options":{ - + }, + "dimension":"t" } }, - "result":true - }, - "8":{ - "process_id":"apply", - "arguments":{ - "data":{ - "from_node":4 + "5":{ + "process_id":"save_result", + "arguments":{ + "data":{ + "from_node":8 + }, + "format":"JPEG", + "options":{ + + } }, - "process":{ - "process_graph":{ - "2":{ - "process_id":"linear_scale_range", - "arguments":{ - "x":{ - "from_parameter":"x" + "result":true + }, + "8":{ + "process_id":"apply", + "arguments":{ + "data":{ + "from_node":4 + }, + "process":{ + "process_graph":{ + "2":{ + "process_id":"linear_scale_range", + "arguments":{ + "x":{ + "from_parameter":"x" + }, + "inputMin":0, + "inputMax":0.05, + "outputMax":255 }, - "inputMin":0, - "inputMax":0.05, - "outputMax":255 - }, - "result":true + "result":true + } } } } - } - }, - "9":{ - "process_id":"load_collection", - "arguments":{ - "id":"COPERNICUS/S5P/NRTI/L3_CO", - "spatial_extent":null, - "temporal_extent":[ - "2018-12-15T00:00:00Z", - "2019-01-15T23:59:59Z" - ], - "bands":[ - "CO_column_number_density" - ] + }, + "9":{ + "process_id":"load_collection", + "arguments":{ + "id":"COPERNICUS/S5P/NRTI/L3_CO", + "spatial_extent":null, + "temporal_extent":[ + "2018-12-15T00:00:00Z", + "2019-01-15T23:59:59Z" + ], + "bands":[ + "CO_column_number_density" + ] + } } } } \ No newline at end of file diff --git a/docs/s5-no2-usa.json b/docs/s5-no2-usa.json index ea864de..aca9119 100644 --- a/docs/s5-no2-usa.json +++ b/docs/s5-no2-usa.json @@ -1,80 +1,82 @@ { - "4":{ - "process_id":"reduce_dimension", - "arguments":{ - "data":{ - "from_node":"9" - }, - "reducer":{ - "process_graph":{ - "3":{ - "process_id":"mean", - "arguments":{ - "data":{ - "from_parameter":"data" - } - }, - "result":true + "process_graph": { + "4":{ + "process_id":"reduce_dimension", + "arguments":{ + "data":{ + "from_node":"9" + }, + "reducer":{ + "process_graph":{ + "3":{ + "process_id":"mean", + "arguments":{ + "data":{ + "from_parameter":"data" + } + }, + "result":true + } } - } - }, - "dimension":"t" - } - }, - "5":{ - "process_id":"save_result", - "arguments":{ - "data":{ - "from_node":8 - }, - "format":"JPEG", - "options":{ - + }, + "dimension":"t" } }, - "result":true - }, - "8":{ - "process_id":"apply", - "arguments":{ - "data":{ - "from_node":4 + "5":{ + "process_id":"save_result", + "arguments":{ + "data":{ + "from_node":8 + }, + "format":"JPEG", + "options":{ + + } }, - "process":{ - "process_graph":{ - "2":{ - "process_id":"linear_scale_range", - "arguments":{ - "x":{ - "from_parameter":"x" + "result":true + }, + "8":{ + "process_id":"apply", + "arguments":{ + "data":{ + "from_node":4 + }, + "process":{ + "process_graph":{ + "2":{ + "process_id":"linear_scale_range", + "arguments":{ + "x":{ + "from_parameter":"x" + }, + "inputMin":0, + "inputMax":0.0002, + "outputMax":255 }, - "inputMin":0, - "inputMax":0.0002, - "outputMax":255 - }, - "result":true + "result":true + } } } } - } - }, - "9":{ - "process_id":"load_collection", - "arguments":{ - "id":"COPERNICUS/S5P/NRTI/L3_NO2", - "spatial_extent":{ - "west":-125.37597656250003, - "south":24.206889622398023, - "east":-66.75292968750001, - "north":49.38237278700956 - }, - "temporal_extent":[ - "2018-10-10T00:00:00Z", - "2018-10-13T23:59:59Z" - ], - "bands":[ - "NO2_column_number_density" - ] + }, + "9":{ + "process_id":"load_collection", + "arguments":{ + "id":"COPERNICUS/S5P/NRTI/L3_NO2", + "spatial_extent":{ + "west":-125.37597656250003, + "south":24.206889622398023, + "east":-66.75292968750001, + "north":49.38237278700956 + }, + "temporal_extent":[ + "2018-10-10T00:00:00Z", + "2018-10-13T23:59:59Z" + ], + "bands":[ + "NO2_column_number_density" + ] + } } } } \ No newline at end of file diff --git a/docs/terraclimate-max-temperature.json b/docs/terraclimate-max-temperature.json index c31c5a7..6e42637 100644 --- a/docs/terraclimate-max-temperature.json +++ b/docs/terraclimate-max-temperature.json @@ -1,51 +1,53 @@ { - "1": { - "process_id": "load_collection", - "arguments": { - "id": "IDAHO_EPSCOR/TERRACLIMATE", - "spatial_extent": null, - "temporal_extent": [ - "2017-07-01T00:00:00Z", - "2017-07-31T23:59:59Z" - ], - "bands": [ - "tmmx" - ] - } - }, - "2": { - "process_id": "save_result", - "arguments": { - "data": { - "from_node": "3" - }, - "format": "PNG", - "options": {} + "process_graph": { + "1": { + "process_id": "load_collection", + "arguments": { + "id": "IDAHO_EPSCOR/TERRACLIMATE", + "spatial_extent": null, + "temporal_extent": [ + "2017-07-01T00:00:00Z", + "2017-07-31T23:59:59Z" + ], + "bands": [ + "tmmx" + ] + } }, - "result": true - }, - "3": { - "process_id": "apply", - "arguments": { - "data": { - "from_node": "1" + "2": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "3" + }, + "format": "PNG", + "options": {} }, - "process": { - "process_graph": { - "2": { - "process_id": "linear_scale_range", - "arguments": { - "x": { - "from_parameter": "x" + "result": true + }, + "3": { + "process_id": "apply", + "arguments": { + "data": { + "from_node": "1" + }, + "process": { + "process_graph": { + "2": { + "process_id": "linear_scale_range", + "arguments": { + "x": { + "from_parameter": "x" + }, + "inputMin": -150, + "inputMax": 450, + "outputMax": 255 }, - "inputMin": -150, - "inputMax": 450, - "outputMax": 255 - }, - "result": true + "result": true + } } } } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 547ee45..de7bb0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openeo/earthengine-driver", - "version": "1.0.0-alpha.1", + "version": "1.0.0-beta.1", "stac_version": "0.9.0", "description": "An openEO driver for Google Earth Engine.", "main": "server.js", @@ -22,8 +22,8 @@ "url": "https://github.com/Open-EO/openeo-earthengine-editor.git" }, "devDependencies": { - "forever": "^2.0.0", - "jest": "^25.5.4", + "forever": "^3.0.0", + "jest": "^26.1.0", "jest-html-reporter": "^3.1.3", "nodemon": "^2.0.4" }, diff --git a/tests/data/sample-processgraph.json b/tests/data/sample-processgraph.json index f144ed4..f759279 100644 --- a/tests/data/sample-processgraph.json +++ b/tests/data/sample-processgraph.json @@ -1,56 +1,97 @@ { - "load_collection": { - "arguments": { - "id": "COPERNICUS/S2", - "temporal_extent": ["2018-04-30","2018-06-26"] + "process_graph": { + "load_collection": { + "process_id": "load_collection", + "arguments": { + "id": "COPERNICUS/S2", + "spatial_extent": null, + "temporal_extent": [ + "2018-01-01", + "2018-01-31" + ], + "bands": [ + "B4", + "B8" + ] + }, + "description": "Loading the data; The order of the specified bands is important for the following reduce operation." }, - "process_id": "load_collection" - }, - "b1": { - "arguments": { - "data": {"from_node": "load_collection"}, - "bands": ["B4"] - }, - "process_id": "filter_bands" - }, - "b2": { - "arguments": { - "data": {"from_node": "load_collection"}, - "bands": ["B8"] - }, - "process_id": "filter_bands" - }, - "normalized_difference": { - "arguments": { - "band1": {"from_node": "b1"}, - "band2": {"from_node": "b2"} - }, - "process_id": "normalized_difference" - }, - "reduce": { - "arguments": { - "data": {"from_node": "normalized_difference"}, - "dimension": "t", - "reducer": { - "callback": { - "min": { - "arguments": { - "data": {"from_argument": "data"} + "reduce_bands": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "load_collection" + }, + "reducer": { + "process_graph": { + "red": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "B4" + } }, - "process_id": "min", - "result": true + "nir": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "B8" + } + }, + "ndvi": { + "process_id": "normalized_difference", + "arguments": { + "x": { + "from_node": "nir" + }, + "y": { + "from_node": "red" + } + }, + "result": true + } } - } - } + }, + "dimension": "bands" + }, + "description": "Compute the NDVI: (NIR - RED) / (NIR + RED)" }, - "process_id": "reduce" - }, - "save_result": { - "arguments": { - "data": {"from_node": "reduce"}, - "format": "png" + "reduce_time": { + "process_id": "reduce_dimension", + "arguments": { + "data": { + "from_node": "reduce_bands" + }, + "reducer": { + "process_graph": { + "max": { + "process_id": "max", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t" + }, + "description": "Compute a minimum time composite by reducing the temporal dimension" }, - "process_id": "save_result", - "result": true + "save": { + "process_id": "save_result", + "arguments": { + "data": { + "from_node": "apply" + }, + "format": "GTIFF-THUMB" + }, + "result": true + } } } \ No newline at end of file diff --git a/tests/processgraph.test.js b/tests/processgraph.test.js index 4a970d7..4033433 100644 --- a/tests/processgraph.test.js +++ b/tests/processgraph.test.js @@ -5,36 +5,35 @@ const GeeProcessGraph = require('../src/processgraph/processgraph'); const json = require('./data/sample-processgraph.json'); describe('Process Graph Registry', () => { - var registry, p, context; + var p; - beforeAll(() => { - registry = new GeeProcessRegistry(); - context = new ProcessingContext(new ServerContext()); - p = new GeeProcessGraph(json, context); - return Promise.resolve(); + beforeAll(async () => { + let serverContext = new ServerContext(); + await serverContext.collections().loadCatalog(); + serverContext.processes().addFromFolder('./src/processes/'); + p = new GeeProcessGraph(json, new ProcessingContext(serverContext)); }); - test('Load Processes', () => { - registry.addFromFolder('./src/processes/'); - expect(registry.count()).toBe(18); + test('Processes', () => { + let registry = p.getContext().server().processes(); + expect(registry.count()).toBe(66); + expect(registry.get('load_collection')).not.toBe(null); + }); + + test('Collections', () => { + let catalog = p.getContext().server().collections(); + expect(catalog.getData('COPERNICUS/S2')).not.toBe(null); }); test('Validate', async () => { var errors = await p.validate(false); - - expect(p.getNode("load_collection").getNextNodes().map(n => n.id)).toEqual(["b1", "b2"]); - expect(p.getStartNodeIds()).toEqual(["load_collection"]); - expect(p.getResultNode().id).toBe("save_result"); - if (errors.count() > 0) { console.log(errors.getMessage()); } expect(errors.count()).toBe(0); + expect(p.getStartNodeIds()).toEqual(["load_collection"]); + expect(p.getNode("load_collection").getNextNodes().map(n => n.id)).toEqual(["reduce_bands"]); + expect(p.getResultNode().id).toBe("save"); }); -/* test('Execute', async () => { - var resultNode = await p.execute(); - expect(resultNode).not.toBeNull(); // TODO: Futher checks... - }); */ - }); \ No newline at end of file