#! /bin/sh

DB=${3:-geoville}

echo "Computing path from $1 to $2 in $DB"

cd $GEOHOME/demos/geoville

/bin/rm oids_out

monitor -TN -c "retrieve (the_oid= Road.oid, frompnt= PointSelector(Road.geo_pln2, 1),topnt= PointSelector(Road.geo_pln2, -1), length= Length2Pln(Road.geo_pln2))" $DB | \
$GEOHOME/analyses/cpath $1 $2

monitor $DB << EOF

delete PathOids \g
copy PathOids from "$GEOHOME/demos/geoville/oids_out" \g

EOF

