MovingPandas provides trajectory data structures and functions for handling movement data based on Pandas, GeoPandas, and more. Visit movingpandas.org for details.


Keywords
geopandas, movement-data, python, spatial-data-analysis, trajectory, trajectory-analysis
License
BSD-3-Clause
Install
pip install movingpandas==0.21.3

Documentation

MovingPandas

pypi Conda Version Conda Downloads Conda Recipe Conda Platforms Project Status: Active – The project has reached a stable, usable state and is being actively developed. Tests docs status codecov DOI pyOpenSci Code style: black StandWithUkraine Mastodon Follow

SWUbanner

MovingPandas is a Python library for movement data exploration and analysis.

MovingPandas provides trajectory data structures and functions for handling movement data based on Pandas, GeoPandas, and HoloViz.

Visit movingpandas.org for details!

You can run MovingPandas examples on MyBinder - no installation required: Binder (These examples use the latest MovingPandas release version.)

To try the cutting-edge dev version, use this MyBinder link.

Documentation

We recommend starting your MovingPandas journey with the tutorial notebooks on the official homepage

The official API documentation is hosted on ReadTheDocs

Examples

Trajectory plots

Create interactive trajectory plots using Folium and Geoviews with ease

image

Including multiple linked plots View Jupyter Notebook

movingpandas_animated

For all types of tracking data, e.g. video-based trajectories

Bicycle tracks from object tracking in videos

Including plots in custom projections View Jupyter Notebook

MovingPandas Iceberg trajectory in custom SouthPolarStereo projection

Stop detection View Jupyter Notebook

Detect stops in trajectories, extract them as points or segments, and use them to split trajectories

movingpandas_stop_detection

Trajectory generalization View Jupyter Notebook

Generalize trajectories using spatial, temporal, and spatiotemporal methods

movingpandas_generalize

Trajectory cleaning & smoothing View Jupyter Notebook

Clean and sooth trajectories by removing outliers and applying Kalman filters

movingpandas smooth

Trajectory aggregation View Jupyter Notebook

Aggregate trajectories to explore larger patterns

movingpandas_ais

Installation

MovingPandas for Python >= 3.7 and all its dependencies are available from conda-forge and can be installed using

conda install -c conda-forge movingpandas

or faster using

mamba install -c conda-forge movingpandas

Note that it is NOT recommended to install MovingPandas from PyPI! If you are using Windows or Mac, many GeoPandas / MovingPandas dependencies may not install correctly with pip (for details see the corresponding notes in the GeoPandas documentation). On Ubuntu, pip install may fail, e.g. on cartopy with "Proj 4.9.0 must be installed".

Development installation

Use the following steps to run the notebooks using the current development version:

Using conda / mamba

conda env create -f environment.yml

Develop mode

To install MovingPandas in "develop" or "editable" mode you may use:

python setup.py develop

Contributing to MovingPandas GitHub contributors

All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.

A detailed overview on how to contribute can be found in the contributing guide on GitHub.

Related Python packages

For a more comprehensive list, including non-Python solutions, check https://github.com/anitagraser/movement-analysis-tools

scikit-mobility is a similar package which also deals with movement data. It implements TrajectoryDataFrames and FlowDataFrames on top of Pandas instead of GeoPandas. There is little overlap in the covered use cases and implemented functionality (comparing MovingPandas tutorials and scikit-mobility tutorials). MovingPandas focuses on spatio-temporal data exploration with corresponding functions for data manipulation and analysis. scikit-mobility on the other hand focuses on computing human mobility metrics, generating synthetic trajectories and assessing privacy risks. Plotting is based on Folium.

Traja extends the capabilitis of Pandas DataFrames specific for animal trajectory analysis in 2D. Plots (static) are based on seaborn.

PyMove provides functionality similar to MovingPandas. It implements PandasMoveDataFrames and DaskMoveDataFrame on top of Pandas and Dask DataFrames. Plotting is based on Folium.

Tracktable is a related Python package with its core data structures and algorithms implemented in C++, i.e. it is not based on Pandas. Plotting is based on Cartopy (for still images) and Folium (for interactive rendering).

Citation information

Please cite [0] when using MovingPandas in your research and reference the appropriate release version. All releases of MovingPandas are listed on Zenodo where you will find citation information, including DOIs.

Publications

About MovingPandas

[0] Graser, A. (2019). MovingPandas: Efficient Structures for Movement Data in Python. GI_Forum ‒ Journal of Geographic Information Science 2019, 1-2019, 54-68. doi:10.1553/giscience2019_01_s54.

@article{graser_movingpandas_2019,
	title = {{MovingPandas}: {Efficient} {Structures} for {Movement} {Data} in {Python}},
	volume = {7},
	number = {1},
	issn = {2308-1708, 2308-1708},
	shorttitle = {{MovingPandas}},
	url = {https://hw.oeaw.ac.at?arp=0x003aba2b},
	doi = {10.1553/giscience2019_01_s54},
	language = {en},
	urldate = {2023-04-19},
	journal = {GI\_Forum ‒ Journal of Geographic Information Science},
	author = {Graser, Anita},
	year = {2019},
	pages = {54--68},
}

[1] Graser, A. & Dragaschnig, M. (2020). Exploring movement data in notebook environments. Presented at MoVIS 2020, IEEE VIS 2020.

[2] Graser, A. (2021). Exploratory Movement Data Analysis. GeoPython 2021. – 🎬 video

Scientific publications using MovingPandas

  1. Graser, A. & Dragaschnig, M. (2020). Open Geospatial Tools for Movement Data Exploration. KN ‒ Journal of Cartography and Geographic Information, 70(1), 3-10. doi:10.1007/s42489-020-00039-y. - "For example, Fig. 4 shows how MovingPandas can be used to split a trajectory into subtrajectories and plot the results."
  2. Kirkland, L. A., de Waal, A., & de Villiers, J. P. (2020). Evaluation of a Pure-Strategy Stackelberg Game for Wildlife Security in a Geospatial Framework. In Southern African Conference for Artificial Intelligence Research (pp. 101-118). Springer, Cham. - "The movingpandas Python library [12] is utilised to store trajectories which can be easily analysed and plotted after the simulation."
  3. Depellegrin, D., Bastianini, M., Fadini, A., & Menegon, S. (2020). The effects of COVID-19 induced lockdown measures on maritime settings of a coastal region. Science of the Total Environment, 740, 140123. - "We combined the Python libraries scikit-Mobility (Pappalardo et al., 2019) and MovingPandas (Graser, 2019) to pre-process position data received from the AAOT and to reconstruct and represent the vessel trajectory in the lockdown assessment period."
  4. Graser, A. (2021). An exploratory data analysis protocol for identifying problems in continuous movement data. Journal of Location Based Services. doi:10.1080/17489725.2021.1900612. - MovingPandas is used to plot individual trajectories colored by movement speeed.
  5. Mehri, S., Alesheikh, A. A., & Basiri, A. (2021). A Contextual Hybrid Model for Vessel Movement Prediction. IEEE Access, 9, 45600-45613. - "AIS messages are converted into trajectories by a Python library named, MovingPandas"
  6. Soularidis, A., & Kotis, K. (2022). Semantic Modeling and Reconstruction of Drones’ Trajectories. In European Semantic Web Conference (pp. 158-162). Springer, Cham. - "The goal of this paper is to present our position related to the semantic trajectories of swarms of drones, towards proposing methods for extending MovingPandas, a widely used open-source trajectory analytics and visualization tool."
  7. Elayam, M. M., Ray, C., & Claramunt, C. (2022). A hierarchical graph-based model for mobility data representation and analysis. Data & Knowledge Engineering, 102054. - "The implementation combines several open source tools such as Python, MovingPandas library, Uber H3 index, Neo4j graph database management system"
  8. Kotis, K., & Soularidis, A. (2023). ReconTraj4Drones: A Framework for the Reconstruction and Semantic Modeling of UAVs’ Trajectories on MovingPandas. Applied Sciences, 13(1), 670. - "This framework extends MovingPandas, a widely used and open-source trajectory analytics and visualization tool."
  9. Šakan, D., Žuškin, S., Rudan, I., & Brčić, D. (2023). Container Ship Fleet Route Evaluation and Similarity Measurement between Two Shipping Line Ports. Journal of Marine Science and Engineering, 11(2), 400. - "To create routes, we used the MovingPandas library" (Horizon Europe project no. 101077026 SafeNav).
  10. Sheehan, C., & Green, T. (2023) ChargeUp! Data Swap!. Using data from battery swapping e-motorcycles in Nairobi to assess impacts and plan infrastructure. Imperial College London. White paper. - "the raw GPS co-ordinates and their timestamps were processed to detect individual trajectories (trips) for each battery using MovingPandas"
  11. Gu, C., Liu, L., Zhang, Y., Wei, B., Cui, B., & Gong, D. (2023). Understanding the spatial heterogeneity of grazing pressure in the Three-River-Source Region on the Tibetan Plateau. Journal of Geographical Sciences, 33(8), 1660-1680. - "we used MovingPandas, a python package for movement data analysis, to obtain the daily moving distance and home range information"
  12. Duarte, M. M. G., & Sakr, M. (2023). A Benchmark of Existing Tools for Outlier Detection and Cleaning in Trajectories. - "The benchmark includes MovingPandas, Scikit-mobility, Scikit-learn, Ptrail, PyMove, movetk, MEOS, Argosfilter, Stmove and MOutlier." (Horizon Europe project no. 101070279 MobiSpaces).
  13. Lei, J., Chu, Z., Wu, Y., Liu, X., Luo, M., He, W., & Liu, C. (2024). Predicting vessel arrival times on inland waterways: A tree-based stacking approach. Ocean Engineering, 294, 116838. - "the historical voyages are processed with the movingpandas library and stored as GeoDataFrames"
  14. Golze, J., & Sester, M. (2024). Determining user specific semantics of locations extracted from trajectory data. Transportation Research Procedia, 78, 215-221. - "stop points are extracted from the GPS trajectories using the Python framework MovingPandas"
  15. Van Deursen, J., Creany, N., Smith, B., Freimund, W., Avgar, T., & Monz, C. A. (2024). Recreation specialization: Resource selection functions as a predictive tool for protected area recreation management. Applied Geography, 167, 103276. - "GeoPandas and MovingPandas packages in Python were used to analyze the GPS data collected and calculate the thirteen STMs (spatio-temporal metrics)"
  16. Wicaksono, S. B. (2024). From Data Cleaning to Predictive Models: A Strategic Approach to Analyzing Bus and Ship Trajectories. Master Thesis in Data Science, Department of Mathemetics, University of Padova. - "we utilize the stop detection tools provided by MovingPandas"
  17. Skåntorp, J., Rolfes, J., Haraldsson, R., Liu, X., Zhao, S., & Rothhämel, M. (2024). Data-driven bicycle driving cycles via mixed-integer programming. 10.13140/RG.2.2.19928.10240 - "we utilized the Kalman filter from the MovingPandas library"
  18. Hoffmann, V., Webert, J. H., Murray, B., & Graf, R. (2024). Data-driven construction of maritime traffic networks for AI-based route prediction. Journal of Physics: Conference Series, 2867. - "Messages are converted to trajectories using MovingPandas" (Horizon 2020 project no. 957237 VesselAI).
  19. Mehri, S., Hooshangi, N., & Mahdizadeh Gharakhanlou, N. (2025). A Novel Context-Aware Douglas–Peucker (CADP) Trajectory Compression Method. ISPRS International Journal of Geo-Information, 14(2), 58. - "AIS messages are converted into trajectories using a Python library named MovingPandas"
  20. Elkin-Frankston, S., McIntyre, J., Brunyé, T.T. et al. (2025). Beyond boundaries: a location-based toolkit for quantifying group dynamics in diverse contexts. Cogn. Research 10, 10 (2025). - "we first segmented time periods when the group was in motion by identifying break periods using the stop detection feature from the MovingPandas Python package"
  21. Koszewski, K., Olszewski, R., Pałka, P. et al. (2025). Utilizing IoT Sensors and Spatial Data Mining for Analysis of Urban Space Actors’ Behavior in University Campus Space Design. Sensors, 25(5), 1393. - "trajectories were processed by the MovingPandas Python library, which offers several valuable processing algorithms, like calculation of velocity, direction of movement, intersections, as well as enabling easy data exchange with other GIS tools using built-in exporters" & "One useful solution turned out to be the MovingPandas’ built-in TrajectoryStopDetector"
  22. Garcez Duarte, M. M., & Sakr, M. (2025). An experimental study of existing tools for outlier detection and cleaning in trajectories. GeoInformatica, 29(1), 31-51. - "MovingPandas uses the Kalman Filter (KF) algorithm for outlier detection"

Full Google Scholar list

Platforms using MovingPandas

Teaching materials referencing MovingPandas

Workshop videos

WorkshopVideo ogh2023