#! /bin/sh
# Master script to create a geoville database from scratch.

set -v

DB=${1:-geoville}
GINA=gina

# Initialize (convert GINA to Postgres data)
$GEOHOME/demos/geoville/gv2init.pq $DB

# Define special Geo data types in Postgres
$GEOHOME/geo-ext/loadgeo-aux $DB
$GEOHOME/geo-ext/loadgeo-ext $DB

# Convert Postgres spatial data types to Geo data types
$GEOHOME/demos/geoville/gv2geo-ext.pq $DB

# Define special colors for gv2
$GEOHOME/demos/geoville/gv2colors.pq $DB

# Define some views
$GEOHOME/demos/geoville/gv2view.pq $DB

# Define some indices
$GEOHOME/demos/geoville/gv2index.pq $DB

# Define the dynamic display information
$GEOHOME/demos/geoville/gv2-dyn-info.pq $DB

# Define the shortest path view and menu
$GEOHOME/demos/geoville/gv2spath.pq $DB

monitor -c "vacuum" $DB
