A collection of notebooks and exercises covering Google Earth Engine, GeoPython, Geospatial ML, Geospatial Deep Learning, and GeoAI.
-
Clone the repository and navigate to the project directory.
-
Install dependencies:
uv sync
-
Launch JupyterLab:
uv run jupyter lab
You can run these notebooks directly in Google Colab without any local setup.
Click the badge below to browse and open notebooks from this repository in Google Colab:
Or navigate directly to:
https://colab.research.google.com/github/benhur07b/learn-python-geopython-ml
Once a notebook is open in Colab, install the required dependencies by running the following at the top of the notebook:
Most dependencies should already be available in Colab. If not, you can install packages individually as needed:
!pip install <package-name>- Colab provides free GPU/TPU access, which is useful for deep learning notebooks. Change your Colab runtime as needed.
- Files created during a session are temporary and will be lost when the session ends unless saved to Google Drive.
Before you can use Google Earth Engine (GEE), you need to:
- Have or create a Google account.
- Request access to GEE (non-commercial or commercial).
- Enable the Earth Engine API for your Google Cloud project.
- Go to https://earthengine.google.com/noncommercial/.
- Click Get started for free and sign in with your Google account.
- Fill out the registration form. Select the appropriate non-commercial use type (e.g., research, education).
- Submit the form and wait for an approval email from Google. This may take a few minutes to a few days.
Note: Non-commercial use is free but intended for research, education, and non-profit applications. For commercial use, see https://earthengine.google.com/commercial/.
Once your account is approved, you need to enable the Earth Engine API for a Google Cloud project:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- In the search bar, search for Earth Engine API and select it.
- Click Enable.
- Make note of your Project ID — you will need it when initializing GEE in your notebooks.
After enabling the API, authenticate and initialize GEE in your notebook:
import ee
# Run once to authenticate (opens a browser window for OAuth)
ee.Authenticate()
# Initialize with your Cloud project
ee.Initialize(project="your-project-id")ee.Authenticate()only needs to be run once per environment. It stores credentials locally.ee.Initialize()must be called at the start of every session.
Tip: In Google Colab, use
ee.Authenticate()withauth_mode="notebook"if the default browser flow does not work:ee.Authenticate(auth_mode="notebook")