Files
2026-04-14 16:48:13 -07:00

2.2 KiB
Raw Permalink Blame History

Done.

Updated script: landmarks_csv_to_osmand_v2.py

What changed:

  • default dedupe is now coordinate-based only

  • dedupe is modular:

    • coord
    • coord_name
    • coord_type
    • coord_name_type
    • off
  • dedupe uses a meter radius instead of naive decimal rounding

  • duplicates are merged, not just dropped

  • merged records keep:

    • best name
    • richer semantic tags
    • union of GPXSee classes
    • source file list
    • duplicate count
  • grouping is improved:

    • --group-by auto
    • --group-by category
    • --group-by type
    • --group-by source
  • automatic grouping now distinguishes things like:

    • amenity_drinking_water
    • natural_spring
    • place_village
    • fallback Garmin or GPXSee groups
  • interactive group naming added:

    • --interactive-group-names
    • shows sample examples from each detected group
    • lets you keep or rename the proposed group name
  • loader is now tolerant of both:

    • the raw landmark CSVs
    • the slimmer per-category CSVs you are iterating through
  • .gpx.gz, .osm.gz, .json.gz, .csv.gz now actually get gzip-written correctly

Useful commands:

Show detected groups with examples:

python landmarks_csv_to_osmand_v2.py *.csv --show-groups

Interactive rename flow:

python landmarks_csv_to_osmand_v2.py *.csv --show-groups --interactive-group-names --group-by auto --gpx landmarks.gpx

Tighter coordinate dedupe:

python landmarks_csv_to_osmand_v2.py *.csv --dedupe-mode coord --dedupe-radius-m 6 --gpx landmarks.gpx

Coordinate dedupe, but only merge when type also matches:

python landmarks_csv_to_osmand_v2.py *.csv --dedupe-mode coord_type --dedupe-radius-m 10 --gpx landmarks.gpx

Water-only overlay:

python landmarks_csv_to_osmand_v2.py *.csv --filter-tag amenity=drinking_water --gpx drinking_water.gpx

Springs-only overlay:

python landmarks_csv_to_osmand_v2.py *.csv --filter-tag natural=spring --gpx springs.gpx

If you want the next revision, Id push it further in two directions:

  • add dedupe reports showing which rows got merged into which canonical landmark
  • add interactive split/merge controls for ambiguous groups, not just rename controls