A spatial data science project mapping primary crop recommendations across all Egyptian governorates using R, GADM shapefiles, and interactive visualization libraries.
# πΎ Egypt Agricultural Suitability β Spatial Analysis in R
> A spatial data science project mapping primary crop recommendations across all Egyptian governorates using R, GADM shapefiles, and interactive visualization libraries.
**Student:** Osman Osama Β· Egyptian Chinese University (ECU)
**Course:** Spatial Statistics
**Data Sources:** CAPMAS Egypt / FAO Egypt / GADM
---
## πΈ Preview
### Static Choropleth Map
### Point Map (Governorate Centroids)
> π±οΈ An interactive HTML version is also generated β open `egypt_crops_map.html` or `egypt_meaningful_map.html` in any browser.
---
## π Project Structure
```
egypt-agricultural-suitability/
β
βββ egypt_crops_map_9.R # Main script: choropleth + interactive map + shapefile export
βββ egypt_crops_point_map_final.R # Point map: leaflet-based interactive map by region
β
βββ data/
β βββ egypt_crops_data.csv # Agricultural suitability data (27 governorates)
β βββ governorate_names.csv # Governorate names as exported from GADM shapefile
β βββ shapefile/
β βββ egypt_crops.shp # Merged shapefile with crop & score attributes
β βββ egypt_crops.dbf
β βββ egypt_crops.prj
β βββ egypt_crops.shx
β
βββ outputs/
βββ egypt_crops_map.png # Static choropleth (primary crop per governorate)
βββ egypt_crops_point_map.png # Static point map (size = score, color = crop)
βββ egypt_crops_map.html # Interactive plotly choropleth
βββ egypt_meaningful_map.html # Interactive leaflet point map (color by region)
```
---
## πΊοΈ What the Project Does
### Script 1 β `egypt_crops_map_9.R`
- Downloads Egypt's administrative shapefile at governorate level using the **GADM** database (`geodata` package)
- Matches 27 governorates to a custom agricultural dataset (primary, secondary & tertiary crops + suitability score + key factor)
- Performs fuzzy string matching to handle Arabic transliteration differences
- Generates:
- **Static choropleth map** ( β¦