Files
garmin-img-format-parsing/stage-2-parse-stage-1/readme.md
T

93 lines
2.7 KiB
Markdown
Raw Normal View History

2026-04-14 16:48:13 -07:00
Updated script:
2026-04-17 02:17:49 -07:00
[landmarks_stage2_configurable_v4.py](sandbox:/mnt/data/landmarks_stage2_configurable_v4.py)
2026-04-14 16:37:10 -07:00
2026-04-17 02:17:49 -07:00
What’s added:
2026-04-14 16:37:10 -07:00
2026-04-17 02:17:49 -07:00
* `edit-config` now supports:
2026-04-14 16:37:10 -07:00
2026-04-17 02:17:49 -07:00
* `--run-cmd-before-eval`
* `--run-cmd-zoom`
* global default postprocess tags:
* `analyze --default-postprocess-tag key=value`
* `edit-config --default-postprocess-tag key=value`
* interactive group review now has a preview loop:
* `Enter` / `e` = edit current group
* `n` = next example
* `p` = previous example
* `o` = run external visualizer again on current example
* `s` = skip group
* `!` = stop editing
* global `defaults.postprocess` is stored in the same config file and applied to all groups during build, then group-specific postprocess overrides it
Important placeholder support for `--run-cmd-before-eval`:
* `{lat}`
* `{lon}`
* `{z}`
* `{mapset}`
* `{group_id}`
* `{group_label}`
* `{raw_type}`
* `{name}`
So your GPXSee command can be written like this:
2026-04-14 16:37:10 -07:00
2026-04-14 16:48:13 -07:00
```bash
2026-04-17 02:17:49 -07:00
python landmarks_stage2_configurable_v4.py edit-config ^
--config stage2_config.json ^
--run-cmd-before-eval ".\GPXSee.exe D:\maps-bg\gmapsupp\gmapsupp.img \"geo:{lat},{lon};z={z}\"" ^
--run-cmd-zoom 19
2026-04-14 16:37:10 -07:00
```
2026-04-17 02:17:49 -07:00
If you want every detected group to get a visible fallback tag by default:
2026-04-14 16:37:10 -07:00
2026-04-14 16:48:13 -07:00
```bash
2026-04-17 02:17:49 -07:00
python landmarks_stage2_configurable_v4.py analyze export-v7-00235051.csv ^
--config-out stage2_config.json ^
--default-postprocess-tag tourism=attraction
2026-04-14 16:37:10 -07:00
```
2026-04-17 02:17:49 -07:00
or while editing an existing config:
2026-04-14 16:37:10 -07:00
2026-04-14 16:48:13 -07:00
```bash
2026-04-17 02:17:49 -07:00
python landmarks_stage2_configurable_v4.py edit-config ^
--config stage2_config.json ^
--default-postprocess-tag tourism=attraction ^
--run-cmd-before-eval ".\GPXSee.exe D:\maps-bg\gmapsupp\gmapsupp.img \"geo:{lat},{lon};z={z}\""
2026-04-14 16:37:10 -07:00
```
2026-04-17 02:17:49 -07:00
Then build as usual:
2026-04-14 16:37:10 -07:00
2026-04-14 16:48:13 -07:00
```bash
2026-04-17 02:17:49 -07:00
python landmarks_stage2_configurable_v4.py build export-v7-00235051.csv ^
--config stage2_config.json ^
--osm resolved.osm ^
--gpx resolved.gpx ^
--resolved-csv resolved.csv
2026-04-14 16:37:10 -07:00
```
2026-04-17 02:17:49 -07:00
I also verified the non-interactive path:
2026-04-14 16:37:10 -07:00
2026-04-17 02:17:49 -07:00
* `analyze` runs successfully
* default global postprocess tags are written into the generated config
2026-04-14 16:37:10 -07:00
2026-04-17 02:17:49 -07:00
One important detail:
2026-04-14 16:37:10 -07:00
2026-04-17 02:17:49 -07:00
* the global default postprocess is now stored under:
* `defaults.postprocess.add_tags`
* `defaults.postprocess.remove_tags`
* build applies those to **all groups**, then applies group-local `postprocess`
That gives you exactly the pattern you asked for:
* visualize example
* inspect the symbol in GPXSee
* decide naming / icon / tags
* move to next example in the same group
* keep everything in the same config file
The next strong upgrade would be adding a dedicated `--run-cmd-before-eval-on-enter/--no-auto-open` toggle, so you can choose whether each group auto-opens the first example or only opens when you press `o`.