-
Notifications
You must be signed in to change notification settings - Fork 4
Description
🏥 Homework Assignment: Geospatial Analysis of Hospitals in Peru
0) Environment & Reproducibility
For environment setup and reproducibility, please use the same model and setup provided in this repository:
👉 Rodrigo Grijalba – Python Dashboard Class
Follow the same structure for creating and managing your environment (requirements.txt, Streamlit, GeoPandas, Folium, etc.).
1) Repository Setup
- Create a new public GitHub repository named Hospitals-Access-Peru.
- Use the Rodrigo John Paradox repository as a template.
2) Geospatial Analysis with GeoPandas
📥 Datasets & Official Links
-
Hospitals (MINSA – IPRESS)
👉 MINSA – Registro Nacional de IPRESS- Use only the operational subset: filter records to hospitals that are operational (“functioning status”).
- Clarification: “Functioning status” refers to the official MINSA database of operational/active hospitals, according to the dataset and data dictionary.
- Keep only records with valid coordinates (latitude and longitude).
-
Population Centers (INEI)
👉 Dataset – Centros Poblados -
Administrative Boundaries (Districts of Peru)
Use the district shapefile employed in this reference class:
👉 Class: GeoPandas – Districts of Peru
Recommended CRS: EPSG:4326.
Key columns (hospitals):
INSTITUCIÓN, NOMBRE DEL ESTABLECIMIENTO, CLASIFICACION, DEPARTAMENTO, PROVINCIA, DISTRITO, ESTADO ,LATITUD (NORTE) ,LONGITUD (ESTE)
🗺️ Task 1: Static Maps — Hospital Count by District
- Load the district shapefile of Peru (link above).
- With GeoPandas, create static maps showing the number of operational public hospitals per district:
- Map 1: Total public hospitals per district.
- Map 2: Highlight districts with zero hospitals.
- Map 3: Top 10 districts with the highest number of hospitals (distinct color scale).
📊 Task 2: Department-level Analysis
- Aggregate at the department level.
- Calculate the total number of operational hospitals in each department.
- Identify:
- The department with the highest number of hospitals.
- The department with the lowest number of hospitals.
- Present the results with:
- A summary table (sorted from highest to lowest).
- A bar chart (matplotlib or seaborn).
- A department-level choropleth map (GeoPandas).
📍 Task 3: Proximity Analysis (using Population Centers)
Regions to analyze:
- Lima
- Loreto
Methodology:
- From Population Centers, compute the centroid of each locality (or use the provided geometry centroids).
- For each centroid, calculate the number of operational hospitals within a 10 km buffer.
- Identify (per region):
- The population center with the fewest hospitals nearby (isolation).
- The population center with the most hospitals nearby (concentration).
- Plot with folium:
- The selected population center (centroid).
- The 10 km buffer (circle).
- All hospitals inside the buffer.
Notes:
- Ensure all layers use CRS EPSG:4326 (or project to EPSG:32718 for metric 10 km buffers and then reproject back to EPSG:4326 for visualization).
- Document any cleaning steps (duplicate removal, invalid coordinates).
3) Interactive Mapping with Folium
🗺️ Task 1: National Choropleth (District Level)
- Build a Folium choropleth of the number of hospitals per district.
- Add a marker cluster with all hospital points.
📍 Task 2: Proximity Visualization — Lima & Loreto
- Reproduce the proximity analysis in Folium:
- Red circle (10 km): population center with the lowest hospital density nearby.
- Green circle (10 km): population center with the highest hospital density nearby.
- Add popups/tooltips with population center name and number of hospitals inside the radius.
Short written analysis:
- Lima: urban concentration and accessibility.
- Loreto: geographic dispersion and accessibility challenges in the Amazon.
4) Application Deployment with Streamlit
The Streamlit application must be divided into 3 parts (tabs), following the template shown in class (see example image with icons and labels):
-
🗂️ Tab 1: Data Description
- Unit of analysis: operational public hospitals in Peru.
- Data sources: MINSA – IPRESS (operational subset), Population Centers.
- Filtering rules: only operational hospitals with valid lat/long.
-
🗺️ Tab 2: Static Maps & Department Analysis
- Embed static maps created with GeoPandas.
- Include the department summary table and bar chart.
-
🌍 Tab 3: Dynamic Maps
- National Folium choropleth + markers.
- Folium proximity maps for Lima & Loreto.
(otherwise they will get points deducted)
Example:

Examples Ouputs
Data Desctription
Maps Statics
Maps Dinamycs
📌 Notes
- Use clean and reproducible code (functions, notebooks, or scripts).
- Comment CRS conversions and data processing steps.
- Include a
Makefileor simple run instructions (optional). - Document in the README how hospitals were filtered for “functioning status”.
📅 Deadline
September 18 2025
📊 Example Outputs
- Data Description: data analysis of hospitals in Peru.
- Static Maps: choropleth (counts), zero-hospital districts, top-10 districts.
- Dynamic Maps: national choropleth + markers; proximity maps (Lima = high density, Loreto = low density).
📤 Submission (Repository & Dashboard Links)
Please submit both your:
- GitHub repository URL, and
- Deployed Streamlit dashboard URL
in the following Google Sheet:
👉 Submission Excel – Repository & Dashboard Links
Your Streamlit app must be deployed (e.g., Streamlit Community Cloud) and linked in the sheet above.