Mapping Activity in West Bank#
Analysis Goals#
The goal of this analysis is to map the activity in the West Bank using GPS data as a proxy for peope’s mobility.
Dataset#
The dataset being used in this analysisis is the Mapbox movement data. The description below was adapated from the original source:
The Mapbox Movement data set is based on de-identified underlying mobile device activity that grows and changes every day. Any mobility data set is inherently skewed between highly populated regions (urban and metro areas) and sparsely populated regions (rural areas). So instead of providing “raw counts” of measurements, a custom normalization process is applied. This process measures and smooths out the impact of otherwise unpredictable changes in mobile device usage and calculates an activity index, which is more appropriate for comparison across time spans.
Dataset Period#
The dataset covers period from January 2022 to December 2023. Note that there are some gaps where there is no data for some months.
Spatial Characteristics#
The data is provided at GPS coordinates (which are de-identified, jittered).
Temporal Characteristics#
The dataset we use in the analysis is based on activity generated over a a 24 hour time span.
Key Variables#
The variable we are using is activity_index as described above. The easiest way to think about is that its a measure of how many people are moving/visit a region over a specific time (in this case a 24 hour period). Thus, higher values of this index should correspond to alot of people visiting an area with
Prepare Geography DataFrames#
Get and Process Mapbox Movement Data#
Load and preprocess data#
#
Add geographic information to the Mapbox events#
Adm2 regions
H3 regions
# ================================================
# Add administrative regions to Mapbox events data
# ================================================
# keep only columns we need for admin geodataframe
gdf_adm2_wb = gdf_adm2_wb[['ADM1_EN', 'ADM2_EN', 'ADM2_PCODE', 'AREA_SQKM', 'geometry']]
gdf_mapbox_adm2 = add_geography_mapbox_events(df_mapbox, x_col="xlon", y_col="xlat", gdf_regions=gdf_adm2_wb)
# ================================================
# Add H3 indexes to Mapbox events data
# ================================================
gdf_mapbox_h3 = add_geography_mapbox_events(df_mapbox, x_col="xlon", y_col="xlat", gdf_regions=gdf_wb_h3)
Aggregate Activity by Region and Time#
Spatial aggregation units: Admin level 2 and H3 index
Temporal aggregation units: Month, week
Monthly aggregation at ADM2 level#
Generate a Activity Trends#
Summary statistics#
| ADM2_EN | date | activity_index_sum | |
|---|---|---|---|
| 122 | Ramallah | 2022-03-01 | 15057.030766 |
| 131 | Ramallah | 2023-01-01 | 14612.023041 |
| 129 | Ramallah | 2022-10-01 | 14555.311015 |
| 125 | Ramallah | 2022-06-01 | 14282.661059 |
| 133 | Ramallah | 2023-03-01 | 13828.758482 |
| ... | ... | ... | ... |
| 29 | Tubas | 2022-10-01 | 578.932338 |
| 31 | Tubas | 2023-01-01 | 531.227671 |
| 28 | Tubas | 2022-09-01 | 511.841719 |
| 32 | Tubas | 2023-02-01 | 426.845737 |
| 30 | Tubas | 2022-11-01 | 342.297292 |
220 rows × 3 columns
West Bank monthly activity trends#
2022
2023
Activity trends by governorates#
Activity trends by by H3 hexagonal grid#
/var/folders/k5/p4nvl2pj4gq2ks0j7qvrhwbh0000gp/T/ipykernel_18739/621941167.py:8: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.