Note: This page describes the development version of GPSBabel. It may substantially differ from the latest released GPSBabel.

Include Only Points Within Radius (radius)

This filter includes or excludes waypoints based on their proximity to a central point. All waypoints more than the specified distance from the specified point will be removed from the dataset.

By default, all remaining points are sorted so that points closer to the center appear earlier in the output file.

Example 4.4. Using the radius filter to find points close to a given point

This example command line would include only points within 1 1/2 miles of N30.000 W 90.000

gpsbabel -i geo -f 1.loc -x radius,distance=1.5M,lat=30.0,lon=-90.0 -o mapsend -F 2.wpt


lat option

Latitude for center point (D.DDDDD).

This option is required.

This option specifies the latitude of the central point in decimal degrees. South latitudes should be expressed as a negative number. Valid values for this option are from -90 to 90.

lon option

Longitude for center point (D.DDDDD).

This option is required.

This option specifies the longitude of the central point in decimal degrees. West longitudes should be expressed as a negative number. Valid values for this option are from -180 to 180.

distance option

Maximum distance from center.

This option is required.

This option specifies the maximum distance a point may be from the central point in order to remain in the dataset. Points closer than this distance will be kept and points further away will be removed (unless the exclude option is specified.)

Distances may be expressed in miles (3M) or kilometers (4K). If no units are provided, the distance is assumed to be in miles.

exclude option

Exclude points close to center.

If this option is included, the action of the radius filter will be reversed: points within the given distance will be removed, and points further away will be kept.

nosort option

Inhibit sort by distance to center.

If this option is specified, the radius filter will not sort the remaining points by distance from the center. They will remain in whatever order they were originally.

maxcount option

Output no more than this number of points.

This option specifies the maximum number of points that the radius filter may keep. If there are more than this number of points within the specified distance of the center, the more distant points will be discarded even though they are within the specified distance. If this option is not specified, all points are kept regardless of how many there are.

Note that if the nosort option is also specified, this option will instead keep points based on their position within the input file rather than on their distance from the center. This may or may not be what you want.

Note, too, that this option may be used with the exclude option, but the results might not be what you expect. In particular, the results will not be the same as if you had kept all of the points you'd otherwise throw away. You will still get no more than maxcount points, but they will all be at least distance away from the center. (And possibly sorted.)

asroute option

Put resulting waypoints in route of this name.

This option specifies the name of a route. If this option is specified, the radius filter puts all points that are kept into a route with the given name. The order of points in the route is by distance from the center (unless the nosort option is also specified.)

Note that this route is not necessarily the most efficient route to visit all of the points. In fact, for some data sets, it might be the least efficient route.