MovingPandas implements a Trajectory class and corresponding methods based on GeoPandas.
Visit movingpandas.org for details!
You can try MovingPandas in a MyBinder notebook - no installation required:
The official documentation is hosted on ReadTheDocs
Trajectory plots
Stop detection
Trajectory aggregation
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.
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.
Please cite [0] when using MovingPandas in your research.
All releases of MovingPandas have DOIs via Zenodo: https://doi.org/10.5281/zenodo.3710950
- Pappalardo, L., Simini, F., Barlacchi, G., & Pellungrini, R. (2019). scikit-mobility: A Python library for the analysis, generation and risk assessment of mobility data. arXiv preprint arXiv:1907.07062.
- 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.