Main Page/Research/MSB/processing model/20090607

From phurvitz
< Main Page‎ | Research‎ | MSB‎ | processing model
Revision as of 00:55, 11 July 2009 by Phil Hurvitz (talk | contribs) (Trip, stop, and dwell)
Jump to: navigation, search

Processing Steps with scripts named

Download

msb.get.data.R

Concatenate individual files

join_data.R

  • Establishes unique ID field (seq_id) for each point in the subject's data

Create lines, perform initial activity parsing

actfilter.R

  • Encodes all geographic features as 3D, where the Z coordinate is inherited from the seq_id value for the coordinate
  • Creates PostGIS tables:
  1. sid_filtered_points
  2. sid_line
  • Creates 3 shapefiles:
  1. sid_filtered_points.shp (all initial points, classified)
  2. sid_stat{,unedited}.shp (stationary bouts)
  3. sid_move{,unedited}.shp (moving bouts)
  • Dumps XYZ data as sid_xyzmb.raw.dat.

Manual editing

Each data set (stat, move) needs to be manually reviewed and edited.

  1. Obviously erroneous vertices (waaaay out) should be deleted (using Ian-ko's tools http://www.ian-ko.com/)
  2. Ranges of incorrectly coded data should be flagged for recoding
    1. Vertices need to be identified, using vertex editor in ArcMap.
    2. Note range of vertices for recoding and place in file recode.txt, with pattern start, end, code, e.g. to specify a range for recoding to stationary:
      2197, 2480, 0

Apply manual edits

apply_edits.R

  1. Reads edited shapefiles (sid_move.shp and sid_stat.shp) into PostGIS as sid_move_intermediate and sid_stat_intermediate and joins them as sid_intermediate.
  2. Dumps Z coordinates (seq_id) from edited data
  3. Reads raw Z coordinates (from sid_xyzmb.raw.dat)
  4. Compares list of raw and edited coordinates, and deletes necessary coordinates
  5. Recodes activity by recode.txt
  6. Pushes data to PostGIS as sid_line_edit
  7. Dumps new versions of shapefiles from PostGIS
    • sid_move.shp
    • sid_stat.shp
  8. Allows repeted edit cycles.

Trip, stop, and dwell

  • Potentially a method for getting stops: line_edit_to_points.R
    • It takes each trip's points and "straightens" them out to allow for measuring the focal count of points in a radius
    • It counts the number of points in the radii seq(50,150,25) for each measured point
    • There may be thresholds for what is a "stop" based on focal counts.
      t20 <- trips.joined[trips.joined$trip.id==20,]
      plot(t20$seq.id,t20$rcount.150, ty="l")
      lines(t20$rcount.75, col="green")
      lines(t20$seq.id, t20$rcount.75, col="green")
      lines(t20$seq.id,t20$rcount.75, col="green")
      lines(t20$seq.id,t20$rcount.10, col="magenta")
      lines(t20$seq.id,t20$rcount.125, col="blue")
      lines(t20$seq.id,t20$rcount.50, col="red")
      abline(h=t20$vel.fps[1]*2, col="yellow")