Backcountry Forum
Backpacking & Hiking Gear

Backcountry Forum
Our long-time Sponsor - the leading source for ultralite/lightweight outdoor gear
 
 
 

Amazon.com
Backpacking Forums
---- Our Gear Store ----
The Lightweight Gear Store
 
 WINTER CAMPING 

Shelters
Bivy Bags
Sleeping Bags
Sleeping Pads
Snow Sports
Winter Kitchen

 SNOWSPORTS 

Snowshoes
Avalanche Gear
Skins
Hats, Gloves, & Gaiters
Accessories

 ULTRA-LIGHT 

Ultralight Backpacks
Ultralight Bivy Sacks
Ultralight Shelters
Ultralight Tarps
Ultralight Tents
Ultralight Raingear
Ultralight Stoves & Cookware
Ultralight Down Sleeping Bags
Ultralight Synthetic Sleep Bags
Ultralight Apparel


the Titanium Page
WM Extremelite Sleeping Bags

 CAMPING & HIKING 

Backpacks
Tents
Sleeping Bags
Hydration
Kitchen
Accessories

 CLIMBING 

Ropes & Cordage
Protection & Hardware
Carabiners & Quickdraws
Climbing Packs & Bags
Big Wall
Rescue & Industrial

 MEN'S APPAREL 

Jackets
Shirts
Baselayer
Headwear
Gloves
Accessories

 WOMEN'S APPAREL 

Jackets
Shirts
Baselayer
Headwear
Gloves
Accessories

 FOOTWEAR 

Men's Footwear
Women's Footwear

 CLEARANCE 

Backpacks
Mens Apparel
Womens Apparel
Climbing
Footwear
Accessories

 BRANDS 

Black Diamond
Granite Gear
La Sportiva
Osprey
Smartwool

 WAYS TO SHOP 

Sale
Clearance
Top Brands
All Brands

 Backpacking Equipment 

Shelters
BackPacks
Sleeping Bags
Water Treatment
Kitchen
Hydration
Climbing


 Backcountry Gear Clearance

Page 1 of 3 1 2 3 >
Topic Options
Rate This Topic
#162200 - 02/15/12 09:06 AM Dumb question on GPS
Gershon Offline
member

Registered: 07/08/11
Posts: 1109
Loc: Colorado
Let's say we hike a mile straight up or down a 30 degree slope. I know this is almost dangerously steep, but the numbers work easy.

If I accurately pace my distance. But on the map, I've only moved .87 miles. Which will the GPS show? My impression is it will show the mile.

If I marked the start as a waypoint and I hiked in a straight line, will the distance to the waypoint show as .87 miles or 1 mile?

This only matters over long distances. The Appalacian Trail is 2,187 miles long. Is that according to the map? Or is that according to miles walked. If the average slope is 7 degrees, there is a 10% difference.

Maybe I woke up too early this morning.
_________________________
http://48statehike.blogspot.com/

Top
#162213 - 02/15/12 11:04 AM Re: Dumb question on GPS [Re: Gershon]
wandering_daisy Offline
member

Registered: 01/11/06
Posts: 2865
Loc: California
I would think horizontal distance. Based on several satallites the GPS should be capable of measuring the distance on the slope, but I am not sure all GPS units are that sophisticated. If it gave you slope distance than that would not match the map that is shown on your GPS screen.

Top
#162218 - 02/15/12 12:10 PM Re: Dumb question on GPS [Re: Gershon]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
I would be really surprised if the GPS did not give you the full mile. GPS locates you 3-dimensionally. It would be shear laziness on the part of the programmers not to use the info. I would also think reported trail miles are actual miles and typically not numbers measured off a map. What about the topo map tools some people use? It too should also be able to use elevation change to calculate actual miles covered.

Top
#162220 - 02/15/12 12:22 PM Re: Dumb question on GPS [Re: wandering_daisy]
Gershon Offline
member

Registered: 07/08/11
Posts: 1109
Loc: Colorado
Originally Posted By wandering_daisy
I would think horizontal distance. Based on several satallites the GPS should be capable of measuring the distance on the slope, but I am not sure all GPS units are that sophisticated. If it gave you slope distance than that would not match the map that is shown on your GPS screen.


But if it does not give you the slope distance, it will not match the distance you hike. With a GPS in a car, the distance traveled matches the odometer with a correction for the percent the odometer is off.

I think I'm going to have to go climb a mountain and see. Yet, as you say, if it does it that way, it will not match the map.


_________________________
http://48statehike.blogspot.com/

Top
#162222 - 02/15/12 12:56 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
A GPS, does not add elevation profiles to your distance, it measures point to point.

You could climb a ladder that's a mile high and still not have moved a bit from your starting lat/long, and your GPS will tell you that have traveled zero feet, as it should.


Edited by billstephenson (02/15/12 12:58 PM)
_________________________
--

"You want to go where?"



Top
#162224 - 02/15/12 01:06 PM Re: Dumb question on GPS [Re: Gershon]
lori Offline
member

Registered: 01/22/08
Posts: 2801
The GPS measures what you have traveled. I can go down a series of switchbacks and drop 1,000 feet and it will tell me how far I've gone on the trail - it's more than it would tell me if I had not walked all those switchbacks and just slid down a pole. It leaves breadcrumbs and measures speed as well as time.

I suppose I could do an experiment - throw the GPS off a hill and go get it at the bottom, and see what it tells me, then walk back up the slope and compare the two. But it's not going to short you because the distance is not linear.
_________________________
"In the beginner's mind there are many possibilities. In the expert's mind there are few." Shunryu Suzuki

http://hikeandbackpack.com

