Showing posts with label data-analysis. Show all posts
Showing posts with label data-analysis. Show all posts

Wednesday, November 6, 2013

GPS Accuracy

GPS is a truly amazing technology. I mean, here's a every-day technology that relies on the relationship between space and time that we wrap up in the theories of relativity and special relativity. Wow.

But not to worry, that's not what this post is all about. I have four devices that incorporate GPS in some way and I'd like to compare the relative accuracy of the four. I'd also like to know which one is most accurate and what conditions alter that accuracy level.

The four devices that I'm evaluating:
  • A Garmin eTrex Venture HC hand-held GPS - (from 2009, now discontinued, but similar models are available for around $125, see the Garmin eTrex 10, 20, 30)
  • A Magellan Explorist 210 (from roughly 2002, long ago discontinued)
  • A Samsung Charge smart phone (2.5 year old Android smart phone)
  • A Canon Powershot sx260HS camera with built-in GPS

The testing was done under ideal GPS operating conditions;
  • Clear skies
  • In the middle of a large open area with no obstructions
  • Plenty of time for each device to lock signals from as many GPS satellites as possible
The Basic Test
My testing will consist of recording latitude and longitude pairs from each device at known locations so that the coordinates returned by the devices can be compared with the actual coordinates. So how am I finding these "known locations"? I'm using Google Earth to zoom in on an easily recognized location near my home. I then add placemarkers in GE and view the coordinates that GE assigns to those placemarkers. So, yes, there are assumptions being made. For one, I'm assuming that the coordinates I obtain from Google Earth are trust worthy and two I'm discounting (for now) any discrepancies that might come from the use of different coordinate systems by the devices involved.

The location for the testing is a square wading pool (82 feet on a side) located in a “quad” complex in the Saratoga Spa State Park inSaratoga Springs, NY. Figure One shows a screen capture of the pool as it appears in Google Earth. Figure two shows the pool with more of the surrounding area visible to provide context. I made three circuits of the pool stopping at each corner and recording the location with each of the four devices. I then averaged the latitude and longitude values for each each device to obtain a single location per device. These coordinates were used to add points markers to Google Earth and I could then use the Google Earth measuring tool find the distance between the locations provided by each device and the reference location. Those measurements are shown in Table One.



Wading Pool in Saratoga Spa State Park as seen in Google Earth. GPS fixes were obtained at each of the four corners. The image on the right shows the wading pool in context.
*

Figure One



Garmin
Magellan
Phone
Camera
Difference between GPS location and GE coordinates in Feet
8
6
25
10
Difference between the GPS elevation and elevation obtained from Google Earth
1
10
94
20
No. of satellites registered by each device
(after minimum 5 minute warmup)
10
8
10
?
Table One


The averaged results are in line with what I expected. The Garmin and Magellan GPS units produced results within the expected accuracy level of 10 feet. The camera was nearly as accurate, but the phone was accurate to 25 feet at best, and it appears to be off by about 50 feet for a typical single reading. This may be by design. You can use the phone to provide information on your location to others in real-time and being really accurate might not be desirable. This is just a guess and I'm sure that GPS accuracy varies widely among models.
Also worth noting is that the three coordinate sets obtained from the dedicated GPS devices were consistent with the overall accuracy level provided by the devices (falling with a circle with the location at the center and a radius of 15 feet). The locations obtained from the camera and the phone were much more variable with both devices providing some fixes that were hundreds of feet away from the actual locations (more on this later).

In addition to the latitude/longitude values representing the location, GPS devices also able to provide a measurement of the elevation relative to sea level. I recorded and averaged these elevations and Table One includes the comparisons of the calculated elevation with the elevation that Google Earth shows at that place. That reference elevation provided by Google Earth was compared with a nearby USGS benchmark and the benchmark value differed from the Google Earth value by just 2 feet.

The elevation measurements provide additional insights into the accuracy of the devices. The calculation of elevation using GPS requires that a signal be obtained from at least 3 satellites (as opposed to a minimum of two for the location only). Given that all of these devices were able to lock signals from 8 to 10 satellites I would expect the devices to provide accurate elevations, but, historically, elevation measurements made by GPS have tended to be less accurate and less reliable (for various reasons). The two GPS devices and the camera worked well under the ideal conditions of this testing, but the phone GPS was off by close to 100 feet on average.

