This exercise tests your ability to:
- Parse and merge data using Python
- Visualize geospatial data using React + Leaflet
You may use AI tools during the session, but be prepared to explain your reasoning and design decisions.
You are given three input datasets:
fields.geojson— polygon boundaries of agricultural fieldssamples.geojson— individual soil samples within each fieldchemistry.csv— chemistry measurements for samples organized by sample id and measurement
Your goal is to:
- Merge the chemistry data with the spatial sample data (Python)
- Visualize fields and samples on a map (React)
- Display chemistry information interactively for each sample
Write a script that reads the input datasets and produces a merged GeoJSON file of samples with chemistry data attached to their properties.
- Input files are located in:
backend/data/ - Output file should be written to:
backend/data/merged_samples.geojson
- Each sample feature should include chemistry data in its
propertiesobject.
cd backend
python3 aggregate_chemistry.py
- Display the merged sample and field data on a map.
- Add a dropdown component to choose which measurement to display
- When clicking on a sample in the map, render a callout-style popup with the sample id and measurement value
- Run the backend script to generate merged_samples.geojson.
- Start the frontend dev server:
cd frontend
npm install
npm run dev
- Open your browser to http://localhost:5173