Top
#162226 - 02/15/12 01:15 PM Re: Dumb question on GPS [Re: Gershon]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
To calculate actual distance (d) off of a topo map. Determine the horizontal distance taveresed (x), count up the number of contour lines you cross (n), and the vertical distance between each contour line (h). Plug into this equation:

d = x/sin(arctan(n*h/x))

if you don't like arctan and sin's you can use the alternate formulation:

d = square root(x^2 + (n*h)^2)

With topo map software you could easily develop a cubic spline algorithm to get a more accurate estimate of distance traversed. I would be surprised if commercially available topo software didn't include that feature.


Edited by BZH (02/15/12 01:31 PM)

Top
#162227 - 02/15/12 01:18 PM Re: Dumb question on GPS [Re: lori]
wandering_daisy Offline
member

Registered: 01/11/06
Posts: 2865
Loc: California
I doubt you have driven your car straight down a 30 degree slope! So that is not a good test.

Switchback vs straight down is not the question. Switchbacks will show up as horizontal variation with associated distance.

The question is the gometry of slope distance (triangle hypotenes) vs horizontal distance (long limb of triangle adjacent to the right angle).

If the "bread crumbs" are recorded as lat/long or equivelent, you get horizontal distance- the shorter distance.

By the way I am not a GPS user, just have done surveying in the past. A GPS seems to have the capability to triangulate and calculate slopes, but I do not think that is necassarily what you get when it tells you the distance. It is NOT what you get if the distance is shown on the screen (flat surface). Does your GPS have an option to give you both? You can probably find out if you read your users manual in detail or call the manufacturer.

Top
#162229 - 02/15/12 01:29 PM Re: Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
Originally Posted By billstephenson
A GPS, does not add elevation profiles to your distance, it measures point to point.

You could climb a ladder that's a mile high and still not have moved a bit from your starting lat/long, and your GPS will tell you that have traveled zero feet, as it should.


GPS most certainly does measure elevation (its not as accurate as longitude and latitude though!). Whether you are delivering bombs to a target or airplanes to a runway, the elevation is very important. See how smooth of a landing a plane would have trying to land at sea level at Denver International Airport. Horizontal distance traversed has very little meaning outside a 2-dimensional map.

Top
#162242 - 02/15/12 03:57 PM Re: Dumb question on GPS [Re: BZH]
Gershon Offline
member

Registered: 07/08/11
Posts: 1109
Loc: Colorado
WanderingDaisy,

Men do NOT read directions. We fiddle with it until we break something.

_________________________
http://48statehike.blogspot.com/

Top
#162244 - 02/15/12 04:07 PM Re: Dumb question on GPS [Re: Gershon]
Gershon Offline
member

Registered: 07/08/11
Posts: 1109
Loc: Colorado
I got my ladder out. Marked the bottom as a waypoint and climbed the ladder. It showed the distance to the waypoint as 9 feet. I climbed up and down 3 times and it showed my distance traveled as 31 feet and the distance to the waypoint as 31 feet even though I was standing at the waypoint.

_________________________
http://48statehike.blogspot.com/

Top
#162245 - 02/15/12 04:15 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
W_D has it right. I've worked with the data files a GPS records, distance is measured with a series of lat/long points.

You can adjust the distance between recorded points on most GPS units, and the finer grain you select provides a more accurate account of the distance you've traveled.

A GPS can also record an elevation profile. This will show you the ups and downs you traveled, but that is not the same as the distance you traveled.

Distance is measured on a two dimensional plane. If you view an elevation profile on a graph you'll see the miles shown on the graph are not adjusted to elevation.

They are not adjusted on for elevation on your GPS track either, but that's as it should be. If you buy a square mile of land the boundaries would be pretty wonky if they took terrain into account when measuring the mile. There are old jokes about getting more land for your money here in the Ozarks based on that.

Many GPS units have a "Measuring tool" built in. It will show you the distance between your location and the curser on the screen. You can use that to see how the topography is not accounted for when displaying the distance between to points.



_________________________
--

"You want to go where?"



Top
#162250 - 02/15/12 04:48 PM Re: Dumb question on GPS [Re: billstephenson]
OregonMouse Offline
member

Registered: 02/03/06
Posts: 6760
Loc: Gateway to Columbia Gorge
I've been having fun with distance estimates in local guidebooks (Mt. Hood and Columbia River Gorge). Most of the printed guidebooks agree within 0.2 mile, but the distances shown in the PortlandHikers.org Field Guide definitely vary from the printed guidebooks, many up to half a mile less. Most of the distances in the online Field Guide were measured with a GPS.

Hard telling who's right, but some of the folks who did the measuring for the Field Guide admit that GPS readings underestimate the distance!

I personally don't and won't use a GPS. It's just another gadget that needs batteries and can malfunction. I've gotten along just fine with map and compass (plus looking for landmarks, old USFS blazes, etc.) for 67 years now. Besides, I'm still trying to figure out the directions for my 4-year-old digital camera!


Edited by OregonMouse (02/15/12 04:50 PM)
_________________________
May your trails be crooked, winding, lonesome, dangerous, leading to the most amazing view--E. Abbey

Top
#162251 - 02/15/12 04:56 PM Re: Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
You should have read Gershon's reply above you before you replied. When you buy a 40 of land it is 1/4 mile by 1/4 mile on a 2-d map (or aerial projection). If you walk your entire boundary it will be farther than 1 mile and the surface area of your 40 will be more than 40 acres. In deed I once looked into purchasing a piece of land. It was a 40 with a small chunk cut out where somebody built a house. So it was less than a proper 40 but it was advertised as 42 acres.

