Digitizing in Python
Contents
Purpose
The purpose of this tutorial is to automate the digitization of land cover features such as vegetation, waterbodies, and roads, using Sentinel-2 satellite imagery and Python-based geospatial tools.
Objective
Use Google Earth Engine (GEE) to acquire the satellite images for processing in python. Compute NDVI (vegetation), NDWI (water), NDBI (roads) indices. Export rasters to your Google Drive. Convert rasters to vectors. Visualize and colourize digitized features.
Software Used
Google Earth Engine Google Colab or any other Python language system or notebooks.
Python libraries:
earthengine-api, geemap, rasterio, geopandas, shapely, matplotlib
Setting up Colab and Google Earth Engine
Set up a Google Earth Engine account for free with these similar instructions (note that you do not need to make an account under a student requirement or the sort or any paid service, this is free!): https://courses.spatialthoughts.com/gee-sign-up.html
After your account is created, create a new project under a name of your choice. This will be linked back in the Colab notebook.
To set up a Colab notebook, simply open a new colab notebook within your google drive.
Now, in the colab notebook follow this code and your own project name replacing the one in the code snippet below:
!pip install earthengine-api geemap rasterio geopandas shapely matplotlib
import ee
import geemap
import geopandas as gpd
from shapely.geometry import shape
import matplotlib.pyplot as plt
import numpy as np
from rasterio.features import shapes
import rasterio
from rasterio.plot import show
ee.Authenticate()
ee.Initialize(project='geom4008-ethan')