Estimating Activity via Mobility Data at Points of Interest#

Development Status m Analyzing the frequency of visits to or near points of interest may provide insights into the economic impacts of climate shocks. Similar to the now-discontinued Google Community Mobility Reports, this methodology tracks changes in mobility by counting visits to Overture Maps points of interest, compared to a baseline.

By tracking changes in the number of visits to points of interest (POIs) over time, we use visit counts as a proxy for activity levels. This method allows us to infer shifts in population mobility and identify social or economic trends, particularly during crises. The baseline visit count represents the typical or expected number of visits to a given POI. Subsequent visit counts are then compared to this baseline to assess changes in movement patterns. For example, a decline in visits may suggest reduced economic activity, such as fewer shoppers at retail locations, fewer workers at office spaces, or reduced commuter traffic at transit hubs.

This approach offers a more focused insight into specific types of activity, as it directly measures engagement with predefined locations of interest. However, it also has limitations similar to those of tracking device density, as detailed in mobility-activity-limitations. Mobility data is collected through convenience sampling, meaning it captures only a subset of the population that visits these POIs, rather than representing the entire population through randomized sampling. Additionally, not all visits are equal in terms of economic significance, and certain locations may see more variation in visit counts due to external factors unrelated to overall economic trends.

Data#

In this section, we import data from various sources, either publicly available or obtained through data sharing agreements.

Area of Interest#

In this step, we import the area of interest created from geoBoundaries and shown below. This area covers the countries of Bosnia and Herzegovina, North Macedonia and Serbia.

Make this Notebook Trusted to load map: File -> Trust Notebook

Mobility Data#

This study used longitudinal human mobility data, which includes anonymized, timestamped geographical points from GPS-enabled devices. The mobility data has been provided by Veraset Movement and obtained through the Monitoring Near-Time Changes in Urban Space Usage after Climate Shocks: ECA Urban Resilience proposal of the Development Data Partnership. This dataset covers the countries of Bosnia and Herzegovina, North Macedonia and Serbia.

Hide code cell source
ddf = dd.read_parquet(
    [
        "../../data/final/panels/v1.1/country=BA/**/*.parquet",
        "../../data/final/panels/v1.1/country=MK/**/*.parquet",
        "../../data/final/panels/v1.1/country=RS/**/*.parquet",
    ]
)

Let’s look at the spatiotemporal distribution below. Further information, please see also Data Quality Assessment. See also Limitations.

Hide code cell source
show(mobilyze.plotting.plot_temporal_distribution(ddf))

Important

Mobility data, while valuable for understanding movement patterns, suffers from significant sample bias and limitations. One prominent issue is urban skewness, where data is often disproportionately collected from urban areas with higher smartphone usage, better infrastructure, and more active digital services. This results in an overrepresentation of densely populated, affluent cities while underrepresenting rural or underserved regions where mobile device usage may be lower or less consistent. Additionally, mobility data often lacks demographic diversity, as it predominantly captures movements of individuals who have access to mobile technology, leaving out vulnerable or marginalized populations. These biases can lead to incomplete or misleading insights, especially when used to inform policy decisions or urban planning. Moreover, data privacy concerns and inconsistent data quality further limit the reliability of such datasets, necessitating careful interpretation and complementary data sources to mitigate skewed conclusions.

Points of Interest#

The project team used the Humanitarian OpenStreetMap datasets available on HDX, which includes education and health faciliates, e.g., Bosnia and Herzegovina Health Facilities (OpenStreetMap Export).

Hide code cell source
POI = pd.concat(
    [
        dask_geopandas.read_file(p, npartitions=4).to_crs("EPSG:4326").compute()
        for p in [
            "https://s3.dualstack.us-east-1.amazonaws.com/production-raw-data-api/ISO3/BIH/education_facilities/polygons/hotosm_bih_education_facilities_polygons_geojson.zip!hotosm_bih_education_facilities_polygons_geojson.geojson",
            "https://s3.dualstack.us-east-1.amazonaws.com/production-raw-data-api/ISO3/BIH/health_facilities/polygons/hotosm_bih_health_facilities_polygons_geojson.zip!hotosm_bih_health_facilities_polygons_geojson.geojson",
            "https://s3.us-east-1.amazonaws.com/production-raw-data-api/ISO3/MKD/education_facilities/polygons/hotosm_mkd_education_facilities_polygons_geojson.zip!hotosm_mkd_education_facilities_polygons_geojson.geojson",
            "https://s3.us-east-1.amazonaws.com/production-raw-data-api/ISO3/MKD/health_facilities/polygons/hotosm_mkd_health_facilities_polygons_geojson.zip!hotosm_mkd_health_facilities_polygons_geojson.geojson",
            "https://s3.us-east-1.amazonaws.com/production-raw-data-api/ISO3/SRB/education_facilities/polygons/hotosm_srb_education_facilities_polygons_geojson.zip!hotosm_srb_education_facilities_polygons_geojson.geojson",
            "https://s3.us-east-1.amazonaws.com/production-raw-data-api/ISO3/SRB/health_facilities/polygons/hotosm_srb_health_facilities_polygons_geojson.zip!hotosm_srb_health_facilities_polygons_geojson.geojson",
            # "https://s3.us-east-1.amazonaws.com/production-raw-data-api/ISO3/TUR/education_facilities/polygons/hotosm_tur_education_facilities_polygons_geojson.zip!hotosm_tur_education_facilities_polygons_geojson.geojson",
            # "https://s3.us-east-1.amazonaws.com/production-raw-data-api/ISO3/TUR/health_facilities/polygons/hotosm_tur_health_facilities_polygons_geojson.zip!hotosm_tur_health_facilities_polygons_geojson.geojson",
        ]
    ]
)

