Giter VIP home page Giter VIP logo

artificial-gps-repo's Introduction

Creating Artificial GPS-tracks

This collection of python script allows for the creation of artificial GPS tracks. It builds on the ideas of Thierry, Chaix, and Kestens (2013) that they put forward in "Detecting activity locations from raw GPS data: a novel kernel-based algorith" (International Journal of Health Geography).

The workflow of Ian Broad (http://ianbroad.com/download/script/CreatePointsLines.py) is used and adjusted to transform polylines (step 4; see below) to points.

Requirements

  1. Python with the following packages:
  • arcpy
  • pandas
  • numpy
  1. Flowmap (http://flowmap.geo.uu.nl/). Alternatively the ArcGIS network analysist can be used; but this requires an adjustment of the code. Script requires base Flomwap scripts to import points and execute shortest path analysis; examples attached.

  2. Road network (topologically correct) with attribute values for shortest path analysis.

Usage

Adjust files, pathnames according to needs (for each script), and run scripts in order.

Steps

  1. Selection of a random number of random activity location (minimum of two, maximum of nine) within a set study area.

  2. Random assignment of a duration classification to each of the activities (short, medium, long). After randomly assigning a duration classification to each activity, the actual duration of the activity is determined using a Poisson distribution. The seed value is randomly drawn from a normal distribution with the following parameters:

  • A mean of 8 minutes and a standard deviation of 3 minutes for activities with a short duration (e.g. picking someone up).
  • A mean of 50 minutes and a standard deviation of 10 minutes for activities with a medium duration (e.g. buying groceries).
  • A mean of 300 and a standard deviation of 60 minutes for activities with a long duration (e.g. work, school).
  1. Generation of activity points (one every 30 seconds) around the activity locations. GPS noise is simulated by shifting the coordinates from the original identified activity location. The shifts follow a bi-dimensional normal distribution centred around 0 with a standard deviation that is randomly drawn from a uniform distribution ranging from 10 to 200 meter.

  2. Connection of the generated activity locations sequence (e.g. Activity 1 to Activity 2, Activity 2 to Activity 3, etc.) using shortest path analysis in Flowmap.

  3. Transformation of the resulting polylines into points and a random assignment of a transport mode. The spacing of the points is based on the measurement frequency (30 seconds) as well as the speed of the assigned transport mode. The speeds for each point are recursively drawn from a normal distribution with the following parameters:

  • A mean of 80 km/h and a standard deviation of 10 km/h for a car driving fast (e.g. freeway).
  • A mean of 60 km/h and a standard deviation of 5 km/h for a car driving normally (e.g. urban setting).
  • A mean of 20 km/h and a standard deviation of 5 km/h for a car driving slowly (e.g. in a living area).
  • A mean of 15 km/h and a standard deviation of 3 km/h for cycling.
  • A mean of 5 km/h and a standard deviation of 2 km/h for walking.
  1. Introduction of noise in GPS tracks by randomly shifting the trip points along their X and Y axes; the shifts followed a bi-dimensional normal distribution with a mean of 0 metres and a standard deviation of 10 metres.

  2. Merging of the activity points and the track points to get the artificial activity travel sequence.

  3. Calculation of attribute values (e.g. speed, acceleration, distance to road network, etc.).

Code

Author: Justin van Dijk Created: 11/12/2017

artificial-gps-repo's People

Contributors

jtvandijk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.