Top
#162252 - 02/15/12 04:57 PM Re: Dumb question on GPS [Re: Gershon]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Quote:
I got my ladder out. Marked the bottom as a waypoint and climbed the ladder. It showed the distance to the waypoint as 9 feet. I climbed up and down 3 times and it showed my distance traveled as 31 feet and the distance to the waypoint as 31 feet even though I was standing at the waypoint.


That sounds right. My GPS gives an estimate of accuracy for the lat/long it displays. On a good day it's about 12 ft.

Same with elevation.

If you stand still and watch it, you can see the accuracy readings fluctuate as satellites come in and out of range.

These fluctuations do affect your trip meter too.
_________________________
--

"You want to go where?"



Top
#162254 - 02/15/12 05:11 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By BZH
You should have read Gershon's reply above you before you replied.


What is it you think am I missing?

_________________________
--

"You want to go where?"



Top
#162256 - 02/15/12 05:24 PM Re: Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
Originally Posted By billstephenson

What is it you think am I missing?


Wow... so if I understand you correctly, you believe Gershon's reading are a result of inaccuracy in his GPS? Is that correct, so I assume you believe his results would have been the same if he had stood at the bottom of the ladder for the same amount of time as it took him to climb up and down 3 times? You sure are stubborn Bill.

Gershon, would you mind repeating your experiment? Apparently Bill is still unconvinced that GPS's calculate actual distance traversed. Set a way point and stand their for a couple minutes. Report the distance traveled. Climb up and down the ladder three times and report the distance traveled. Then stand there a couple more minutes and report the distance traveled. Here are my predictions for the three readings: (1) 0-3 feet, (2) 25 - 31 feet, (3) 0-3 feet.

Top
#162257 - 02/15/12 05:32 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By Gershon
...and the distance to the waypoint as 31 feet even though I was standing at the waypoint.


Originally Posted By BZH
Originally Posted By billstephenson

What is it you think am I missing?


... so if I understand you correctly, you believe Gershon's reading are a result of inaccuracy in his GPS? ...

You sure are stubborn Bill.

Gershon, would you mind repeating your experiment?


Gershon's experiment shows the inaccuracy, he pointed it out.

_________________________
--

"You want to go where?"



Top
#162259 - 02/15/12 05:46 PM Re: Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
Originally Posted By billstephenson

Gershon's experiment shows the inaccuracy, he pointed it out.



He walked 30 feet to get there!!! He is climbing up and down a ladder. As he is climbing up and down his distance traveled is increasing, even though he hasn't moved inch in terms of lat. and long.

At the end of his experiment the GPS said he had traveled 31 feet. It didn't say he was 31 feet from his original way point. Ooooh... that would be another way to verify what you are saying is wrong. If his results were due to inaccuracy, it would say he is 31 feet from his way-point. I bet it says he is right on top of his way-point.

Top
#162261 - 02/15/12 06:10 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Quote:
If his results were due to inaccuracy, it would say he is 31 feet from his way-point.


That is what happened.

_________________________
--

"You want to go where?"



Top
#162262 - 02/15/12 06:20 PM Re: Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
your right I read that wrong.

Top
#162266 - 02/15/12 06:53 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By BZH
To calculate actual distance (d) off of a topo map....

d = x/sin(arctan(n*h/x))

if you don't like arctan and sin's you can use the alternate formulation:

d = square root(x^2 + (n*h)^2)


Let's go back to that.

That math is way over my head but writing the code to use is not. I'll have to take a look at the data file my GPS exports, but if it does record elevation with the lat/long in the track logs then could you write a formula to account for that?

I should point out that I don't think it's beyond the GPS/GIS technologies capability to do what Gershon wants, it's just not how it is approached and implemented. There are some logical reasons behind the approach used.

But for our purposes, the total distance walked would be more accurate if it included the difference in elevation between the points. And knowing the total ups and downs, which I can do if the elevation is there, would also be interesting to know.

_________________________
--

"You want to go where?"



Top
#162267 - 02/15/12 07:19 PM Re: Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
Originally Posted By billstephenson

Let's go back to that.

That math is way over my head but writing the code to use is not. I'll have to take a look at the data file my GPS exports, but if it does record elevation with the lat/long in the track logs then could you write a formula to account for that?

I should point out that I don't think it's beyond the GPS/GIS technologies capability to do what Gershon wants, it's just not how it is approached and implemented. There are some logical reasons behind the approach used.

But for our purposes, the total distance walked would be more accurate if it included the difference in elevation between the points. And knowing the total ups and downs, which I can do if the elevation is there, would also be interesting to know.



Sure... The equation for linear distance between two points in 3-d space is:

d = sqrt(deltax^2 + deltay^2 + deltaz^2)

you would calculate deltax as the difference in latitude between points, deltay as the difference in longitude, and deltaz as the difference in elevation.

That would be the linear approach (assuming you walked in a straight between successive points). I could develop an algorithm the plots a smooth curve over all the data points and then calculates distance traveled from their. I'd have to think about that a bit more. In 2-d space it would be called a cubic spline.

Top
#162271 - 02/15/12 08:10 PM Re: Dumb question on GPS [Re: BZH]
Gershon Offline
member

Registered: 07/08/11
Posts: 1109
Loc: Colorado
I just repeated the experiment. Sometimes it measured the distance up the ladder, sometimes it did not.I went up and down about 10 times.

This time, the distance to the start stayed the same with normal 2 or 3 foot fluctuations.

Meanwhile, the neighbors are probably starting to wonder about me.

_________________________
http://48statehike.blogspot.com/

