From 96014b380e7871f8bf84e3d9b8e006ea994e086a Mon Sep 17 00:00:00 2001 From: Maxim Lamare Date: Thu, 23 May 2024 18:44:05 +0200 Subject: [PATCH 1/2] Update endpoints of collections --- .../pv-forest-change.ipynb | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-forest-change.ipynb b/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-forest-change.ipynb index 0d908d4..aa29e37 100644 --- a/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-forest-change.ipynb +++ b/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-forest-change.ipynb @@ -173,7 +173,7 @@ " <meta name="viewport" content="width=device-width,\n", " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", " <style>\n", - " #map_2b934d161e5bf434ebf818ac861e1035 {\n", + " #map_df089e917e35701450d78f623dcad07b {\n", " position: relative;\n", " width: 100.0%;\n", " height: 100.0%;\n", @@ -187,14 +187,14 @@ "<body>\n", " \n", " \n", - " <div class="folium-map" id="map_2b934d161e5bf434ebf818ac861e1035" ></div>\n", + " <div class="folium-map" id="map_df089e917e35701450d78f623dcad07b" ></div>\n", " \n", "</body>\n", "<script>\n", " \n", " \n", - " var map_2b934d161e5bf434ebf818ac861e1035 = L.map(\n", - " "map_2b934d161e5bf434ebf818ac861e1035",\n", + " var map_df089e917e35701450d78f623dcad07b = L.map(\n", + " "map_df089e917e35701450d78f623dcad07b",\n", " {\n", " center: [-6.73450947645923, -52.32675867212383],\n", " crs: L.CRS.EPSG3857,\n", @@ -208,47 +208,47 @@ "\n", " \n", " \n", - " var tile_layer_833d2a1c4e89012c09e3b286fc850507 = L.tileLayer(\n", + " var tile_layer_e28f54ac032566bf3e293d8f9ab9f808 = L.tileLayer(\n", " "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n", " {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", " );\n", " \n", " \n", - " tile_layer_833d2a1c4e89012c09e3b286fc850507.addTo(map_2b934d161e5bf434ebf818ac861e1035);\n", + " tile_layer_e28f54ac032566bf3e293d8f9ab9f808.addTo(map_df089e917e35701450d78f623dcad07b);\n", " \n", " \n", - " function geo_json_91fa72e5e9f9c01524e312f8850a3fa2_styler(feature) {\n", + " function geo_json_7fdd4990e0b8e3519b1862784c9cf66d_styler(feature) {\n", " switch(feature.id) {\n", " default:\n", " return {"fillColor": "blue"};\n", " }\n", " }\n", "\n", - " function geo_json_91fa72e5e9f9c01524e312f8850a3fa2_onEachFeature(feature, layer) {\n", + " function geo_json_7fdd4990e0b8e3519b1862784c9cf66d_onEachFeature(feature, layer) {\n", " layer.on({\n", " });\n", " };\n", - " var geo_json_91fa72e5e9f9c01524e312f8850a3fa2 = L.geoJson(null, {\n", - " onEachFeature: geo_json_91fa72e5e9f9c01524e312f8850a3fa2_onEachFeature,\n", + " var geo_json_7fdd4990e0b8e3519b1862784c9cf66d = L.geoJson(null, {\n", + " onEachFeature: geo_json_7fdd4990e0b8e3519b1862784c9cf66d_onEachFeature,\n", " \n", - " style: geo_json_91fa72e5e9f9c01524e312f8850a3fa2_styler,\n", + " style: geo_json_7fdd4990e0b8e3519b1862784c9cf66d_styler,\n", " });\n", "\n", - " function geo_json_91fa72e5e9f9c01524e312f8850a3fa2_add (data) {\n", - " geo_json_91fa72e5e9f9c01524e312f8850a3fa2\n", + " function geo_json_7fdd4990e0b8e3519b1862784c9cf66d_add (data) {\n", + " geo_json_7fdd4990e0b8e3519b1862784c9cf66d\n", " .addData(data);\n", " }\n", - " geo_json_91fa72e5e9f9c01524e312f8850a3fa2_add({"features": [{"geometry": {"coordinates": [[[-52.327365999997696, -6.70518499999564], [-52.34195699999621, -6.709276999997054], [-52.340411999998686, -6.716608000001646], [-52.35603300000155, -6.724108999996197], [-52.34830900000054, -6.745759000002462], [-52.33594900000237, -6.7406449999983185], [-52.332858999998344, -6.755988000002078], [-52.32238799999921, -6.762976999996534], [-52.31535000000104, -6.765363000001587], [-52.3143199999967, -6.758715000004025], [-52.31775299999766, -6.751725999998545], [-52.31535000000104, -6.745759000002462], [-52.29389199999602, -6.747804999999408], [-52.296810000003795, -6.739452000002298], [-52.29749700000222, -6.729564000000073], [-52.31809600000357, -6.727859000002256], [-52.327365999997696, -6.70518499999564]]], "type": "Polygon"}, "id": "0", "type": "Feature"}], "type": "FeatureCollection"});\n", + " geo_json_7fdd4990e0b8e3519b1862784c9cf66d_add({"features": [{"geometry": {"coordinates": [[[-52.327365999997696, -6.70518499999564], [-52.34195699999621, -6.709276999997054], [-52.340411999998686, -6.716608000001646], [-52.35603300000155, -6.724108999996197], [-52.34830900000054, -6.745759000002462], [-52.33594900000237, -6.7406449999983185], [-52.332858999998344, -6.755988000002078], [-52.32238799999921, -6.762976999996534], [-52.31535000000104, -6.765363000001587], [-52.3143199999967, -6.758715000004025], [-52.31775299999766, -6.751725999998545], [-52.31535000000104, -6.745759000002462], [-52.29389199999602, -6.747804999999408], [-52.296810000003795, -6.739452000002298], [-52.29749700000222, -6.729564000000073], [-52.31809600000357, -6.727859000002256], [-52.327365999997696, -6.70518499999564]]], "type": "Polygon"}, "id": "0", "type": "Feature"}], "type": "FeatureCollection"});\n", "\n", " \n", " \n", - " geo_json_91fa72e5e9f9c01524e312f8850a3fa2.addTo(map_2b934d161e5bf434ebf818ac861e1035);\n", + " geo_json_7fdd4990e0b8e3519b1862784c9cf66d.addTo(map_df089e917e35701450d78f623dcad07b);\n", " \n", "</script>\n", "</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen>" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -471,13 +471,12 @@ " evalscript=evalscript_forest_change,\n", " input_data=[\n", " SentinelHubStatistical.input_data(\n", - " # Note that we set the service_url to the US-West-2 (Oregon) region since the data are stored there\n", - " DataCollection.define_byoc(height_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(height_collection_id),\n", " identifier=\"canopyHeight\",\n", " time_interval=(f\"{year1}-01-01\", f\"{year2}-01-01\"),\n", " ),\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(cover_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(cover_collection_id),\n", " identifier=\"canopyCover\",\n", " time_interval=(f\"{year1}-01-01\", f\"{year2}-01-01\"),\n", " ),\n", From ea0382695b82c08c0014f3049f03107a15595743 Mon Sep 17 00:00:00 2001 From: Maxim Lamare Date: Thu, 23 May 2024 18:47:39 +0200 Subject: [PATCH 2/2] Change endpoint --- .../pv-polygon-level-timeseries.ipynb | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-polygon-level-timeseries.ipynb b/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-polygon-level-timeseries.ipynb index db11daa..34101dd 100644 --- a/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-polygon-level-timeseries.ipynb +++ b/jupyter-notebooks/workflows/planet_sandbox_data/forest-carbon-dilligence/pv-polygon-level-timeseries.ipynb @@ -175,7 +175,7 @@ " <meta name="viewport" content="width=device-width,\n", " initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />\n", " <style>\n", - " #map_67ed2ca0afb4f274ec5381f614d31a34 {\n", + " #map_8f1fc6857b8befa1cec7fad989a9113e {\n", " position: relative;\n", " width: 100.0%;\n", " height: 100.0%;\n", @@ -189,14 +189,14 @@ "<body>\n", " \n", " \n", - " <div class="folium-map" id="map_67ed2ca0afb4f274ec5381f614d31a34" ></div>\n", + " <div class="folium-map" id="map_8f1fc6857b8befa1cec7fad989a9113e" ></div>\n", " \n", "</body>\n", "<script>\n", " \n", " \n", - " var map_67ed2ca0afb4f274ec5381f614d31a34 = L.map(\n", - " "map_67ed2ca0afb4f274ec5381f614d31a34",\n", + " var map_8f1fc6857b8befa1cec7fad989a9113e = L.map(\n", + " "map_8f1fc6857b8befa1cec7fad989a9113e",\n", " {\n", " center: [-6.73450947645923, -52.32675867212383],\n", " crs: L.CRS.EPSG3857,\n", @@ -210,47 +210,47 @@ "\n", " \n", " \n", - " var tile_layer_efc418477024909aa824c66b51f9f443 = L.tileLayer(\n", + " var tile_layer_881671c67e7b133163aebcff034cef56 = L.tileLayer(\n", " "https://tile.openstreetmap.org/{z}/{x}/{y}.png",\n", " {"attribution": "\\u0026copy; \\u003ca href=\\"https://www.openstreetmap.org/copyright\\"\\u003eOpenStreetMap\\u003c/a\\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}\n", " );\n", " \n", " \n", - " tile_layer_efc418477024909aa824c66b51f9f443.addTo(map_67ed2ca0afb4f274ec5381f614d31a34);\n", + " tile_layer_881671c67e7b133163aebcff034cef56.addTo(map_8f1fc6857b8befa1cec7fad989a9113e);\n", " \n", " \n", - " function geo_json_a3f6b7eb54b13c6c9817ebd0032ab373_styler(feature) {\n", + " function geo_json_8f5f5028b13ffdc112672a8629c650b0_styler(feature) {\n", " switch(feature.id) {\n", " default:\n", " return {"fillColor": "blue"};\n", " }\n", " }\n", "\n", - " function geo_json_a3f6b7eb54b13c6c9817ebd0032ab373_onEachFeature(feature, layer) {\n", + " function geo_json_8f5f5028b13ffdc112672a8629c650b0_onEachFeature(feature, layer) {\n", " layer.on({\n", " });\n", " };\n", - " var geo_json_a3f6b7eb54b13c6c9817ebd0032ab373 = L.geoJson(null, {\n", - " onEachFeature: geo_json_a3f6b7eb54b13c6c9817ebd0032ab373_onEachFeature,\n", + " var geo_json_8f5f5028b13ffdc112672a8629c650b0 = L.geoJson(null, {\n", + " onEachFeature: geo_json_8f5f5028b13ffdc112672a8629c650b0_onEachFeature,\n", " \n", - " style: geo_json_a3f6b7eb54b13c6c9817ebd0032ab373_styler,\n", + " style: geo_json_8f5f5028b13ffdc112672a8629c650b0_styler,\n", " });\n", "\n", - " function geo_json_a3f6b7eb54b13c6c9817ebd0032ab373_add (data) {\n", - " geo_json_a3f6b7eb54b13c6c9817ebd0032ab373\n", + " function geo_json_8f5f5028b13ffdc112672a8629c650b0_add (data) {\n", + " geo_json_8f5f5028b13ffdc112672a8629c650b0\n", " .addData(data);\n", " }\n", - " geo_json_a3f6b7eb54b13c6c9817ebd0032ab373_add({"features": [{"geometry": {"coordinates": [[[-52.327365999997696, -6.70518499999564], [-52.34195699999621, -6.709276999997054], [-52.340411999998686, -6.716608000001646], [-52.35603300000155, -6.724108999996197], [-52.34830900000054, -6.745759000002462], [-52.33594900000237, -6.7406449999983185], [-52.332858999998344, -6.755988000002078], [-52.32238799999921, -6.762976999996534], [-52.31535000000104, -6.765363000001587], [-52.3143199999967, -6.758715000004025], [-52.31775299999766, -6.751725999998545], [-52.31535000000104, -6.745759000002462], [-52.29389199999602, -6.747804999999408], [-52.296810000003795, -6.739452000002298], [-52.29749700000222, -6.729564000000073], [-52.31809600000357, -6.727859000002256], [-52.327365999997696, -6.70518499999564]]], "type": "Polygon"}, "id": "0", "type": "Feature"}], "type": "FeatureCollection"});\n", + " geo_json_8f5f5028b13ffdc112672a8629c650b0_add({"features": [{"geometry": {"coordinates": [[[-52.327365999997696, -6.70518499999564], [-52.34195699999621, -6.709276999997054], [-52.340411999998686, -6.716608000001646], [-52.35603300000155, -6.724108999996197], [-52.34830900000054, -6.745759000002462], [-52.33594900000237, -6.7406449999983185], [-52.332858999998344, -6.755988000002078], [-52.32238799999921, -6.762976999996534], [-52.31535000000104, -6.765363000001587], [-52.3143199999967, -6.758715000004025], [-52.31775299999766, -6.751725999998545], [-52.31535000000104, -6.745759000002462], [-52.29389199999602, -6.747804999999408], [-52.296810000003795, -6.739452000002298], [-52.29749700000222, -6.729564000000073], [-52.31809600000357, -6.727859000002256], [-52.327365999997696, -6.70518499999564]]], "type": "Polygon"}, "id": "0", "type": "Feature"}], "type": "FeatureCollection"});\n", "\n", " \n", " \n", - " geo_json_a3f6b7eb54b13c6c9817ebd0032ab373.addTo(map_67ed2ca0afb4f274ec5381f614d31a34);\n", + " geo_json_8f5f5028b13ffdc112672a8629c650b0.addTo(map_8f1fc6857b8befa1cec7fad989a9113e);\n", " \n", "</script>\n", "</html>\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen>" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -381,16 +381,15 @@ " ),\n", " input_data=[\n", " SentinelHubStatistical.input_data(\n", - " # Note that we set the service_url to the US-West-2 (Oregon) region since the data are stored there\n", - " DataCollection.define_byoc(height_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(height_collection_id),\n", " identifier=\"canopyHeight\",\n", " ),\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(cover_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(cover_collection_id),\n", " identifier=\"canopyCover\",\n", " ),\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(carbon_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(carbon_collection_id),\n", " identifier=\"carbon\",\n", " ),\n", " ],\n", @@ -997,7 +996,7 @@ " # Set the collection containing Aboveground Carbon Density, Forest Carbon Diligence \n", " # Here we fetch data from 2013 to 2017\n", " SentinelHubRequest.input_data(\n", - " data_collection=DataCollection.define_byoc(carbon_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " data_collection=DataCollection.define_byoc(carbon_collection_id),\n", " time_interval=(f\"{start_year}-01-01\", f\"{end_year}-01-01\"),\n", " )\n", " ],\n", @@ -1635,15 +1634,15 @@ " ),\n", " input_data=[\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(height_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(height_collection_id),\n", " identifier=\"canopyHeight\",\n", " ),\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(cover_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(cover_collection_id),\n", " identifier=\"canopyCover\",\n", " ),\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(carbon_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(carbon_collection_id),\n", " identifier=\"carbon\",\n", " ),\n", " ],\n", @@ -2245,13 +2244,13 @@ " evalscript=evalscript_maps,\n", " input_data=[\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(height_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(height_collection_id),\n", " identifier=\"canopyHeight\",\n", " time_interval=(\"2013-01-01\", \"2017-12-31\"),\n", " mosaicking_order=\"leastRecent\",\n", " ),\n", " SentinelHubStatistical.input_data(\n", - " DataCollection.define_byoc(cover_collection_id, service_url=\"https://services-uswest2.sentinel-hub.com\"),\n", + " DataCollection.define_byoc(cover_collection_id),\n", " identifier=\"canopyCover\",\n", " time_interval=(\"2013-01-01\", \"2017-12-31\"),\n", " mosaicking_order=\"leastRecent\",\n",