Jump to content

  • Recently Browsing   0 members

    No registered users viewing this page.


Filtering waypoints by distance from location

Recommended Posts

I have some huge waypoint files and at least one of my GPS units only handles 2000 at a time.  I found that google earth and basecamp both don't support rubber band selection of waypoints on the map.  You can multi-select on the list, or ctrl-click one at a time but no rubber banding.  I wanted to share some USGS survey points with a group I'll be riding with next saturday, so I figured I'd make a program to do the work.

Operation is simple, enter lat/long for your center point.  Enter the radius in kilometers.  Select a folder than has one or more KML files (no KMZ or GPX support at this time as you can save to KML from just about anything).

Click the 'Filter KML files' button and let it rip.   It will output all waypoints from the KML files that are within a circle defined by the radius and center point you provided, the resulting KML is saved to FILTERED.kml in the same directory that you were processing files.

There is very little error checking, and I wouldn't say it's all that user friendly.  It will not ever modify your source files, but will overwrite FILTERED.kml if you run multiple times.

If there's interest and requests for enhancements/features/bug fixes let me know. Program can be run from anywhere, doesn't require admin privileges.  Windows only for now, only tested on Win7 so no clue about others ;-)



And here's the program.... 


Share this post

Link to post
Share on other sites

great circle, using https://en.wikipedia.org/wiki/Haversine_formula

And not doing any conversion, as far as I know KML files are always decimal lat/long.. one thing I did notice is that some software differs on the order of lat/long in coordinates:


it's typically long/lat however I've read that some software does it the other way.  I check if the latitude is < -90 or > 90 I swap the numbers.  Not perfect.. but should suffice.



Share this post

Link to post
Share on other sites
1 hour ago, David A. Wright said:

You lost me at "rbber banding" ... :25help:  B)

click-drag to select an area/text..etc..  it's like you're stretching a rubber band 'around' items on the screen.. perhaps an obscure term...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Who's Online   0 Members, 0 Anonymous, 25 Guests (See full list)

    There are no registered users currently online