#! /bin/sh

set -v

monitor -c 'remove view nearbig' geo

monitor -c 'define view nearbig (cities.name,cities.geo_loc,cities.population,dist=cities.geo_loc <=> bigcity.geo_loc,bigname=bigcity.name,bigloc=bigcity.geo_loc,bigpop=bigcity.population) where (bigcity.geo_loc <=> cities.geo_loc) < 40.0 and bigcity.name != cities.name' geo

echo "Building nearbigrel, this takes a while..."

monitor -c 'destroy nearbigrel' geo

monitor -c 'retrieve into nearbigrel (nearbig.all)' geo
