Skip to main content

Database Overview

The VanSafe database is a comprehensive collection of geospatial data designed to support safe caravan travel across Australia. It combines official government data, community-contributed information, and proprietary datasets to provide comprehensive route planning capabilities.

Architecture

Platform: Supabase (PostgreSQL + PostGIS) Total Records: ~610,000+ records Coverage: All Australian states and territories

Data Collections

Road Network (Phase 1)

  • 4,318,470 road segments from Geoscape National Roads
  • Complete Australian road network with classifications
  • Updated quarterly from government sources
  • PostGIS geometry for spatial queries

Safety Data (Phases 2-3)

Road Hazards

  • 56,742 road hazards from OpenStreetMap
    • 22,719 narrow passages
    • 18,364 unsealed roads
    • 13,818 water crossings
    • 1,175 low clearances
    • 345 steep grades

Bridge Restrictions ✅ Complete

  • 116,668 road restrictions from NHVR and state governments
    • 101,333 NHVR national network restrictions
    • 6,540 Victoria road bridges
    • 3,158 Western Australia structures
    • 2,000 Queensland state bridges
    • 1,314 ACT bridge assets
    • 1,170 Tasmania load limits
    • 1,153 NSW vertical clearances
    • 15,958+ restrictions affecting caravans

See Bridge Restrictions for details.

Fuel Stations ✅ Complete

  • 7,429 unique fuel stations across Australia
    • 3,074 town-based stations (Loclie)
    • 4,355 highway/rural stations (OpenStreetMap)
    • Coverage of all major highways and remote areas
    • 142% increase from initial dataset

See Fuel Stations for details.

Points of Interest

  • 8,142 towns with population data
  • 56,588 amenities (toilets, schools, healthcare, emergency services)

Elevation Data (In Progress)

  • 4.3 million road segments being processed
  • SRTM 90m Digital Elevation Model
  • Elevation profiles and road grades
  • Steep grade identification for caravan safety

See Elevation Processing for details.

Database Package

The database package is located at packages/database/ and contains:

  • Migrations: SQL schema definitions in supabase/migrations/
  • Import Scripts: Data collection tools in scripts/
  • Documentation: Comprehensive guides for each data category

Key Features

PostGIS Spatial Queries

  • Efficient spatial indexing for location-based queries
  • Distance calculations (find hazards within 10km of route)
  • Geometric operations (route intersection with hazard zones)
  • Bounding box queries for map viewport

Data Sources

Official Government

  • Geoscape: Australian road network
  • NHVR: Heavy vehicle regulations
  • Transport Departments: State-specific bridge data (NSW, VIC, QLD, WA, TAS, ACT)
  • Australian Government: Town boundaries and amenities

Community & Open Data

  • OpenStreetMap: Hazard data, fuel stations, bridge heights
  • Loclie: Town-based fuel stations
  • SRTM: Elevation data

Proprietary

  • VanSafe user-contributed data (future)

Documentation Structure

Bridge Restrictions

Fuel Stations

Elevation Data

Implementation Phases

Other Resources

Quick Start

cd packages/database

# Set up environment
cp .env.example .env
# Add your Supabase credentials

# Run migrations
npm run db:migrate

# Import bridge restrictions
npm run db:import-nhvr-restrictions
npm run db:import-all-state-bridges

# Import fuel stations
npm run db:import-fuel-stations-loclie
npm run db:import-fuel-stations-osm

# View database status
npm run db:summary

Status

Complete ✅

  • Road network import (4.3M segments)
  • Bridge restrictions (116,668 records from 6 states + NHVR)
  • Fuel stations (7,429 comprehensive coverage)
  • Amenities import (56,588 POIs)

In Progress 🔄

  • Elevation data processing (4.3M segments)

Planned ⏳

  • Live traffic integration
  • Weather data integration
  • Mobile coverage maps
  • User-contributed data