From 30bb1cfeb8d781bb503fb49ca9b43d90e9d1d7d1 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 14 Jan 2017 00:32:05 +0100 Subject: Fix compatibility with Geo::GDAL and Geo::OSR 2.1.2. --- mkindex.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mkindex.pl b/mkindex.pl index 085074b..6f23d68 100755 --- a/mkindex.pl +++ b/mkindex.pl @@ -267,10 +267,10 @@ GetOptions( "q|quiet" => sub { delete $config{progress} } pod2usage(2); } } - , "s_srs=s" => sub { $config{s_srs} = Geo::OSR::SpatialReference::->new(); - $config{s_srs}->SetFromUserInput( $_[1] ) } - , "t_srs=s" => sub { $config{t_srs} = Geo::OSR::SpatialReference::->new(); - $config{t_srs}->SetFromUserInput( $_[1] ) } + , "s_srs=s" => sub { my %h = ( WKT => Geo::OSR::GetUserInputAsWKT($_[1]) ); + $config{s_srs} = Geo::OSR::SpatialReference::->new(%h); } + , "t_srs=s" => sub { my %h = ( WKT => Geo::OSR::GetUserInputAsWKT($_[1]) ); + $config{t_srs} = Geo::OSR::SpatialReference::->new(%h); } , "man" => sub { pod2usage(-exitstatus => 0, -verbose => 2) } ) or pod2usage(2); @@ -567,9 +567,8 @@ sub annotate { # Inverse the transformation, so that we can convert from projected # coordinates to pixel coordinates. my $ds = Geo::GDAL::Open($filename, 'ReadOnly') or exit 1; - my ($ok,@invt) = Geo::GDAL::InvGeoTransform([ $ds->GetGeoTransform() ]); + my @invt = Geo::GDAL::InvGeoTransform([ $ds->GetGeoTransform() ]); undef $ds; - die "Error: Couldn't inverse affine transformation\n" unless $ok; my $raster = Image::Magick::->new(); $raster->Read( $filename ); -- cgit v1.2.3