├── .ipynb_checkpoints └── particle_filters-checkpoint.ipynb ├── README.md ├── environment.yml ├── new_abcoij_0.png ├── new_abcoij_1.png ├── new_abcoij_3.png ├── new_abcoij_6.png ├── new_abcoij_6_aug.png ├── new_abcoij_6_aug2.png ├── new_abcoij_6_aug3.png └── particle_filters.ipynb /README.md: -------------------------------------------------------------------------------- 1 | # particle filters for map matching 2 | 3 | Cheryl Roberts (kopant@gmail.com) 4 |
5 | This project includes a class for fitting particle filters to GPS trace data, adapted from 6 | Newson and Krumm's 2009 paper "Hidden Markov map matching through noise and sparseness." 7 | That paper used HMMs to smooth GPS traces, whereas here I have used particle filters. 8 | 9 | One difference in my approach is that as I do not have easy access to the driving distance between two arbitary points, I use haversine distance in the transition calculation. 10 | 11 | ## Environment 12 | Code has been tested with python 3.7.0; an environment.yml file lists the dependencies. Shapely is used for geospatial data structures, with pandas and numpy behind the scenes. Matplotlib basemap is used for quick visualization. 13 | 14 | ## Datasets 15 | 1. Cabspotting GPS trace data, retrieved from http://crawdad.org/epfl/mobility/20090224/cab/ 16 | 2. San Francisco shapefile, retrieved from OpenStreetMap via https://extract.bbbike.org 17 | 18 | ## References 19 | 1. Newson, P. and Krumm, J. (2009). Hidden Markov Map Matching Through Noise and Sparseness. Proceedings of the 17th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, Seattle, WA, pp. 336-343. 20 | 2. Russell, S. and Norvig, P. (2009). Artificial Intelligence: A Modern Approach (3rd Edition). Pearson: London, UK. 21 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: map_matching_particle_filter 2 | # prefix: ./envs # particle_filter repo folder OR default (used) Volumes/LaCie/anaconda/envs 3 | channels: 4 | - defaults 5 | dependencies: 6 | - ipykernel 7 | - numpy=1.16.4 8 | - pandas=0.24.2 9 | - scikit-learn 10 | - matplotlib 11 | - pyproj 12 | - fiona 13 | - shapely 14 | - basemap-data-hires 15 | - basemap 16 | - cartopy #new 17 | - pip: 18 | - folium==0.10.1 19 | # - Shapely==1.7.0 20 | # - Fiona==1.8.13.post1 21 | # - pyproj==2.2.1 #2.6.0 22 | -------------------------------------------------------------------------------- /new_abcoij_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_0.png -------------------------------------------------------------------------------- /new_abcoij_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_1.png -------------------------------------------------------------------------------- /new_abcoij_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_3.png -------------------------------------------------------------------------------- /new_abcoij_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_6.png -------------------------------------------------------------------------------- /new_abcoij_6_aug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_6_aug.png -------------------------------------------------------------------------------- /new_abcoij_6_aug2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_6_aug2.png -------------------------------------------------------------------------------- /new_abcoij_6_aug3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kopant/particle_filter/8aeb90edbfabbc41dd5381b4b74c5d3990182727/new_abcoij_6_aug3.png --------------------------------------------------------------------------------