One of the important freshwater waterbodies of central Chili, Lake Aculeo Lagoon shrank over time due to climatic drought, drying of surface tributaries and streams that provided a continuous ﬂow of water and high existing demand of ground water . The lagoon dried completely in May of 2018. Those whose livelihoods depend on the lake are alarmed, as the shrinking lake changes the land cover of the area and impacts the economy. In order to help them identify and save their waterbodies, we'll generate land cover and compare imagery between 2016 and 2017 to quantify the surface area of the lake and show changes over time.
Manually extracting features from raw data, such as generating land cover maps, is time consuming. Deep learning automates the process and minimizes the manual interaction necessary to complete these tasks. To quantify the change in lake surface area from 2016 to 2017, we'll classify the land cover in both images, identifying the areas covered with water and distinguishing them from other land cover, such as vegetation or urban areas.
This sample aims to demonstrate how ArcGIS pretrained models can be used to generate landcover from imageries of different time periods for further analysis. Once the land covers are created, we will use arcgis.raster submodule of ArcGIS API for Python for calculating surface area reduced from 2016 to 2017.
import arcgis from arcgis.gis import GIS from arcgis.learn import classify_pixels from arcgis.raster.functions import equal_to from arcgis.raster.functions import extract_band import pandas as pd from datetime import datetime as dt from ipywidgets import HBox, VBox, Label, Layout
gis = GIS("home")
Search for Multispectral Sentinel-2 Level 1-C imagery for year 2016 and 2017 on the Copernicus Open Access Hub. Download imagey of the desired time period and publish them in ArcGIS Online. The code below uses the
get method to get items.
sentinel2016 = gis.content.get("a264d1eaa8bd4ff2a0a1e27b59daa7d3") sentinel2017 = gis.content.get("ea192d03d1324c62a2cb91e26e3a0ece")
Search for the Land Cover Classification (Sentinel-2) deep learning package in ArcGIS Online. We can search for content shared by users outside our organization by setting
outside_org to True.
model = gis.content.search( "Land Cover Classification (Sentinel-2) owner: esri_analytics", "Deep Learning Package", outside_org=True, ) model
This model is trained on Corine Land Cover (CLC) 2018 data that contains 16 classes. The screenshot below shows the color code for each land cover class.
As all the bands cannot be depicted at the same time, we usually pick a combination of three bands that we display through the color channels red, green, and blue, which can be seen by the human eye.
sentinel2016_rgb = extract_band(sentinel2016.layers, [4, 3, 2]) sentinel2017_rgb = extract_band(sentinel2017.layers, [4, 3, 2])
Let's compare the imagery visually to get a sense of how the shape of the lake has evolved over time.
map1 = gis.map() map1.add_layer(sentinel2016_rgb) map2 = gis.map() map2.add_layer(sentinel2017_rgb)
hbox_layout = Layout() hbox_layout.justify_content = "space-around" hb1 = HBox([Label("Sentinel-2016"), Label("Sentinel-2017")]) hb1.layout = hbox_layout VBox([hb1, HBox([map1, map2])])