Tuesday, August 29, 2006

Property Bar location using GPS (and Visual FoxPro) Part I

I worked on this project back in the spring of this year (2006). What I was trying to do was find property bars on our property using GPS. When you're out in the forest, it is very tough to keep yourself oriented properly. Looking for a bar that way is like looking for a needle in a haystack. Your best chance to find one is to trip over it.

The idea to use GPS in aiding the search sprung from other projects where I used a GPS to do location logging, plus the fact that there are supposed to be some property bars in our forest which have yet to be found. Now, knowing exactly where our property line is is not that big a deal, just curiosity really, but still. There's an area, particularly in the southwest corner, where I'd like a bit more clarity as to who owns what. It seems funny that this whole area was surveyed about 8 years ago, but now not even 1 bar is to be found anywhere...looks like somebody would rather not have them found.

Anyway, the general idea is as follows:

- have a property plan
- have a computer program where you can enter the azimuths of the various lines that constitute the property limits as well as the distances between the various points where these lines intersect.
- have the computer plot this plan so that the plot is oriented properly with respect to true north.
- take a GPS and have the computer track and log the information received.
- program the computer so it can establish a latitude/longitude position for anyone of the points of intersection of the plan (a 'bench mark' position)
- program the computer so it, given the latitude/longitude position of anyone of these points, can calculate the lat/long of all the other points on the property line.
- program the computer, so it can plot the current position of the GPS on the above plan.
- program the computer, so it can 'home' in on a certain point, with a computer voice telling you in what direction the to-be-found point is and how far off we are.
- program the computer, so it can provide an average plot of the last number of GPS readings

First off: what is azimuth? This is the direction of a line, measured clockwise around the observer's horizon from north. So an object due north has an azimuth of 0°, one due east 90°, south 180° and west 270°. There, that was easy.

You can tell there was a fair bit of programming involved. The GPS logging stuff I had already done for my previous efforts, so that was re-used. To display the various plots, I used a free ActiveX control called NTGraph. Since we are now looking at Microsoft Vista, the name NTGraph will be more than enough to scare off some people. Not me. I've used it for a number of projects and, although a bit quirky at times, it is certainly very stable and very flexible.

Surprisingly enough, to calculate the lat/long of Point B, given the distance and azimuth to it from Point A, is fairly complex. A fellow by the name of Victor Fraenckel wrote a Visual Basic program to do this. His program was based on T. Vincenty's article "Direct and Inverse Solutions on the Ellipsoid with Application of Nested Equations" as published in Survey Review, April1975. In this article, Mr. Vincenty stated that "In selection a formula for the solution of geodesics it is of primary importance to consider the length of the program, that is the amount of core it will occupy in the computer along with trigonomic and other required functions." Obviously, the term "software bloat" was still to be invented.

Anyway, I rewrote Vic's VB program into a Visual FoxPro library. Then I added the interface around the various parts. But more on that soon....

No comments: