Skip to content

feat: paginate AMS API + default to grid sampling (#157) - #158

Merged
koito19960406 merged 1 commit into
mainfrom
feat/ams-grid-pagination
Jul 1, 2026
Merged

koito19960406 merged 1 commit into
mainfrom
feat/ams-grid-pagination

Conversation

@koito19960406

Copy link
Copy Markdown
Owner

Summary

Two changes to AMSDownloader, both backed by the grid-vs-OSM benchmark:

  1. Paginate _get_raw_pids — the Amsterdam panorama API returns ~25 results/page with a _links.next link; the old code took only the first page. Now follows next to collect all pages. Live-verified: a dense query goes from 25 → 650 panos. This is the dominant AMS coverage lever.
  2. Default to grid sampling (grid=True, grid_size=50) instead of OSM street-network — grid sampling is constant ~3 s vs Overpass's variable 7–83 s, and street(drive) only reached 30% recall for AMS at 250 m. grid=False stays available.

Verification (local)

  • New tests/test_ams_pagination.py (no-network): pagination follows next, stops on empty page, and the grid defaults are asserted — 3 passed.
  • Live: _get_raw_pids returns 650 panos (was 25) at a dense Amsterdam point.

Minor version bump to 1.7.0.

Note: assumes GSV PR #156 (1.6.0) merges first; if merge order differs, only the version line needs adjusting. pr-checks gate is satisfied (tests/ changed).

Closes #157

🤖 Generated with Claude Code

The Amsterdam panorama API paginates (~25/page); _get_raw_pids read only the
first page, so dense areas were massively under-collected (a test point reports
650 panos but returned 25). Follow _links.next to collect all pages — verified
25 -> 650 at one point.

Also default download_svi to grid sampling (grid=True, grid_size=50) instead of
the OSM street network: benchmarking showed street sampling is 3-25x slower and
erratic (Overpass) with poor recall (street(drive) ~30% at 250m). grid=False
remains available. Adds no-network unit tests. Minor version bump to 1.7.0.

Closes #157

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@koito19960406
koito19960406 force-pushed the feat/ams-grid-pagination branch from b3bf639 to 3f16f73 Compare July 1, 2026 07:54
@koito19960406
koito19960406 merged commit b27b559 into main Jul 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AMSDownloader: paginate API results + default to grid sampling

1 participant