useful script for beginners

John Carlson carlson14 at llnl.gov
Tue Mar 28 23:53:12 EST 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