gc_area/README.md
2023-08-27 13:44:15 +02:00

1.2 KiB

gc_area

Python3 scripts to filter geocaches bounded to a certain area. The area is an OpenStreetMap "relation" consisting of ways that make up the area. This OSM relation is then converted to a polygon. The polygon is then used to determine whether a geocache lies within the area or not.

Usage

Prerequisites

  1. Determine the OpenStreetMap relation ID. To do this, go to openstreetmap.org and search for your area.
  2. Create a GPX file containing at least all geocaches in the area. You can do this by simply going to the Geocaching website, creating a filter and add filtered geocaches to a list. Then go to your lists page and download the GPX file for this list.
  3. Install the required Python3 packages:
pip install -r requirements.txt

Using the Scripts

  1. Create the polygon describing your area (replace <osm-relation-id> with your ID):
$ python3 create_polygon.py <osm-relation-id>

For more options, see python3 create_polygon.py --help.

  1. Filter out any geocaches outside this area (replace with your GPX file and with desired result GPX file):
$ python3 gc_area.py <input-file> <output-file>

For more options, see python3 gc_area.py --help.