Top
#162273 - 02/15/12 08:29 PM Re: Dumb question on GPS [Re: Gershon]
wandering_daisy Offline
member

Registered: 01/11/06
Posts: 2865
Loc: California
Found this :

http://www.gpsaustralia.net/forums/showthread.php?t=18681

If the GPS has two lat/long coordinates, each with an elevation, and stores this data it capable of calculating the actual distance walked from point A to B, but apparently Garmin does NOT. You get horizontal distance. Then you download the data and convert to the hyoptonuse distance as a post processing function. Of course you only get the distance between measured points, so if you are not on continuous data gathering, you get a choppy set of numbers. There are tons of calculation algorithms out there on the internet that convert.

There may be some GPS units that have a chip inside that converts, thus allowing you to choose how you want distance presented. I suspect most do not simply because there appear to be many different ways to calculation depending what you want to measure. Anyway Gershon needs to look in his manual and see if there is a setting that allows one or the other.

Top
#162274 - 02/15/12 08:38 PM Re: Dumb question on GPS [Re: BZH]
squark Offline
member

Registered: 03/14/11
Posts: 66
Loc: SF bay area, CA
Quote:
The equation for linear distance between two points in 3-d space is:

d = sqrt(deltax^2 + deltay^2 + deltaz^2)

you would calculate deltax as the difference in latitude between points, deltay as the difference in longitude, and deltaz as the difference in elevation.

That would be the linear approach (assuming you walked in a straight between successive points). I could develop an algorithm the plots a smooth curve over all the data points and then calculates distance traveled from their. I'd have to think about that a bit more. In 2-d space it would be called a cubic spline.


Ooh, pick me!


d = Integral[dt sqrt((dx/dt)^2 + (dy/dt)^2 + (dz/dt)^2)]

where dx/dt is your speed in the latitudinal direction, etc.

I used to get in fights with my boyfriend when his GPS distance didn't match the distance I estimated from the map. Nice to have some backup on why.

Top
#162284 - 02/15/12 10:04 PM Re: Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Okay, here's a small sample of the data I can extract from my GPS

36.663116030395031 -92.902936963364482 353.899999999999977 2011-12-30T22:19:27Z
36.663144025951624 -92.902942998334765 354.860000000000014 2011-12-30T22:19:39Z
36.663215020671487 -92.902968982234597 358.70999999999998 2011-12-30T22:20:08Z
36.663261959329247 -92.902940986678004 360.149999999999977 2011-12-30T22:20:23Z
36.663261037319899 -92.902955990284681 359.670000000000016 2011-12-30T22:21:10Z


We have the lat, long, elevation, and a timestamp to work with.

I'm not sure what format the elevation is in. It can't be feet above sea level because I haven't been that low for a long time, so it must be meters.

We also have to look up how to calculate feet using the lat/lon method shown. I think I might have the math for that in some code I was playing with for my radar web app.

I think it'd be fun to give it shot. You're never going to be boots on the ground accurate with the civilian grade GPS we have now, but it'd be fun to measure distance with a home rolled algorithm



_________________________
--

"You want to go where?"



Top
#162341 - 02/16/12 07:05 PM Re: Dumb question on GPS [Re: squark]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Below is a perl script that will process track data exported from a Garmin GPS using Garmin's BaseCamp software.

Lines that start with a "#" are comments I've made to help explain the logic flow

I've added the routines to count the total elevation gain and loss (Up and Down) and the necessary variables are loaded to do the math to calculate the total on the ground mileage for a track. All we need is the math.

If you guys can show me how to do that I'll try and write the code for it.

---------- code starts below ----------

#!/usr/bin/perl

#############################################################
#############################################################
#
# Calc Miles Hiked v1.0"
#
#############################################################
# We use these fine modules...
use strict;
use warnings;

# an example of tab seperated values that we can export from a Garmin GPS
# the values are: lat long elevation timestamp
# we add each line of the data to an array of data

my @input = (
'36.663116030395031 -92.902936963364482 353.899999999999977 2011-12-30T22:19:27Z',
'36.663144025951624 -92.902942998334765 354.860000000000014 2011-12-30T22:19:39Z',
'36.663215020671487 -92.902968982234597 358.70999999999998 2011-12-30T22:20:08Z',
'36.663261959329247 -92.902940986678004 360.149999999999977 2011-12-30T22:20:23Z',
'36.663261037319899 -92.902955990284681 359.670000000000016 2011-12-30T22:21:10Z'
);

# the number of lines of data in our data file
my $number_of_lines = @input;

# we subtract by one so we can sync this number up with array order (it's a perl thing)
$number_of_lines = ($number_of_lines - 1);

#set our total up and down values to zero
my $totalUp = 0;
my $totalDown = 0;

#create a line counter so we know when to exit the while loop.
my $line_counter=0;

# now we start going over the data
# on the first pass we grab the first and next lines
# we increment the line number we start with on each pass
while ($line_counter < $number_of_lines) {

my ($latA, $lonA, $eleA, $timeA) = split(/\t/, $input[$line_counter]);

$line_counter++;

my ($latB, $lonB, $eleB, $timeB) = split(/\t/, $input[$line_counter]);


# now we have our data. here's the routine to count the total feet down we climbed

if ($eleB < $eleA) {

my $difference = ($eleA - $eleB);

$totalDown = ($totalDown - $difference);

}

# here's the routine to count the total feet up we climbed
if ($eleB > $eleA) {

my $difference = ($eleB - $eleA);

$totalUp = ($totalUp + $difference);

}

# here's where we need the math to figure total miles actually hiked.


}

# now we are all done so we print the results

print "Total Up: $totalUp \n";
print "Total Down: $totalDown \n";

