Assignment 4#

Due: Wednesday Oct 8th at 11:59 pm ET

Goal#

Practice the fundamentals of Coordinate Reference Systems (CRS) and reprojection using Python. And package your work in a Docker container for reproducibility.


Instructions#

You should submit this assignment to your existing geog213-assignments or geog313-assignments GitHub repository under a new directory named assignment-4/. Include:

  • An executed Jupyter notebook (.ipynb) with all steps and outputs.

  • A Dockerfile that builds a reproducible environment.

  • A README.md with instructions to reproduce the results of your work.

  • The provided CSV file in your assignment-4/ folder.


Dataset#

Use the CSV file containing latitudes and longitudes of 10 German cities located here. Save as german_cities.csv in your assignment-4/data/ directory:


Tasks#

1) Environment Setup w Docker (15 pts)#

Create a Dockerfile in assignment-4/ that:

  • Uses a lightweight base image (e.g., continuumio/miniconda3).

  • Installs the correct version of the following packages in a new environment:

    • pandas

    • pyproj

    • matplotlib

    • jupyterlab

  • Sets the working directory to /home/assignment.

  • Configures the container to start JupyterLab on docker run.

Make a new commit, and push this part of the assignment to your GitHub repository.


2) Load and Inspect (10 pts)#

  • Load german_cities.csv into a Pandas DataFrame.

  • Print the first few rows and confirm the CRS is WGS84 (EPSG:4326).

  • Briefly explain what EPSG:4326 means (coordinate system, units). Include this in your notebook.


3) Transform Coordinates (25 pts)#

  • Use PyProj to create two CRS objects:

    • WGS84: EPSG:4326

    • UTM Zone 32N: EPSG:32632

  • Transform all city coordinates from WGS84 to UTM Zone 32N.

  • Add two new columns to your DataFrame and record the reprojected coordinates: x_utm and y_utm (in meters).

  • Print the updated DataFrame.

  • Save the updated DataFrame (with UTM columns) as results/german_cities_utm.csv.


3) Compute Distances (20 pts)#

  • Select Berlin and Munich.

  • Compute the distance between them:

    • In degrees.

    • In meters.

  • Explain why the degree-based distance is misleading.


4) Compute Bounding Box Area (20 pts)#

  • Compute and print coordinates of the bounding box containing all 10 cities in:

    • WGS84 (degrees), and

    • UTM (meters)

  • Calculate the area of the UTM bounding box in square kilometers.

  • Explain why area calculation in degrees is not meaningful. Include this in your notebook.


5) Visualization (10 pts)#

  • Create two simple scatter plots next to each other:

    • The first one with original coordinates (lat vs lon).

    • The second one with projected coordinates (x_utm vs y_utm).

  • Add titles and axis labels to show the difference in scale and units.


Deliverables#

Your assignment-4/ directory should include at least the following files:

  • data/german_cities.csv (provided above)

  • Dockerfile

  • notebooks/crs_reprojection.ipynb (executed)

  • results/german_cities_utm.csv

  • README.md