#! /bin/sh

set -v

DB=ned

destroydb $DB

createdb $DB

$GEOHOME/geo-ext/loadgeo-ext $DB

# Create some GEO sugar tables

$GEOHOME/postgres/makecolors $DB

$GEOHOME/postgres/makepredefs $DB

$GEOHOME/postgres/makeregexp $DB

$GEOHOME/postgres/makemenu $DB

$GEOHOME/postgres/makeicons $DB

$GEOHOME/postgres/makedyninfo $DB

monitor $DB << EOF

create borders(geo_pline=path)\g

create buildtop(kode=int4, geo_pgn2=POLYGON2) \g

append geo_dyninfo (relname="buildtop",relattr="geo_pgn2",
   bboxattr="None", dynfunc="make_pgn2_shape",
   dynfile="$GEOHOME/geo-ext/Geo2Shapes.o", the_oid="None")\g

copy borders from "$GEOHOME/demos/netherlands/borders.copy" \g

EOF

monitor -c "append geo_menu(dynfile=\"$GEOHOME/dynamic/ColorBg.o\", dynfunc=\"make_color_bg\")" $DB

$GEOHOME/demos/netherlands/maketopol.pq
