Notebook 1: Python for Geospatial Data
Hands-on with GeoPandas and Rasterio
Session 3 Hands-On Notebook
This notebook accompanies Session 3: Python for Geospatial Data. You’ll learn to work with vector data using GeoPandas and raster data using Rasterio.
Learning Objectives
By completing this notebook, you will:
- Load and visualize vector data with GeoPandas
- Work with different vector formats (Shapefiles, GeoJSON, GeoPackage)
- Perform coordinate reference system transformations
- Read and process raster data with Rasterio
- Extract band information and metadata
- Visualize multi-band imagery
- Apply the concepts to Philippine data
Getting Started
Option 1: Open in Google Colab (Recommended)
Click the button below to open this notebook in Google Colab:
If you get a “Not Found” error: 1. The notebook files need to be pushed to GitHub first 2. Alternative: Download the notebook below and upload to your own Google Drive 3. Then open from Drive in Colab
Advantages: - No installation required - Free GPU access - Auto-saves to Google Drive - Pre-configured environment
Option 2: Download Notebook
Download the Jupyter notebook to run locally or upload to your own Colab:
Requirements for local use:
pip install numpy pandas matplotlib geopandas rasterioOption 3: View Online
You can also view the notebook content below without running any code.
Notebook Preview
This is a hands-on exercise notebook. For the best learning experience, open it in Google Colab or Jupyter to run the code cells interactively.
Topics Covered
- Introduction to GeoPandas
- Reading vector data
- Exploring GeoDataFrames
- Coordinate reference systems
- Spatial operations
- Working with Philippine Data
- Loading administrative boundaries
- Filtering regions and provinces
- Calculating areas and centroids
- Creating maps
- Introduction to Rasterio
- Reading raster data
- Understanding raster metadata
- Extracting bands
- Visualizing imagery
- Palawan Case Study
- Sentinel-2 imagery analysis
- Land cover visualization
- Spectral band combinations
- NDVI calculation
Prerequisites
Before starting this notebook, ensure you have:
- Completed the Setup Guide
- Google account (for Colab)
- Basic Python knowledge
- Understanding of Session 3 concepts
Notebook Contents
The full interactive notebook includes:
- 15+ code cells with detailed explanations
- 10+ visualizations of vector and raster data
- Exercises to test your understanding
- Philippine case studies using real data
- Troubleshooting tips for common issues
Support
During the Training
- Ask questions in the live session
- Consult teaching assistants
- Work through exercises at your own pace
After the Training
- Review the Cheat Sheets
- Check the FAQ
- Access the Glossary
Next Steps
After completing this notebook:
- ✅ Practice with your own Philippine data
- ✅ Move on to Session 4: Google Earth Engine
- ✅ Try Notebook 2: Google Earth Engine
Ready to code? Open the notebook in Colab and start learning!