Skip to content

refactor: Refactor Places Insights spot-check notebook #22

Merged
anubis05 merged 1 commit intomainfrom
refactor/spot-check-optimization
Feb 10, 2026
Merged

refactor: Refactor Places Insights spot-check notebook #22
anubis05 merged 1 commit intomainfrom
refactor/spot-check-optimization

Conversation

@henrikvalv3
Copy link
Copy Markdown
Collaborator

Summary

This PR refactors the places_insights_spot_check_results_using_functions.ipynb notebook to improve query performance, reduce API costs, and streamline the geospatial visualization workflow.

Key Changes

  • Query Optimization: Replaced the full London boundary query with a deterministic 5km radius buffer around Central London (Charing Cross) at H3 Resolution 9.
  • Code Modernization: Switched to using %%bigquery magic commands for cleaner SQL execution and GeoPandas conversion.
  • API Efficiency: Updated the Places API fetch loop to request only the necessary fields (formattedAddress, location, displayName, googleMapsUri), removing unused rating data to optimize payload size.
  • Map Logic: Centralized Google Maps Tiles API session handling (tokens, attribution, and logo assets) into a single setup cell to prevent redundant requests.
  • UX Improvements: Added "Open in Colab/BigQuery Studio" badges and updated markdown instructions to match the new logic.

… BigQuery magic, centralized map session logic, and specific field fetching
@henrikvalv3 henrikvalv3 requested a review from anubis05 February 10, 2026 18:32
@anubis05 anubis05 merged commit a657397 into main Feb 10, 2026
4 checks passed
@henrikvalv3 henrikvalv3 deleted the refactor/spot-check-optimization branch February 10, 2026 18:35
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.

2 participants