CopyShape.pl

From Wildsong
Revision as of 22:09, 12 April 2006 by Brian Wilson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#
# Copy a shapefile
#
use strict;
use Geo::Shapelib qw/:all/;

# The files
my $input_file  = '/cygdrive/c/BRIANS_JUNK/PERL/garmin_wp_nad27';
my $output_file = '/cygdrive/c/BRIANS_JUNK/PERL/copy';

my $shape  = new Geo::Shapelib $input_file; # Load entire file into memory

# Write it out with the new name.
$shape->save($output_file);

# Copy the projection file as well.
system("cp", "$input_file.prj", "$output_file.prj");