######################################################
# Here's the printed output:
#
# Total Up: 6.25
# Total Down: -0.479999999999961
######################################################
_________________________
--

"You want to go where?"



Top
#162343 - 02/16/12 07:48 PM Re: Dumb question on GPS [Re: billstephenson]
squark Offline
member

Registered: 03/14/11
Posts: 66
Loc: SF bay area, CA
Unfortunately, path length cannot be calculated directly from total horizontal and total vertical distance (unless you're moving on a perfectly straight line), so you'd have to calculate the increment gained each time the GPS collects data (say, every 30 seconds, or so?), and add up the result:


delta_x = horizontal distance
delta_z = vertical distance

pathlength += Sqrt[ delta_x^2 + delta_z^2 ]

Top
#162345 - 02/16/12 08:31 PM Re: Dumb question on GPS [Re: squark]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By squark
so you'd have to calculate the increment gained each time the GPS collects data (say, every 30 seconds, or so?), and add up the result:

delta_x = horizontal distance
delta_z = vertical distance

pathlength += Sqrt[ delta_x^2 + delta_z^2 ]


That's what we're doing with this script. In the first instance of the "while" loop we get the difference from the values in lines 1 and 2. In the next instance we use lines 2 and 3, and so on until we've processed all the lines in the data record.

Okay, I already have the value for delta_z in the $difference variable .

I can get the value for delta_x easy enough, but I've going to need some help with the pathlength math. That's all a foreign language to me. After I get the delta_x value if you all can help me break it down so I can convert it to perl code we'll have the results we're looking for.

After that I can convert this code into a "Web App" that you can upload your track file to and get the results.
_________________________
--

"You want to go where?"



Top
#162353 - 02/17/12 02:14 AM Re: Dumb question on GPS [Re: squark]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
I found some code to calculate the distance between two lat/lon coordinates here:

http://www.zipcodeworld.com/samples/distance.pl.html

Pretty geeky stuff, but easy to incorporate it into our code and this is what I got out of the sample data I'm using in the code previously posted:

(distance is in miles, and elevation has been converted to feet)

Distance between lines 1 and 2: 0.00196259979104037 :: Elevation Difference: 3.14960630400012
Distance between lines 2 and 3: 0.00511218802656558 :: Elevation Difference: 12.6312336149999
Distance between lines 3 and 4: 0.0035948343884507 :: Elevation Difference: 4.72440945599999
Distance between lines 4 and 5: 0.000834205282553515 :: Elevation Difference: 1.57480315199987

Total Distance calculated without elevations accounted for is 0.0115038274886102

What would it be with the elevations provided above?

_________________________
--

"You want to go where?"



Top
#162377 - 02/17/12 03:04 PM Re: Dumb question on GPS [Re: squark]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By squark
so you'd have to calculate the increment gained each time the GPS collects data (say, every 30 seconds, or so?), and add up the result:

delta_x = horizontal distance
delta_z = vertical distance

pathlength += Sqrt[ delta_x^2 + delta_z^2 ]


Okay, using this data set:

Quote:
The fields are:

Lat, Lon, Ele (in meters), Time

'36.663116030395031 -92.902936963364482 353.899999999999977 2011-12-30T22:19:27Z'
'36.663144025951624 -92.902942998334765 354.860000000000014 2011-12-30T22:19:39Z'
'36.663215020671487 -92.902968982234597 358.70999999999998 2011-12-30T22:20:08Z'
'36.663261959329247 -92.902940986678004 360.149999999999977 2011-12-30T22:20:23Z'
'36.663261037319899 -92.902955990284681 359.670000000000016 2011-12-30T22:21:10Z'


These are the results I get using the code I'm running. Distance and Elevation are both converted to feet:

Quote:
Leg 1 - Distance : 10.3625268966932 ::: Elevation : 3.14960630400012
Leg 2 - Distance : 26.9923527802663 ::: Elevation : 12.6312336149999
Leg 3 - Distance : 18.9807255710197 ::: Elevation : 4.72440945599999
Leg 4 - Distance : 4.40460389188256 ::: Elevation : 1.57480315199987

Total Distance : 60.7402091398617 || Elevation Change : 22.0800525269999


That should give you the numbers you need to run your math and compare to the total distance shown. You should probably double check my numbers, but you only need to check two legs of data to confirm if they are good or not, and I'll fix them if they are bad.

I would run that last bit of math myself, but you'll have to explain what "delta_x^2" means. Is there a way to write that in longhand math that I can better understand?

Hopefully you'll forgive me for not being able to decipher the formula you've offered. I never had an opportunity to take any math classes past the eighth grade, schools in LA were pretty overcrowded in the `70s...


Edited by billstephenson (02/17/12 03:09 PM)
Edit Reason: clarification
_________________________
--

"You want to go where?"



Top
#162379 - 02/17/12 04:30 PM Re: Dumb question on GPS [Re: billstephenson]
squark Offline
member

Registered: 03/14/11
Posts: 66
Loc: SF bay area, CA
I'm not too familiar with perl, but it seems like it should be able to handle these operations. A quick search shows me that exponents (that I write with a caret) use double asterisks **, so the length of leg 1 would be

pathlength1 = ( distance**2 + elevation**2 )**(1/2)

or in numbers
( 10.3625268966932**2 + 3.14960630400012**2 )**(1/2) = 10.8306

and then add all the lengths together to get

10.8306 + 29.8016 + 19.5599 + 4.67766 = 64.8697

Sorry if my abbreviations for square and square-root aren't familiar; I spend my days staring at equations and tend to forget that most people don't. Let me know if that doesn't help any!

Top
#162380 - 02/17/12 04:50 PM Re: Dumb question on GPS [Re: squark]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Thank you!!

I'll add that in and see what we get smile
_________________________
--

"You want to go where?"



Top
#162384 - 02/17/12 05:38 PM Re: Dumb question on GPS [Re: squark]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By squark
and then add all the lengths together to get

10.8306 + 29.8016 + 19.5599 + 4.67766 = 64.8697



That worked!

Here's what I got:

Flat Distance : 60.7402091398617
Adjusted for Terrain Distance : 64.8697213477516

That's a big difference for just 60 ft of travel, and that sample was taken from my GPS track of a hike in the hollow below my house. I did grab that small piece because it had a notable variation in elevation, so it's not an average sample, but what it shows is significant.

If anyone has a track they'd like to run through the code I'd be glad to post the results. For that matter, if anyone wants the code, I'd be glad to send it to you.

_________________________
--

"You want to go where?"



Top
#162388 - 02/17/12 06:53 PM Re: Dumb question on GPS [Re: squark]
Jimshaw Offline
member

Registered: 10/22/03
Posts: 3973
Loc: Bend, Oregon
Ummm - clearly the unit of measure used will determine the actual distance traveled. This is where CHAOS enters into the equation. Its like how many miles long is the west British coast? Now using a mm long measuring device and going around every rock and nuance, how long is it? The answer approaches infinity as the unit of measure shrinks.

A gps adds the horizontal distance between the points where it takes a data sample. If it is set to sample every minute and you meander, the distance covered will be less than if it samples every half minute, etc.

Of course the GPS will say the two waypoints are .87 miles apart. If you really did travel in a straight line up hill at 30 degrees, it would say .87 miles on its odometer - the sum of the horizontal distances between the data points.
Jim smile
_________________________
These are my own opinions based on wisdom earned through many wrong decisions. Your mileage may vary.

Top
#162399 - 02/17/12 08:55 PM Re: Dumb question on GPS [Re: billstephenson]
Barefoot Friar Offline
member

Registered: 01/23/09
Posts: 176
Loc: Houston, Alabama
Originally Posted By billstephenson
/usr/bin/perl


Linux.

/fistbump

ETA: Or should I say, l33t.


Edited by Barefoot Friar (02/17/12 08:56 PM)
_________________________
"Stand in the ways and see, and ask for the old paths, where the good way is, and walk in it; then you will find rest for your souls."

Top
#162425 - 02/18/12 12:28 PM Re: Dumb question on GPS [Re: Barefoot Friar]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Quote:
l33t

laugh

p#d

Not me though. I've bumped heads more than fists with perl 3l33tz.
_________________________
--

"You want to go where?"



Top
#162430 - 02/18/12 01:26 PM Re: Dumb question on GPS [Re: Jimshaw]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Quote:
Ummm - clearly the unit of measure used will determine the actual distance traveled.


Yep, a GPS set on it's finest grain of data collection points does not provide a very high resolution picture of what you actually hiked, and the way your milage is calculated by a GPS ignores terrain all together.

There is solid logic behind that approach and your "This is where CHAOS enters into the equation" observation is the root of it.

That logic applies best to things like maps and boats and airplanes, and works just fine for cars on roads, but it's not so good for hikers that want to know how far they actually hiked. So the little app we are working on goes as far as possible with the data available from a GPS to give a better estimate of actual boots on the ground miles.

Still, compared to the most accurate piece of technology we currently have for measuring that, the best GPS still sucks. laugh

_________________________
--

"You want to go where?"



Top
#162431 - 02/18/12 01:38 PM Re: Dumb question on GPS [Re: wandering_daisy]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By wandering_daisy
There may be some GPS units that have a chip inside that converts, thus allowing you to choose how you want distance presented. I suspect most do not simply because there appear to be many different ways to calculation depending what you want to measure. Anyway Gershon needs to look in his manual and see if there is a setting that allows one or the other.


I'm not aware of one that does that, but companies like Garmin are pretty responsive to users, and if one requested a "Miles Hiked" feature that accounted for elevation I'm pretty sure they'd add it. If they added it to their "BaseCamp" software it'd be free and backwards compatible with their hardware, and it'd be a feature that'd hit their target market for that product.

On their hardware, they could add it with a software update, and if they kept only a running total they could obtain a much finer degree of accuracy while using little processing power or storage space.

I suggest we suggest it! wink
_________________________
--

"You want to go where?"



Top
#162439 - 02/18/12 03:13 PM Re: Dumb question on GPS [Re: billstephenson]
wandering_daisy Offline
member

Registered: 01/11/06
Posts: 2865
Loc: California
The wheel has its own problems on really rock trails.

Wow! What a discussion. I learned a lot. And I am not even a GPS user.

Top
#162445 - 02/18/12 06:00 PM Re: Dumb question on GPS [Re: wandering_daisy]
Gershon Offline
member

Registered: 07/08/11
Posts: 1109
Loc: Colorado
deleted by op


Edited by Gershon (02/19/12 06:26 AM)
_________________________
http://48statehike.blogspot.com/

Top
#162488 - 02/19/12 02:17 PM There's an app for that, Re:Dumb question on GPS [Re: Gershon]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Okay, with the help of BZH, squark, and others I don't know, I made and posted a simple app that attempts to answer the question of "How far, including the terrain, did I really hike?"

You can find it with some sparse instructions on how to use it here:

http://navigraphic.com/cgi-bin/navigraphic/CalcMilesHiked.pl

I used a data file created by my Garmin Oregon 200 that was imported into Garmin's BaseCamp software and then exported using the "Tabbed Text" option. I tried to make it as easy as I can, but you still have to open the file and delete some non-track related text that Garmin puts in there before you upload it to the app, and there can't be any blank lines in the file.

For some reason it bombs out on larger data files. The error points to code I didn't write, and I haven't figured out what's causing it yet. I might look for some other code to replace those routines to see if that helps.

I've went over the math and logic this app uses as best I can. I'd be glad to provide the code to anyone that wants it. There is a demo file linked that you can download, review, and then upload to test the app with.

What's most striking to me right out of the box is not the difference in how far I hiked in the mountains as compared to flat ground, though that is notable, but how many feet up and down I hiked.

When I compare my numbers to what Garmin's "BaseCamp" gives for the "Ascent" and "Decent" numbers, there is a big difference.

I simply check to see if you went up or down on a given leg of a track and keep a running total of both. I don't know how they calculate it.

Now, I want to offer this...

I think for our purposes, and for the purpose to best describe what kind of hike a trail will be, the numbers that matter are how far you walked horizontally, and how far you climbed vertically, both up and down.

The reason I think these are the important numbers is because you have to physically move your body that far in those directions.

I think that measuring the angle between the two (distance and elevation) does not truly represent how your body moved, or the exertion required to move it.

The app attempts to provide those numbers too.

_________________________
--

"You want to go where?"



Top
#162502 - 02/19/12 07:42 PM Re: There's an app for that, Re:Dumb question on GPS [Re: billstephenson]
oldranger Offline
member

Registered: 02/23/07
Posts: 1735
Loc: California (southern)
In the old days, we just ran a trail wheel along the route, and let it go at that. If you were counting paces, there was a formula for adding/dropping paces depending upon whether you were ascending or descending.

But I must say, the original question posed by the OP is far from "dumb;" I can't even begin to comprehend some of the subsequent posts. Does Google have an online Sanskrit translator?

Top
#162523 - 02/20/12 03:38 PM Re: There's an app for that, Re:Dumb question on GPS [Re: oldranger]
Jimshaw Offline
member

Registered: 10/22/03
Posts: 3973
Loc: Bend, Oregon
I'm lookin at my Garmin 301 and I have maximum elevation, minimum elevation, total ascent, total descent, average ascent, average descent, odometer, movin time and movin average. I assume that "average" refers to velocity. I doubt that the odometer or movin average take into account elevation, especially since there are 6 other fields dedicated to it, but I could be wrong - happened once before. wink

This is all fun stuff and progress is great but if you want to quantify an up and downhill hike are you assuming that the trail is uniform and steepness does not matter? Certainly a gradual uphill hike culminating with a scramble up a talus pile to the top and then say onto snow to an overlook is going to be harder to quantify... is there a seasonal algorythme? Icey trail at the top say vs dry near the TH?

Like you can say 5 miles with 800 feet of up and 500 feet of down with some easy rocks near the top, and 57 switchbacks. OR maybe you could say that the trail has a meander coeficient of .23 and will require 57,000,000 ergs of energy per pound of hiker/pack...

Just funnin ya smile
_________________________
These are my own opinions based on wisdom earned through many wrong decisions. Your mileage may vary.

Top
#162527 - 02/20/12 04:51 PM Re: There's an app for that, Re:Dumb question on GPS [Re: Jimshaw]
JAK Offline
member

Registered: 03/19/04
Posts: 2569
When post-holing can you add on the distance into and out of the post-holes?

Top
#162549 - 02/21/12 11:14 AM Re: There's an app for that, Re:Dumb question on GPS [Re: Jimshaw]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By JimShaw
This is all fun stuff and progress is great but ....


It really is mostly just for fun, and you're right, you really can't measure a hike in a way that will describe it any detail at a glance.

Still, I think there is a value in the knowledge gained by studying topo maps, graphs, and mileage and elevation numbers. Like most things you count, you must have some real world experience in order for the numbers to have real value and meaning.

We all have some experience so trying to get some value and meaning out of the numbers a GPS records can be worthwhile. Let's look at some and see what we can learn at a glance.

The numbers below are extracted from the same GPS track I linked to on the web app, I rounded them off.


========================
Distance

GPS Distance : 1.49 (miles)

Adjusted Distance : 1.55 (miles)

Difference : 298 (feet)

========================
Elevation

Total Up : 749 (feet)

Total Down : 806 (feet)

Total Elevation Change : 1555 (feet)
========================


Everybody looks at the "GPS Distance" number first. All that number says to me is that this hike is like walking about 1.5 miles on flat ground.

Now let's look at the "Difference", and the "Total Up" and "Total Down" numbers and think about what they mean.

To me they mean I also have to climb the equivalent of 750 ft up, and 800 feet down, and I'll make it about an extra 2 feet forward for every 10 feet I climb.

Experience leads me to believe that hike must have some pretty steep spots, and at the least, I'll want more water than if I were just hiking 1.5 miles on flat ground.
_________________________
--

"You want to go where?"



Top
#162563 - 02/21/12 04:47 PM Re: There's an app for that, Re:Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
Sorry Bill, I didn't participate in the conversation over the long weekend. (I wish I could say I was hiking but I can't use that excuse). It sounds like you got your math questions answered. Let me know if you have some lingering questions. I didn't quite understand the problem you ran into with your subroutine. I know a bit about coding but I don't know the language you are using. Let me know if I can help further.

p.s. it looks like your question on powers was answered, but I just wanted to add: from a programming perspective it is more efficient to program "x^2" as "x*x" instead of "x**2". It probably won't make any difference for your program, but I thought I would pass along one of the few nuggets of wisdom I have on programming.

Top
#162567 - 02/21/12 08:20 PM Re: There's an app for that, Re:Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Originally Posted By BZH
Let me know if you have some lingering questions


It'd be great if you all would go over the math and logic. I've uploaded the script and linked it to the app. Here's the link to get it.

On that test GPS data I'm not convinced yet that I'm not counting some legs twice. Those "Total Up" and "Total Down" numbers look too high to me. I've went over them several times (and I've hiked that track) so I may be missing something.

I even set the app up to print out the sums for each leg of data but I still didn't see it. If there is no elevation gain or loss it doesn't add or subtract anything.

I suspect, but I'm not sure, that if the lat/long is unchanged (you are standing still), but the elevation is different (as a result in variations in how my GPS calculates elevation), then it does add or subtract the difference. If that's the case, it shouldn't, and I should write a test to see if the lat/longs are the same and skip over that leg. Not all GPS units would register a change, some have a built-in altimeter. Mine, I think, estimates elevation with the satellite signals, so it varies quite a bit when you're standing still.

_________________________
--

"You want to go where?"



Top
#162890 - 02/27/12 08:03 PM Re: There's an app for that, Re:Dumb question on GPS [Re: billstephenson]
BZH Offline
member

Registered: 01/26/11
Posts: 1103
Loc: Madison, AL
The code looks good. If it is reporting too much elevation gain/loss then I guess I have to agree with you that it is do to adding elevation errors while you are standing around.

You could skip points with small distance changes, what might be better would be to skip points where the elevation is greater than the distance change. That would be walking up a slope greater than 45°. I guess anyway you do it, you might have to play around with the limits on your filter until you get good results.

Top
#162972 - 02/28/12 06:43 PM Re: Dumb question on GPS [Re: squark]
BarryP Offline
member

Registered: 03/04/04
Posts: 1574
Loc: Eastern Idaho
“I used to get in fights with my boyfriend when his GPS distance didn't match the distance I estimated from the map. Nice to have some backup on why. …”

Well, a more major error is keeping your GPS in your shirt pocket or hanging around your neck. Some funny things happen with antennas next to your body. I finally got more accurate readings by putting the GPS in the backpack’s far outside pocket.

-Barry

Top
#162984 - 02/28/12 09:41 PM Re: There's an app for that, Re:Dumb question on GPS [Re: oldranger]
OregonMouse Offline
member

Registered: 02/03/06
Posts: 6760
Loc: Gateway to Columbia Gorge
I agree with oldranger--we need a translator for this thread!

Which is why I don't have a GPS!
_________________________
May your trails be crooked, winding, lonesome, dangerous, leading to the most amazing view--E. Abbey

Top
#163106 - 03/01/12 11:50 PM Re: There's an app for that, Re:Dumb question on GPS [Re: BZH]
billstephenson Offline
Moderator

Registered: 02/07/07
Posts: 3917
Loc: Ozark Mountains in SW Missouri
Quote:
You could skip points with small distance changes, what might be better would be to skip points where the elevation is greater than the distance change. That would be walking up a slope greater than 45°. I guess anyway you do it, you might have to play around with the limits on your filter until you get good results.


Thanks BZH.

I think you're right, skipping points where the elevation is greater than the distance change is probably the way to filter it.

If I make it so we can adjust the limits on the distance change and elevation change we can probably fine tune it so it ignores mostly redundant data that contains variations on the same location.

I might be wrong, but it looks like BaseCamp might be rounding off the lat/longs before they compare them for distance. If you're looking for matches that would increase the number you'd find pretty quickly the more you rounded them. I might try that too.
_________________________
--

"You want to go where?"



Top
Page 1 of 3 1 2 3 >

Shout Box

Highest Quality Lightweight Down Sleeping Bags
 
Western Mountaineering Sleeping Bags
 
Lite Gear Talk - Featured Topics
Boil in a bottle?
by DustinV
07/23/21 06:29 PM
Gas Stove Vs Wood Stove Cooking System Comparison
by walkingnatur
07/19/21 07:52 AM
smartwater vs bladder for water
by nwguy
07/15/21 03:45 PM
Backcountry Discussion - Featured Topics
Is it dangerous to burn lantern fuel in the open?
by 4evrplan
07/26/21 02:21 PM
Feeling young again in our National Parks
by 41253
07/17/21 07:49 AM
How we take a Warm Shower in the Wilderness?
by walkingnatur
07/03/21 04:17 PM
Make Your Own Gear - Featured Topics
Carrying My Dog LOL
by Hey
07/07/21 09:20 PM
Featured Photos
Spiderco Chaparral Pocketknife
David & Goliath
Also Testing
Trip Report with Photos
Seven Devils, Idaho
Oat Hill Mine Trail 2012
Dark Canyon - Utah
Who's Online
0 registered (), 106 Guests and 0 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Hassan Tamur, Sheener, JOYAL, Mblandry211, Jan H
13045 Registered Users
Forum Links
Disclaimer
Policies
Site Links
Backpacking.net
Lightweight Gear Store
Backpacking Book Store
Lightweight Zone
Hiking Essentials

Our long-time Sponsor, BackcountryGear.com - The leading source for ultralite/lightweight outdoor gear:

Backcountry Forum
 

Affiliate Disclaimer: This forum is an affiliate of BackcountryGear.com, Amazon.com, R.E.I. and others. The product links herein are linked to their sites. If you follow these links to make a purchase, we may get a small commission. This is our only source of support for these forums. Thanks.!
 
 

Since 1996 - the Original Backcountry Forum
Copyright © The Lightweight Backpacker & BackcountryForum