GPS2space: An Open-source Python Library for Spatial Measure Extraction from GPS Data


  • Shuai Zhou * The Pennsylvania State University
  • Yanling Li The Pennsylvania State University
  • Guangqing Chi The Pennsylvania State University
  • Junjun Yin The Pennsylvania State University
  • Zita Oravecz The Pennsylvania State University
  • Yosef Bodovski The Pennsylvania State University
  • Naomi P. Friedman University of Colorado Boulder
  • Scott I. Vrieze University of Minnesota
  • Sy-Miin Chow The Pennsylvania State University



Spatial Measure, Twins, Behavior Genetics, Latent Growth Curve Model, Python


Global Positioning System (GPS) data have become one of the routine data streams collected by wearable devices, cell phones, and social media platforms in this digital age. Such data provide research opportunities in that they may provide contextual information to elucidate where, when, and why individuals engage in and sustain particular behavioral patterns. However, raw GPS data consisting of densely sampled time series of latitude and longitude coordinate pairs do not readily convey meaningful information concerning intra-individual dynamics and inter-individual differences; substantial data processing is required. Raw GPS data need to be integrated into a Geographic Information System (GIS) and analyzed, from which the mobility and activity patterns of individuals can be derived, a process that is unfamiliar to many behavioral scientists. In this tutorial article, we introduced GPS2space, a free and open-source Python library that we developed to facilitate the processing of GPS data, integration with GIS to derive distances from landmarks of interest, as well as extraction of two spatial features: activity space of individuals and shared space between individuals, such as members of the same family. We demonstrated functions available in the library using data from the Colorado Online Twin Study to explore seasonal and age-related changes in individuals’ activity space and twin siblings’ shared space, as well as gender, zygosity and baseline age-related differences in their initial levels and/or changes over time. We concluded with discussions of other potential usages, caveats, and future developments of GPS2space.




How to Cite

Zhou, S., Li, Y., Chi, G., Yin, J., Oravecz, Z. ., Bodovski, Y. ., Friedman, N. P. ., Vrieze, S. I. ., & Chow, S.-M. . (2021). GPS2space: An Open-source Python Library for Spatial Measure Extraction from GPS Data. Journal of Behavioral Data Science, 1(2), 127–155.