Skip to main content

Tools for modeling activity spaces including distance-to-home, home range, and IREM models.

Project description

ActivitySpace Tools

ActivitySpace Tools is a Python library for modeling individual activity spaces and analyzing human mobility patterns using geospatial data.

The library provides tools for computing distance-based mobility metrics, generating activity space geometries, modeling exposure surfaces, and analyzing spatial properties of activity spaces.

The package was developed primarily for research applications in:

  • Human mobility
  • Urban analytics
  • Environmental exposure
  • GIScience
  • Transport geography
  • Spatial behavior analysis

Scientific Background

The methods implemented in ActivitySpace Tools originate from peer-reviewed research on human activity spaces, environmental exposure, and mobility behavior.

The package implements computational tools based on the following research contributions.

Activity space conceptualization

Hasanzadeh, K., Laatikainen, T., & Kyttä, M.

Where is the neighborhood? A spatiotemporal perspective on human activity spaces.

This work discusses how activity spaces can be conceptualized beyond static residential neighborhoods and introduces approaches for representing individualized spatial behavior using mobility data.

Environmental exposure and activity spaces

Hasanzadeh, K., et al.

Capturing environmental exposure through activity space modeling.

This research demonstrates how daily mobility patterns influence the environmental conditions individuals are exposed to.

Individualized Residential Exposure Model (IREM)

Hasanzadeh, K.

Individualized Residential Exposure Model (IREM).

IREM integrates

  • home locations
  • activity locations
  • travel routes

to generate continuous spatial exposure surfaces that represent how individuals experience environments through their daily mobility.


Features

ActivitySpace Tools currently provides four main modules.

Spider model

Computes distance-to-home metrics for activity locations.

Useful for studying:

  • travel distances
  • mobility behavior
  • spatial reach of daily activities

Home Range model

Generates activity space polygons based on home locations and visited destinations.

These polygons approximate the spatial extent of an individual's daily activity area.

IREM model

The Individualized Residential Exposure Model (IREM) produces raster exposure surfaces representing how individuals experience the spatial environment during daily mobility.

Inputs include:

  • home locations
  • activity points
  • travel routes

Analytics tools

Additional functions for analyzing activity spaces and exposure surfaces:

  • raster exposure summaries
  • geometry metrics
  • raster-to-polygon conversion
  • exposure statistics

Installation

Install from PyPI:

pip install activity-space-tools

or development install:

pip install git+https://github.com/Urban-GeoInformatics/activity-space-tools.git

Basic Example

import geopandas as gpd
from activityspace.spider import add_distance_to_home

poi = gpd.read_file("eep.shp")
home = gpd.read_file("Home.shp")

result = add_distance_to_home(
    poi=poi,
    home=home,
    uniqueID="uid"
)

print(result.head())

Data Requirements

Typical workflows require three spatial datasets.

Home locations

Point dataset representing individuals' home locations.

Example fields:

uid
geometry

Activity locations (POIs)

Point dataset representing visited destinations.

Example fields:

uid
DESTid
weight
travelMode
geometry

Routes

Line dataset representing travel paths between home and destinations.

Example fields:

uid
DESTid
geometry

Example Workflow

A typical workflow using ActivitySpace Tools:

  1. Compute distance-to-home metrics (Spider model)
  2. Generate activity space polygons (Home Range model)
  3. Model exposure surfaces (IREM model)
  4. Summarize exposure statistics
  5. Analyze geometry of activity spaces
  6. Convert exposure rasters to polygons

Conceptually the workflow looks like:

Home points
     ↓
Activity points
     ↓
Routes
     ↓
IREM exposure surfaces
     ↓
Activity space analysis

Dependencies

The library depends on commonly used geospatial Python libraries:

  • geopandas
  • pandas
  • numpy
  • shapely
  • scipy
  • rasterio
  • pyproj

Author

Kamyar Hasanzadeh University of Helsinki


Citation

If you use this library in academic work, please cite both the software and the associated scientific publications.

Suggested citation:

Kamyar. (2026). Urban-GeoInformatics/activity-space-tools: 0.1.0 (0.1.0). Zenodo. https://doi.org/10.5281/zenodo.19036426

License

MIT License

Copyright (c) 2026 Kamyar Hasanzadeh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction.

The software is provided "as is", without warranty of any kind.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

activity_space_tools-0.2.1.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

activity_space_tools-0.2.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file activity_space_tools-0.2.1.tar.gz.

File metadata

  • Download URL: activity_space_tools-0.2.1.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for activity_space_tools-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b74f5a165231addc4b3a09e5569e2ef18c1152ed7540c1f9d75a1c667adcca0c
MD5 26672c0c8002a578a65b0df75885780c
BLAKE2b-256 bfc3807a00578cae4ca39432cdc96e7b39ea7378fbded9daadbb7679f2bda60a

See more details on using hashes here.

File details

Details for the file activity_space_tools-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for activity_space_tools-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d82999eb36cd8728d47a95742a1c545ce1c905edc0d9dfa0bbadab9033190c
MD5 888f25082b63b3feceda15c275a3c578
BLAKE2b-256 b568f5f5e559b83c6c051bef733b2d89edcfa58fa3e893a6130e5f7368d6e295

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page