ACCURATE VELOCITY ESTIMATES FROM INACCURATE GPS DATA Norman J. Cimon, Systems Analyst Michael J. Wisdom, Wildlife Biologist, United States Forest Service, Pacific Northwest Research Station Forestry & Range Sciences Lab 1401 Gekeler Lane, La Grande, Oregon email: ncimon@fs.fed.us ABSTRACT We used an empirical technique to obtain an accurate velocity estimate from inaccurate GPS data. It relies on everincreasing time-differences to reduce the relative error component in distance measurements based on GPS position data error. The technique was used to derive estimate the average velocity for four sets of recreation visitor trials on a rural forest road system: for hikers, bikers, horseback riders, and all terrain vehicle users. THE RECREATION STUDY ATV riding, mountain biking, horseback riding, and hiking were used as experimental treatments during 2002 and 2003 in an area closed to all human activities except the treatments. Each activity was randomly selected and run on trails and primitive roads for a given 5-day period, followed by a 9-day period of rest (no human activity). This pattern was repeated from spring through fall. Responses of animals to each activity versus rest periods were analyzed in a variety of ways, including movement rates, flight responses, and habitat selection. As part of this recreation-use study (Wisdom et al. 2004), conducted at the Starkey Experimental Forest and Range (Cimon et al. 2004), we collected GPS position observations at one-second intervals for each of four series of recreation trials: all-terrain vehicles, hikers, bikers, and horseback riders. Then, for each of the trial types, an average velocity, defined as the average speed of each recreation activity in meters per minute, was obtained. These velocity estimates will eventually be used to derive recreation density and to obtain estimates of equivalent recreation use and its impact on deer and elk movements (Wisdom et al. 2004). The GPS units were programmed to use all available satellites when finding a location regardless of the number and geometry of those satellites. To date we have collected about 4 million GPS locations as part of 498 trials in the two years of the study. At the one-second sampling frequency, distance estimates based on differences between position measurements often include large error components (the discrepancy between true location and estimated location) which biases the resulting velocity estimates. We needed a method to calculate the average velocity under these conditions. As one example, hikers move relatively slowly, and the GPS error can easily overwhelm their movement at the onesecond sampling frequency. METHODS We decided to calculate the average velocity for different time lags between GPS locations for a given recreation trial. Our reasoning was that we could reduce the effect of the GPS error for a trial if we used a longer time lag between GPS locations. We calculated the velocity using 1, 5, 10, 15, 20 and 25-second differences. A graphical example for the first two of these is shown in Figure 1. Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004 Figure 1. One and five second GPS differences used for calculating average velocity After calculating the average velocity using each of set of time-lagged points, we examined the results. As we expected, the greater the lag size, the more the calculated average asymptotically approached what we assume is the true mean. The key to the analysis was the use of a relational database to store and analyze the data. Rapid application development techniques were used to prototype then build an application1 that transfers the data from the dBase files created by the Trimble2 GPS units directly into one of the Forest Service Oracle instances. The application also tracks which specific trials had previously been loaded, and notified us if there were any conflicts (Appendix 3). The complete details of the loading and analysis process are too lengthy to describe in this paper, but a block diagram of the general process is shown in 1 For more information on this application, please contact the Starkey data administrator Norm Cimon at ncimon@fs.fed.us. 2 Mention of products or sources is given for information only. It does not constitute endorsement of the authors or their employers. Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004 Appendix 1. The data, once in Oracle, were immediately made available through a library in the SAS system. A SAS macro (Appendix 4) then created a series of datasets: one for each lagged velocity average grouped by trial. Our initial decision to create a sequential key (called ID) for each GPS location as it was loading into the relational DB allowed us to easily join two copies of the table via the correct offset3 which greatly simplified this process. Additional macros were used to merge datasets, to fit different trial curves to the resulting velocity estimators, to find trials with certain properties, to plot asymptotes, and to perform other analytical tasks4. RESULTS AND DISCUSSION To gain an understanding of the trend for each trial – and between trials of the same type – we plotted the velocity averages as a function of the lag for each of them in SAS. A cross-section of these trials was also exported to SigmaPlot for graphing. These are shown in Appendix 2 along with a trial-specific curve-fit that approximates the velocity trend well, and the asymptote for each curve. These trend lines were also calculated using the facilities of SAS. Two different non-linear models were fit to the six lagged averages we’d calculated for each of our individual trials using models suggested by the data itself. The first is: vˆ ( L) = a ⋅ e − bL + c where a , b and c are the constants of the fit, and L is the number of lag points. The second: a vˆ ( L) = + b L where a and b are constants and L , again, is the number of lag points. A second paper, currently in preparation will provide a theoretical justification for the selection we made of the proper model and an examination of the errors associated with it. There is a caveat: the path of any GPS unit will rarely be straight, and any will affect the computation of the distance and thus the velocity if the lag window becomes large (or the GPS unit is traveling very rapidly). Nonetheless, the technique represents a new way of looking at GPS data. Even with relaxed requirements on the precision of individual GPS locations, it is possible to obtain a very precise estimate of the velocity of the path the GPS unit is traveling, a property of the entire point-set. An added benefit is that the technique could, in theory, be incorporated directly into the units themselves, as it requires only minimal storage to compute a series of running averages. The logic to determine the non-linear regression parameters would also have to be programmed into the unit. The device would then provide very accurate velocity data from relatively inaccurate location information. LITERATURE CITED Cimon, N., D. White, and N. Negulescu. Starkey Facilities, Http://www.fs.fed.us/pnw/starkey/starkey_details/index.shtml. 2004. Wisdom, M. J., A. A. Ager, N. J. Cimon, B. K. Johnson, and H. K. Preisler. Effects of off-road recreation on mule deer and elk. Transactions of the North American Wildlife and Natural Resources Conference 69. 2004. 3 The WHERE clause in each proc SQL (Appendix 4) includes the necessary statements to join the two copies of the table including the last AND with the ID field offset by the correct number of data points for the given time-lag. 4 For copies of these macros, please contact the Starkey data administrator Norm Cimon at ncimon@fs.fed.us. Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004 Appendix 1. Block diagram of GPS data processing Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004 Appendix 2. Cross-section of trial analyses for each recreation type Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004 Appendix 3. Starkey ATV study RAD application (top: loading data / bottom: trials in the DB) Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004 Appendix 4. SAS proc SQL code for 1 and 5 second time-lagged velocity estimates proc sql; CONNECT TO ORACLE AS StkyDBMS (user=STKYDBA pw=xxxxxxxx path='idb' connection=global); /* * Query to produce the average speed (SPEED) in meters/second by * Transport Type (TRANSPORT) and day (DAY) for the StarkeyATV * study. */ CREATE TABLE StkyRec.AvgSpd01 AS SELECT * FROM connection to StkyDBMS (SELECT T1.TRANSPORT "Transport", T1.OBSDATE "TrialDate", T1.SECTION "Section", T1.TIMEOFDAY "AM/PM", T1.SEQUENCE "Sequence", 1 "lag pts", SUM(SQRT(POWER(T1.NORTHING-T2.NORTHING,2)+POWER(T1.EASTING-T2.EASTING,2)))/ (86400*SUM(NEW_TIME(T1.GPS_TIME,'GMT','PDT')-NEW_TIME(T2.GPS_TIME,'GMT','PDT'))) "Avg Speed" FROM STKY_ATV_POSNPNT T1, STKY_ATV_POSNPNT T2 WHERE T2.TRANSPORT = T1.TRANSPORT AND T2.OBSDATE = T1.OBSDATE AND T2.SECTION = T1.SECTION AND T2.TIMEOFDAY = T1.TIMEOFDAY AND T1.SEQUENCE = T2.SEQUENCE AND T2.ID = T1.ID-01 GROUP BY T1.TRANSPORT, T1.OBSDATE, T1.SECTION, T1.TIMEOFDAY, T1.SEQUENCE); proc sql; CONNECT TO ORACLE AS StkyDBMS (user=STKYDBA pw=xxxxxxxx path='idb' connection=global); /* * Query to produce the average speed (SPEED) in meters/second by * Transport Type (TRANSPORT) and day (DAY) for the StarkeyATV * study. */ CREATE TABLE StkyRec.AvgSpd05 AS SELECT * FROM connection to StkyDBMS (SELECT T1.TRANSPORT "Transport", T1.OBSDATE "TrialDate", T1.SECTION "Section", T1.TIMEOFDAY "AM/PM", T1.SEQUENCE "Sequence", 5 "lag pts", SUM(SQRT(POWER(T1.NORTHING-T2.NORTHING,2)+POWER(T1.EASTING-T2.EASTING,2)))/ (86400*SUM(NEW_TIME(T1.GPS_TIME,'GMT','PDT')-NEW_TIME(T2.GPS_TIME,'GMT','PDT'))) "Avg Speed" FROM STKY_ATV_POSNPNT T1, STKY_ATV_POSNPNT T2 WHERE T2.TRANSPORT = T1.TRANSPORT AND T2.OBSDATE = T1.OBSDATE AND T2.SECTION = T1.SECTION AND T2.TIMEOFDAY = T1.TIMEOFDAY AND T1.SEQUENCE = T2.SEQUENCE AND T2.ID = T1.ID-05 GROUP BY T1.TRANSPORT, T1.OBSDATE, T1.SECTION, T1.TIMEOFDAY, T1.SEQUENCE); proc sql; Remote Sensing for Field Users Proceedings of the Tenth Forest Service Remote Sensing Applications Conference Salt Lake City, Utah April 5-9 2004