Overall, the Garmin GPS performed best, but that is mostly a question of convenience. The Garmin is typically ready to go within 30-60 seconds and the Magellan unit commonly needs several minutes to lock signals from a full complement of satellites. The Garmin uses a far superior antenna technology but, this is no surprise, the Magellan unit is over 10 years old (a newer Magellan would probably be similar). Both GPS units and the camera provide geographic references that can used for a variety of purposes. The next question I want to consider is precision. What does it mean to say that a lat/lng pair are within 10 feet of the "actual" value. There's more to it than you might think.

Saturday, September 7, 2013

Pattern and Process: Why put a city there?

Maps make geographic patterns visible. Later posts will discuss other ways to look for patterns in data but, when the data has a geographic context, maps help us see patterns in that data. So let's look at some maps. The points in Figure 1 (below) represent a set of locations. Do you recognize a pattern? Do you know what these points and lines represent?



Figure 1 

How about now?



Figure 2


That should make it clear (at least for Americans). The points represent the locations of towns and cities and the lines are rivers and streams. With the addition of the state boundaries we see that we are looking at a map of Massachusetts.

But there's an additional piece of information you don't have. The locations shown on the map are places that were settled by European colonists before the 1760s. And the color of each dot reflects the age of the settlement. A legend will help (figure 3), and this leads to geography rule of thumb #1; never trust a map without a legend.



Figure 3

The legend shows that the bright red dots represent places settled by colonists before 1637. As the color changes to orange, yellow, white and then blue, the settlement date gets closer to the present time with the latest settlement on this map coming in 1764. 

So why these places? The colonists had a lot riding on choosing good locations so what process guided the selection of settlement locations, and is there a visible pattern that helps us understand why these locations were selected. One more map, with a closer view, might help (Figure 4).


Figure 4

What you might have guessed, even without the map, is now clear. Most of the early settlement locations are near the coast and the earliest settlements are clustered in the Boston area. Boston has a good harbor and the colonists put down stakes there in 1625. 

But what about those outliers; visible in the lower right and near the bright blue line on the left? That bright blue line represents the Connecticut River. As you might know, the Connecticut River is large enough to provide a transportation corridor to the coast and at the time these settlements were founded transportation was a critical consideration. Looking at this more detailed map we see that most settlements were located on some river or stream and several obvious reasons for this come to mind. In addition to the transportation potential, flowing water provided a supply of fresh water as well as access to fish and other wildlife. So, to summarize, we see that settlements are clustered and that most were located on a river or stream.

That the settlement locations would be clustered might seem obvious but it actually illustrates an important rule when thinking about geographic data. In geography, proximity matters. Geographers even have a “law” for this (law as in “the law of gravity” not as in “the bars close at 2:00 am”). It’s called Tobler’s Law and it basically says that things that are close to each other tend to be more similar than things that are farther apart. 

On first hearing, Tobler's law makes some people wonder; "do geographers really needed a law for that"? But there’s actually a subtle and important idea embedded in this law. If being close means that things are inherently similar then data with this characteristic violates a fundamental assumption that underlies many statistical methods. That assumption is that samples taken from a larger population are independent of each other. If proximity implies that the samples are similar then that assumption is violated and many standard statistical methods cannot be used.

For example, think about the voter polls that get so much attention around election time. Pollsters can't ask every single person who might vote what his or her choice will be so they select people who are supposed to be representative of the larger population and ask those people. The two key rules are; the selected samples must be chosen at random and they must be independent of each other. If those stipulations are met then basic statistical techniques can be used to calculate the likelihood that the sample actually reflects the whole population. This is where the "margin of error" you hear about when polling numbers are reported by the press comes from. As an aside, the way the press talks about the "margin of error" is almost always wrong, which is why election polls so often seem to be wrong. But that's a story for another post. The key point is, if the individuals who were polled were not independent of each other, then the margin of error is meaningless. 

And location breaks that assumption of independence. If in a state election the pollster only calls people in one city, those people are much more likely to have similar views then people living in a different part of the state. And this gotcha applies broadly, it's not just related to how people behave. If you are looking at pollution levels in soil, or in the air, samples taken one mile apart are more likely to be the same then are samples taken 100 miles apart. Physical proximity implies similarity.

By now you might be thinking that statistics can't be used to analyze and understand data with a geographic. But that is not the case. There are many analytical and statistical methods that can be used. We need understand the rules and use them correctly. And it's not as hard as it might sound. We look for patterns and try to figure out the process. Or we think we know about a process and we want to know if there is evidence to support (or dispute) our idea. Maps are ideal for this type of analysis.