Skip to content

Quick Download by Coordinates - #5

Open
idbnstra wants to merge 2 commits into
stiles:mainfrom
idbnstra:quickly-dl-nearest
Open

Quick Download by Coordinates#5
idbnstra wants to merge 2 commits into
stiles:mainfrom
idbnstra:quickly-dl-nearest

Conversation

@idbnstra

@idbnstra idbnstra commented Apr 25, 2026

Copy link
Copy Markdown

Summary

This PR introduces a streamlined way to download Street View panoramas using coordinates directly, without requiring a Google Maps URL. It adds a new --quick (-q) flag and individual --lat/--lng options to the main download command.

Rationale

Previously, downloading by coordinates was a two-step process:

  1. Use streetview-dl query to discover panoramas and generate a URL file.
  2. Use streetview-dl --batch to download from that file.

While the query command is excellent for discovery and exploration, some users might just want the closest panorama to a specific point. This PR provides a "fast path" for that use case.

Key Features

  • --quick / -q option: Accepts a "lat,lng" string (e.g., -q 42.5,-94.1).
  • --lat / --lng options: Separate flags for easier programmatic use in scripts.
  • Auto-Discovery: Automatically fetches metadata for the nearest panorama within a search radius (default 50m) and proceeds to download it at the requested quality.
  • Unified Logic: The process_location function now handles both URL-based and coordinate-based inputs, ensuring all filters, cropping, and quality settings work identically for both modes.

Changes

  • streetview_dl/cli.py:
    • Added new options to the main command.
    • Refactored process_single_url into process_location to handle coordinates.
    • Updated help text to distinguish between "Quick Download" and "Discovery (Query)".
  • README.md:
    • Added a "Quick Download by Coordinates" section to the Quick Start guide.
    • Clarified the use cases for query vs. --quick.
  • tests/test_cli.py:
    • Added test_cli_quick_option to verify correct argument parsing and logic branching.
    • Added test_cli_quick_option_invalid_format to verify error handling for malformed coordinate strings.

Usage Examples

# Quick download using the new shortcut
streetview-dl --quick 42.5052692,-94.1860801 --quality high

# Using separate flags
streetview-dl --lat 42.5052692 --lng -94.1860801 --output my_spot.jpg

Related Subcommand

The query command remains the primary tool for:

  • Discovering multiple panoramas in an area.
  • Viewing capture dates and distances before downloading.
  • Generating batch URL lists for large-scale sampling.

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.

1 participant