Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Anita Graser: Analyzing Movment Data with MovingPandas

28 views

Published on

The analysis of movement is an important research topic in, for example, geography, ecology, visual analytics, GIScience as well as in application domains such as urban, maritime, and aviation research. Movement data analysis requires tools for the manipulation and visualization of movement or trajectory data. This talk presents the new Python library MovingPandas.org

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

Anita Graser: Analyzing Movment Data with MovingPandas

  1. 1. ANALYZING MOVEMENT DATA with MovingPandas Anita Graser @underdarkGIS https://github.com/anitagraser/movingpandas
  2. 2. Unfortunately not this kind of Pandas … MOVINGPANDAS
  3. 3. … but this: MOVINGPANDAS https://pandas.pydata.org
  4. 4. MOTIVATION https://anitagraser.com/2016/09/18/movement-data-in-gis-issues-ideas/
  5. 5. Movement data is … … geographic … temporal  Geographic features with timestamps?  Timeseries with geometries? MOTIVATION e.g. id,x,y,t,state,type_code a,11.0,2.0,2012-01-17T12:33:51Z,walking,1 a,12.0,3.0,2012-01-17T12:36:11Z,walking,1 a,10.0,3.0,2012-01-17T12:36:51Z,walking,2 b,10.0,2.0,2012-01-17T12:33:51Z,walking,2 b,11.0,3.0,2012-01-17T12:36:51Z,walking,2 c,12.0,1.0,2012-01-17T12:33:51Z,vehicle,1 c,10.0,2.0,2012-01-17T12:35:21Z,vehicle,1 c,11.0,3.0,2012-01-17T12:36:51Z,vehicle,1 ... https://anitagraser.com/2017/10/15/movement-data-in-gis-9-trajectory-data-models/
  6. 6. 1. GIS / Spatial databases e.g. PostGIS (Graser 2018) 2. R package trajectories (Pebesma et al., 2018; Moradi et al., 2018 preprint) 3. Moving object databases, e.g. Hermes (Pelekis et al., 2015) DATA MODELS FOR TRAJECTORIES
  7. 7. GIS – AN OBVIOUS CHOICE? 702/12/2019
  8. 8. Simple Features  Points / Segments between two points  No built-in logic @ chronological order & moving object identity  Lines  Only attributes for whole trajectory  No timestamp for each location GIS – AN OBVIOUS CHOICE?
  9. 9. Points + connections R TRAJECTORIES (Moradi et al., 2018 preprint)
  10. 10. Sliced representation (Güting et al. 2000) Slice = time period + movement function MOVING OBJECT DATABASES (HERMES) (Pelekis et al., 2015)
  11. 11. 1. Individual trajectories (Dodge et al., 2008) 2. Groups of trajectories (Wiratma et al., 2017) 3. Data manipulation FUNCTIONS FOR TRAJECTORIES
  12. 12. 1. Individual trajectories (Dodge et al., 2008) a) Spatial primitives – location at a given time b) Temporal primitives – time at a given location c) Spatial primary derivatives – distance, direction & spatial extent d) Temporal primary derivatives – duration e) Spatio-temporal primary derivatives – speed & velocity 2. Groups of trajectories (Wiratma et al., 2017) 3. Data manipulation FUNCTIONS FOR TRAJECTORIES
  13. 13. 1. Individual trajectories (Dodge et al., 2008) 2. Groups of trajectories (Wiratma et al., 2017) a) One trajectory among other trajectories – distance & similarity measures b) Single group of trajectories c) Between groups of trajectories 3. Data manipulation FUNCTIONS FOR TRAJECTORIES
  14. 14. 1. Individual trajectories (Dodge et al., 2008) 2. Groups of trajectories (Wiratma et al., 2017) 3. Data manipulation a) Clip to area of interest b) Range queries c) Nearest-neighbour queries d) Downsampling / generalization e) Geographic coordinate system handling & visualization FUNCTIONS FOR TRAJECTORIES
  15. 15. Pandas … developed in the context of financial modeling  extensive set of tools for working with dates, times, and time-indexed data GeoPandas … extends the data types used by pandas to allow spatial operations on geometric types  http://geopandas.org WHY PANDAS?
  16. 16. Trajectory id: string df: GeoDataFrame crs: string parent: Trajectory __str__() set_crs(crs) has_parent(): boolean to_linestring(): shapely.geometry.LineString to_linestringm_wkt(): string get_start_location(): shapely.geometry.Point get_end_location(): shapely.geometry.Point get_bbox(): (minx, miny, maxx, maxy) tuple get_start_time(): datetime get_end_time(): datetime get_duration(): timedelta get_length(): float get_direction(): float get_row_at(timestamp, method='nearest'): pandas.Series get_position_at(timestamp, method='nearest'): shapely.geometry.Point get_linestring_between(timestamp1, timestamp2): shapely.geometry.LineString get_segment_between(timestamp1, timestamp2): Trajectory add_direction() add_speed() make_line(df): shapely.geometry.LineString clip(shapely.geometry.polygon): Trajectory intersection(fiona.feature): Trajectory MOVINGPANDAS TRAJECTORY CLASS
  17. 17. Link to demo on movingpandas.org
  18. 18. Link to demo on movingpandas.org
  19. 19. Link to demo on movingpandas.org
  20. 20. Link to demo on movingpandas.org
  21. 21. Link to demo on movingpandas.org
  22. 22. Link to demo on movingpandas.org
  23. 23. Link to demo on movingpandas.org
  24. 24. Link to demo on movingpandas.org
  25. 25. Link to demo on movingpandas.org
  26. 26. Link to demo on movingpandas.org
  27. 27. Link to demo on movingpandas.org
  28. 28. Link to demo on movingpandas.org
  29. 29. Link to demo on movingpandas.org
  30. 30. Trajectools plugin for Processing toolbox MOVINGPANDAS INTEGRATION IN QGIS https://anitagraser.com/2019/02/02/movement-data-in-gis-20-trajectools-v1-released/
  31. 31. 3102/12/2019 https://anitagraser.com/2019/01/26/movement-data-in-gis-19-splitting-trajectories-by-date/
  32. 32. Anita Graser VISIT MOVINGPANDAS.ORG

×