Skip to content

Commit

Permalink
Update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
sdunesme committed May 3, 2024
1 parent 8e323fd commit c7209b1
Showing 1 changed file with 49 additions and 19 deletions.
68 changes: 49 additions & 19 deletions notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,7 @@
"outputs": [],
"source": [
"# Replace this uuid with the output of the previous cell to keep trace of your current work\n",
"zones_uuid = '1649bc77209a41a990b610bfa10f272b'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Retrieve extraction zones with UUID\n",
"extraction_zones = assets_management.ExtractionZones(local_file='./example_data/Lhasa_RC_DGO2km_updated.shp', # Local file containing extraction features\n",
" fid_field='DGO_FID', # Unique identifier field name\n",
" zone_type='DGOs', # Literal description of the zones types (eg. DGOs, Cites, Gravel quarries, ...)\n",
" description='DGOs of 2km for Lhasa river', # Literal description of the zones. Give a maximum details so other GloUrb researcher can understand chat are these zones.\n",
" author='Georges Abitbol', # Identify the producer of those extraction zones\n",
" asset_uuid=zones_uuid\n",
" )"
"zones_uuid = '423023412407495ba4d441e835ad0f19'"
]
},
{
Expand Down Expand Up @@ -160,6 +144,16 @@
"extraction_zones.gee_state # 'none', 'partial' or 'complete'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Once the upload process is started, you can retrieve your asset with it's UUID\n",
"extraction_zones = assets_management.ExtractionZones(asset_uuid=zones_uuid)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -207,7 +201,18 @@
"outputs": [],
"source": [
"# Get all the extraction zones available on the GEE project\n",
"collection.getGlourbeeExtractionZones()"
"glourbee_zones = collection.getGlourbeeExtractionZones()\n",
"glourbee_zones"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Use one of the extraction zones for your current work\n",
"extraction_zones = assets_management.ExtractionZones(asset_uuid='423023412407495ba4d441e835ad0f19')"
]
},
{
Expand All @@ -217,7 +222,21 @@
"outputs": [],
"source": [
"# Get all the metrics datasets already calculated for an extraction zone dataset\n",
"collection.getGlourbeeMetrics(zones_uuid='8e57f5112a314a68a39666993ec1f773')"
"glourbee_metrics = collection.getGlourbeeMetrics(zones_uuid='8e57f5112a314a68a39666993ec1f773')\n",
"glourbee_metrics"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Download one of the metrics datasets\n",
"metrics = assets_management.MetricsDataset(asset_uuid='54a79deaaf47443392b9ae5178dd5f03', parent_zones='8e57f5112a314a68a39666993ec1f773')\n",
"metrics.download(output_file='./example_data/metrics.csv',\n",
" overwrite=False # By setting this to False, download will resume at his previous step if it was interrupted\n",
" )"
]
},
{
Expand Down Expand Up @@ -353,6 +372,17 @@
"metrics.cancel_linked_tasks()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Delete the metrics dataset from GEE\n",
"# WARNING: non reversible operation\n",
"metrics.delete()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit c7209b1

Please sign in to comment.