Skip to content

Interactive visualization of Sydney street names and patterns

Notifications You must be signed in to change notification settings

pqzdev/sydney-streets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

119 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Australian Capital Cities Street Names

Interactive visualization of street names and patterns across Australia's capital cities, featuring advanced street counting algorithms.

Live Demo | Research Methodology

Overview

This project visualizes street data across Australia's capital cities to explore interesting patterns in street naming:

  • Most popular street names (counted using Grid 200m algorithm)
  • Streets named after suburbs
  • Tree-themed street names
  • Royalty-themed street names
  • Geographic clustering of name patterns
  • Compare naming patterns across different cities

Currently Available Cities

  • Sydney - Greater Sydney (33 LGAs, NSW Government definition)
  • Melbourne - Greater Melbourne (31 LGAs, Victorian Government definition) 🚧 Coming soon
  • Brisbane, Perth, Adelaide, Hobart, Darwin, Canberra - Planned

Geographic Scope: Each city uses official government definitions of "Greater [City]" boundaries. See SCOPE.md for the complete list of LGAs and sources.

Street Counting Methodology

A key challenge in this project is counting unique instances of streets. When "Victoria Street" appears in OpenStreetMap data, how do we know if it's one street or multiple distinct streets that share a name?

We researched and compared 5 different algorithms to solve this problem:

  1. Point-to-Point Distance: Check if any points on segments are within threshold distance
  2. Grid-based Flood Fill: Divide map into grid cells and flood fill connected regions ⭐ Winner
  3. Polygon Buffer Intersection: Create buffer polygons and check for intersections
  4. Endpoint-Only Distance: Only check distances between segment endpoints
  5. Highway-Aware: Hybrid method for handling long highways with gaps

Winner: Grid 200m + Flood Fill

After extensive testing on 23 streets across Sydney:

  • 224x faster than Point-to-Point method (0.028s vs 6.28s)
  • Equivalent accuracy to geometric methods
  • Scalable to large datasets
  • Simple implementation with no external dependencies

Read the full research: METHODOLOGY.md

Interactive Tools:

Data Sources

NSW Government Data (Primary)

  • Source: Data.NSW Road Segment Data
  • Format: GeoJSON with street polylines and metadata
  • Coverage: Complete NSW road network
  • Attributes: Road names, types, suburbs, geometries

OpenStreetMap (Alternative)

  • Source: Overpass API
  • Format: GeoJSON
  • Query: Streets within Sydney bounding box
  • Note: Used for methodology research

Getting Started

Running Locally

  1. Clone the repository:
git clone https://github.com/pqzdev/sydney-streets.git
cd sydney-streets
  1. Start a local server:
python3 -m http.server 8000
open http://localhost:8000
  1. The visualization will load with sample OSM data

Running Method Comparisons

To reproduce our research findings:

# Install dependencies
pip install shapely scipy numpy

# Run comparison on test streets
python3 scripts/compare_methods.py

# Generate summary tables
python3 scripts/generate_summary_table.py

# View results
open compare_visualization.html
open summary.html

Project Structure

sydney-streets/
β”œβ”€β”€ index.html                  # Main visualization
β”œβ”€β”€ app.js                      # Application logic
β”œβ”€β”€ compare_visualization.html  # Method comparison tool
β”œβ”€β”€ summary.html                # Results summary table
β”œβ”€β”€ METHODOLOGY.md              # Research write-up
β”œβ”€β”€ SCOPE.md                    # Geographic scope documentation
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ compare_methods.py          # Algorithm implementations
β”‚   β”œβ”€β”€ generate_summary_table.py   # Summary generator
β”‚   β”œβ”€β”€ process_full_dataset.py     # Grid 200m processing script
β”‚   β”œβ”€β”€ download_osm_data.py        # OSM data downloader
β”‚   └── add_suburbs.py              # Suburb data processing
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ sydney-roads-osm.geojson           # OSM street data
β”‚   β”œβ”€β”€ sydney-roads-sample.geojson        # Sample data for testing
β”‚   β”œβ”€β”€ method_comparison.json             # Comparison results
β”‚   β”œβ”€β”€ method_comparison_detailed.json    # Detailed results
β”‚   └── summary.json                       # Summary statistics
└── README.md                   # This file

