#!/usr/bin/perl =pod =head1 NAME updatemap.pl - update map of regions for Club register =head1 SYNOPSIS updatemap.pl =head1 DESCRIPTION The script searches for latitudes and longitudes of CHGK regions and outputs them superimposed on the world map. The world map is taken from the gnuplot distribution. Then the script outputs an include file for register.cgi(1) =head1 AUTHOR Boris Veytsman =head1 DATE $Date: 2001/10/13 23:39:44 $ =head1 REVISION $Revision: 1.2 $ =cut use strict; use DBI; my $dbh; $dbh = DBI->connect("DBI:mysql:chgk", "piataev", "") or die ($dbh->errstr); my $width=640; my $height=320; my $offset=160; ####################################################### # Opening the files ####################################################### open (INCLUDE, ">regions.html"); open (GNU, ">regions.gnu"); open (DAT, ">regions.dat"); print GNU < END ########################################################## # Writing clubs coordinates ########################################################## my $sth = $dbh->prepare (" SELECT rid,Name,Lon,Lat from Regions where NOT ISNULL(Lat) and NOT ISNULL(Lon)"); $sth->execute; while (my ($rid,$Name,$Lon,$Lat) = $sth->fetchrow_array) { print DAT < END } ########################################################## # Finishing up ########################################################## print INCLUDE < Карта клубов END print GNU < regions.gif`; exit 0;