As I think about this a bit more, the way to do it would be to build an ind=
ex of bounding rectangles for each county in the US.. Then, given a particu=
lar wapoint, you'd only have to "test" a couple of counties shapefiles (usi=
ng gpsbabel) or you own code to determine whether a given waypoint was with=
in the polygon.
If I remember my graphics programming class (about 20 years ago), to determ=
ine if a point lies within a bounding regular polygon, one simple extends a=
ray in an arbitrary direction (usually verticle). If this ray crosses the =
bounding poly an odd number of times, the point is WITHIN the poly. An even=
number of times, and the point is OUTSIDE the poly. Or something like that.
Robert, is that how gpsbabel does polygons?
On Wed, 26 Apr 2006 10:49:38 -0500
"Mike Hostetler" <hostetlerm@...> wrote:
> On 4/26/06, Richard Mikalsen <richard@...> wrote:
> > Hello!
> > Is it possible to use gpsbabel for finding information like state and c=
ounty, just by giving it one specific location?
> > An example: Give gpsbabel the location: 59.2219 10.2166, and you get na=
me of the state and county the location is in.
> > Can I use gpsbabel to do this, or does anybody know of a program (for *=
NIX) that is capable of doing so?
> Sorta. You have to grab the gpsbabel-data package from the download
> page on SourceForge. That contains State and County information in
> arc format. (Thanks Ron Parker!).
> This is an example from a script that I use to see if a geocache is in
> a county in my metro area.
> gpsbabel $gpxfiles $locfiles \
> -x stack,push,copy \
> -x polygon,file=3D"$countydir/Nebraska/31-055-Douglas-(County).txt",exclu=
> -x polygon,file=3D"$countydir/Nebraska/31-177-Washington-(County).txt",ex=
> -x polygon,file=3D"$countydir/Nebraska/31-153-Sarpy-(County).txt",exclude=
> -x polygon,file=3D"$countydir/Nebraska/31-155-Saunders-(County).txt",excl=
> -x polygon,file=3D"$countydir/Nebraska/31-025-Cass-(County).txt",exclude \
> -x polygon,file=3D"$countydir/Iowa/19-155-Pottawattamie-(County).txt",exc=
> -x polygon,file=3D"$countydir/Iowa/19-129-Mills-(County).txt",exclude \
> -x polygon,file=3D"$countydir/Iowa/19-085-Harrison-(County).txt",exclude \
> -x stack,pop,append \
> $filterTossDups \
> -i gpx -f omaha.gpx \
> $filterUnique \
> -o gpx -F omaha.gpx
> To do what you want to, you'd have to test all the states and then
> perhaps the county in that script. Messy, but doable.
> Mike Hostetler
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job ea=
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> Gpsbabel-misc mailing list
> To unsubscribe, change list options, or see archives, visit: