MovingPandas implements a Trajectory class and corresponding methods based on GeoPandas.
Visit movingpandas.org for details!
You can run MovingPandas examples on MyBinder - no installation required: (These examples use the latest MovingPandas release version.)
To try the cutting-edge dev version, use this MyBinder link.
The official documentation is hosted on ReadTheDocs
Create interactive trajectory plots, including multiple linked plots with ease
Detect stops in trajectories, extract them as points or segments, and use them to split trajectories
Generalize trajectories using spatial, temporal, and spatiotemporal methods
Clean and sooth trajectories by removing outliers and applying Kalman filters
Aggregate trajectories to explore larger patterns
MovingPandas for Python >= 3.7 and all it's dependencies are available from conda-forge and can be installed using conda install -c conda-forge movingpandas
.
Conda status
Note that it is NOT recommended to install MovingPandas from PyPI! If you're on Windows or Mac, many GeoPandas / MovingPandas dependencies cannot be pip installed (for details see the corresponding notes in the GeoPandas documentation). On Ubuntu, pip install fails on cartopy with "Proj 4.9.0 must be installed".
Use the following steps to run the notebooks using the current development version:
Linux/Mac:
conda env create -f environment.yml
Windows:
conda config --add channels conda-forge
conda config --add channels defaults
conda config --set channel_priority strict
conda env create -f environment.yml
On Windows, because conda-forge relies on some package built with defaults blas (like scipy) one must use the defaults channel on top of conda-forge and activate conda's new strict channel feature. Source: conda-forge/gdal-feedstock#269 (comment)
- Install Anaconda
- Clone the movingpandas repository
- In Anaconda Navigator | Environments | Import select the movingpandas environment.yml from the cloned directory:
- Wait until the environment is ready, then change to the Home tab and install Jupyter notebooks into the movingpandas environment
- Launch Jupyter notebooks and navigate to the
movingpandas/tutorials
directory to execute them - Now you can run the notebooks, experiment with the code and adjust it to your own data
Known issues:
- On Windows, importing rasterio can lead to DLL errors. If this happens, downgrade the rasterio version to 1.0.13.
To install MovingPandas in "develop" or "editable" mode you may use:
python setup.py develop
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.
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).
Please cite [0] and [1] 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.
[2] Graser, A. (2021). Exploratory Movement Data Analysis. GeoPython 2021. – 🎬 video
- 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."
- 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."
- 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."
- 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.
- 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"
- 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."
- 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 ..."