Buffering the geometries to create a buffer zone around each feature.

POI["geometry"] = POI["geometry"].to_crs("EPSG:3857").buffer(5).to_crs("EPSG:4326")

To demonstrate ain, we visualize the OpenStreetMap points of interest with the key amenity=school below.

Make this Notebook Trusted to load map: File -> Trust Notebook

Methodology#

Inspired by the now-discontinued Google Community Mobility Reports, this methodology is designed to track changes in mobility by measuring the frequency of visits to points of interest (POIs) sourced from OpenStreetMap. We compare these visit frequencies to a baseline to identify variations in mobility patterns.

We employ a spatial join approach to determine whether a device has been detected within a POI at least once during the observation period. This involves assessing whether device stops fall within the boundaries of designated POIs and counting the number of visits to each POI. While estimating stay locations and the spatial join execution method provides a straightforward way to measure visit frequency, it is a simplified approach compared to more advanced techniques.

Overall, this approach helps in understanding shifts in mobility within specific areas, but it should be interpreted with the understanding that it captures only a fraction of the overall population’s movements and does not account for all factors influencing visit frequency.The mobility data used reflects only a subset of the overall population in the area—specifically, individuals who have Location Services enabled on their mobile devices. This data does not represent the total population density and may not capture all movements within the area.

Compute Stay Locations#

In this section, we will compute the stay locations, which identify locations where devices remained stationary for a significant period of time. The process involves analyzing the movement patterns of devices to determine periods of dwelling within specific geographical areas. First, we will filter the data to isolate stationary points, then aggregate them by location and time to compute the total number of stops. Visualizations are provided to illustrate the computation and results.

Using mobility data, we will apply spatial and temporal thresholds to detect these stops, being \(\Delta t := \)5 (minutes) and \(\Delta l :m= 100\) meters [1].

STOPS = mobilyze.activity.compute_stops(
    ddf, stay_locations_kwds={"minutes_for_a_stop": 5.0, "spatial_radius_km": 0.1}
)

Compute Spatial Joins#

Using Dask-GeoPandas, we first perform a spatial join to match stops with points of interest. Following this, we aggregate the number of visits spatiotemporally. This involves grouping the data by H3 grid cells, weekly intervals, and amenity classifications, such as amenity=school areas.

VISITS = (
    STOPS.sjoin(POI, predicate="within")
    .groupby(
        ["category", "hex_id", "date", "shapeISO", "shapeName", "shapeGroup"],
        observed=False,
    )["uid"]
    .count()
    .to_frame(name="count")
)

Results#

In this section, we visualize the weekly visits detected within each OpenStreetMap amenity key. By aggregating the number of visits, we provide a smoothed total showing the number of detected users across the entire area for each time period. We aggregate data based on administrative divisions; however, since the underlying data is based on hex_id, the results can be aggregated and presented at any geographic level compatible with the H3 resolution.

Bosnia and Herzegovina#

North Macedonia#

Serbia#

Limitations#

See also

Limitations

Limitations of using mobility data to estimate economic activity#

Warning

  • Sample Bias: Mobility data is collected from sources like mobile phone networks, GPS devices, and transportation systems. These sources may not capture the entire population or all economic activities, leading to potential sample bias and inaccurate estimations. Some individuals or businesses may lack access to the technology that generates this data, resulting in underrepresentation of certain demographics or economic sectors.

  • Incomplete Coverage: The mobility data is derived from a convenience sample of GPS-enabled devices, specifically those with location tracking enabled. This sample represents only a subset of the total population in an area and does not account for individuals who do not use GPS or have location tracking turned off. Consequently, the derived metrics do not reflect the total population density accurately.

  • Lack of Contextual Information: Mobility data mainly captures movement patterns and geolocation information. It often lacks other crucial details such as transactional data, business types, or specific economic activities, which are necessary for accurate economic activity estimation.

Limitations of using points of interest database from OpenStreetMap#

Warning

  • Data Quality: OpenStreetMap (OSM) relies on user contributions, which can vary in quality and may not always be current. The accuracy and completeness of the points of interest (POI) database can differ widely between regions and categories.

  • Bias and Incompleteness: OSM data can be biased towards areas with more active contributors. Some regions or types of businesses may be underrepresented, particularly in less-populated or less-developed areas, leading to incomplete or skewed data.

  • Lack of Standardization: OSM does not enforce strict data standards, resulting in inconsistent formats, categorizations, and attributes for POIs. This lack of standardization can make it difficult to compare and analyze data consistently across different regions or time periods.

  • Verification and Validation: While OSM benefits from community-driven data verification, the absence of a centralized authority or rigorous validation process can introduce errors and inaccuracies. Determining the reliability of information in the POI database can be challenging.

  • Limited Contextual Information: The OSM database primarily provides geospatial information, such as coordinates and basic attributes of POIs. It may lack additional context, such as detailed business descriptions, operational hours, or transactional data, which can limit its utility for comprehensive economic analysis.

References#

1

Enrico Ubaldi, Takahiro Yabe, Nicholas Jones, Maham Faisal Khan, Alessandra Feliciotti, Riccardo Di Clemente, Satish V. Ukkusuri, and Emanuele Strano. Mobilkit: a python toolkit for urban resilience and disaster risk management analytics. Journal of Open Source Software, 9(95):5201, 2024. URL: https://doi.org/10.21105/joss.05201, doi:10.21105/joss.05201.