Features

Main Visualization

  • Interactive Map: Pan, zoom, and explore Sydney streets
  • Smart Counting: Grid 200m algorithm for accurate street instance counts
  • Filter by Name: Search for specific street names
  • Category Views:
    • Most common names
    • Streets named after suburbs
    • Tree-themed streets
    • Royalty-themed streets
  • Statistics: Real-time stats on visible streets and patterns
  • Popups: Click streets for detailed information

Research Tools

  • Method Comparison: Compare up to 4 algorithms side-by-side on any street
  • Summary Table: View all results, timing data, and disagreement analysis
  • Disagreement Visualization: See where methods differ with 1km radius markers

Technology Stack

  • Leaflet.js: Interactive map library
  • OpenStreetMap: Base map tiles
  • Vanilla JavaScript: No frameworks, minimal dependencies
  • GeoJSON: Geographic data format
  • Python: Algorithm implementation and testing
    • NumPy/SciPy: K-D tree and spatial operations
    • Shapely: Geometric polygon operations

Key Findings

From our methodology research:

Method Speed Accuracy Best For
Grid 200m ⚑⚑⚑ (224x) ⭐⭐⭐ Production use
Grid 100m ⚑⚑⚑ (170x) ⭐⭐⭐ Dense urban areas
Polygon Buffer 100m ⚑⚑ (2.8x) ⭐⭐⭐ Geometric accuracy
Point-to-Point 100m ⚑ (1x) ⭐⭐⭐ Baseline/validation
Highway-Aware ⚑⚑⚑ ⭐⭐⭐ Long highways

Perfect highway counting: Our Highway-Aware method correctly identifies Pacific Highway (722 segments) as 1 instance, while all other methods incorrectly counted it as 5 instances.

Deployment

This site is deployed on Cloudflare Pages:

Live Site: https://australian-streets.pages.dev/

To deploy your own version:

  1. Fork this repository
  2. Connect to Cloudflare Pages via the dashboard
  3. Set build settings:
    • Build command: (none - static site)
    • Build output directory: /
  4. Your site will be live at https://your-project.pages.dev/

Performance

Counting 23 test streets (3,956 total segments):

  • Grid 200m: 0.028 seconds
  • Grid 100m: 0.037 seconds
  • Polygon Buffer: 2.26 seconds
  • Point-to-Point: 6.28 seconds

Backend API Architecture (NEW!)

To overcome Cloudflare Pages' 25MB file size limit and enable Melbourne support, we've built a backend API:

Why Backend API?

Problem:

  • Sydney: 43.4MB β†’ compressed to 24.4MB (fits, but reduced precision from ~11m to ~111m)
  • Melbourne: 72.1MB β†’ compressed to 39.6MB ❌ (15MB over limit)

Solution:

  • Cloudflare Worker + D1 (SQLite) database
  • Full coordinate precision (5+ decimals)
  • Viewport-based loading (only fetch visible streets)
  • No file size limits
  • Scalable to any city

Features

  • API Endpoints: Get counts, search streets, fetch by viewport bounds or name
  • Hybrid Mode: Toggle between static files (current) and API mode (future)
  • Progressive Enhancement: Static mode works without backend

See BACKEND_API.md for architecture details and DEPLOYMENT.md for setup instructions.

Future Enhancements

  • Backend API for scalable data delivery
  • Complete Melbourne backend deployment
  • Viewport-based progressive loading
  • Add more name categories (historical figures, animals, etc.)
  • Heat map of name popularity
  • Street length analysis by category
  • Export filtered results as GeoJSON
  • Mobile-optimized interface
  • Real-time method comparison on main map

Contributing

Issues and pull requests welcome! Areas of particular interest:

  • Additional street categorization patterns
  • Performance optimizations for large datasets
  • Alternative counting algorithms
  • UI/UX improvements

License

MIT

Acknowledgments

Citation

If you use this methodology in your research:

Sydney Streets Project (2025). Street Instance Counting Algorithms for OpenStreetMap Data.
GitHub: https://github.com/pqzdev/sydney-streets
Methodology: https://pqzdev.github.io/sydney-streets/METHODOLOGY.html

About

Interactive visualization of Sydney street names and patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •