useful script for beginners

John Carlson carlson14 at llnl.gov
Tue Mar 28 20:53:12 PST 2000


I too has the same problem with extents and setting up
my first map file.  I used dump.pl, but that didn't help
enough, so I wrote a perl script:

#!/usr/local/bin/perl

use mapscript;

# replace water with the name of your shape file
$file = "water";

$shapefile = new shapefileObj($file, -1) or die "Unable to open shapefile 
$file";

$ro = new rectObj();

$result = $shapefile->getExtent(-1, $ro);

print "$ro->{minx} $ro->{miny} $ro->{maxx} $ro->{maxy}\n";




More information about the MapServer-users mailing list