Skip to content

Add Bulawayo suburb boundary generation scripts#71

Merged
roy-bme merged 1 commit into
claude/blackmass-corporate-website-caGTRfrom
claude/update-zone-boundaries-QCqOW
May 11, 2026
Merged

Add Bulawayo suburb boundary generation scripts#71
roy-bme merged 1 commit into
claude/blackmass-corporate-website-caGTRfrom
claude/update-zone-boundaries-QCqOW

Conversation

@roy-bme
Copy link
Copy Markdown
Owner

@roy-bme roy-bme commented May 11, 2026

Summary

Add Python scripts to generate and manage GeoJSON boundary polygons for Bulawayo suburbs. These scripts provide multiple approaches to populate zone boundaries in the database, from realistic hardcoded coordinates to external API integrations.

Key Changes

  • create_bulawayo_boundaries.py: Main script that generates realistic GeoJSON polygon boundaries for 28 Bulawayo suburbs based on known geographic coordinates. Each suburb is defined by corner coordinates (SW, SE, NE, NW) that create rectangular boundary polygons. Generates SQL UPDATE statements for the zones table.

  • create_zone_boundaries.py: Alternative approach that creates approximate rectangular polygons around center coordinates for all zones. Provides a simpler fallback method when precise boundaries aren't available.

  • update_zone_boundaries.py: Integration script that queries the Nominatim/OpenStreetMap API to fetch real boundary data for suburbs. Includes rate limiting and error handling for API requests.

  • fetch_boundaries_overpass.py: Experimental script for querying the Overpass API as an alternative data source for suburb boundaries.

  • zone_updates.sql: Generated SQL file containing UPDATE statements to populate the boundary_geojson column in the zones table with polygon geometries.

Implementation Details

  • All scripts properly handle non-suburb zones (CBD Core, Wholesale Corridor, etc.) by skipping them and keeping placeholder values
  • Coordinates are defined in [longitude, latitude] format as per GeoJSON specification
  • Polygons are closed by repeating the first coordinate at the end
  • Scripts generate detailed progress output and summary statistics
  • SQL injection protection via quote escaping in generated SQL statements
  • Rate limiting implemented for external API calls (1.1 second delays)
  • Comprehensive error handling and reporting for failed boundary lookups

https://claude.ai/code/session_013TGgkurXskHqWinMTnTLKS

…lygons

- Fetch all 35 zones from Supabase and identify non-suburb zones (CBD Core, CBD/Sauce Town, etc.)
- Create rectangular polygon boundaries for 30 standard suburbs based on their coordinates
- Skip 5 non-suburb zones (commercial/transit areas) to keep placeholders
- Apply migration to update boundary_geojson column in zones table
- Include Python scripts for boundary generation (for future refinement)

Zone boundaries now more accurately represent actual suburb areas on the Indaba map.

https://claude.ai/code/session_013TGgkurXskHqWinMTnTLKS
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blackmasswebsite Ready Ready Preview, Comment May 11, 2026 0:06am

Request Review

@supabase
Copy link
Copy Markdown

supabase Bot commented May 11, 2026

This pull request has been ignored for the connected project ipqmdinidqpmchggjdov because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@roy-bme roy-bme merged commit 88deed3 into claude/blackmass-corporate-website-caGTR May 11, 2026
3 of 4 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.

2 participants