summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2017-01-14 00:32:05 +0100
committerGuilhem Moulin <guilhem@fripost.org>2017-01-14 00:32:05 +0100
commit30bb1cfeb8d781bb503fb49ca9b43d90e9d1d7d1 (patch)
tree35800ea805035fd1dbe66fe1ba1c0a5629502774
parent8465584bcaf32d251f0fca544668ca847d0288e1 (diff)
Fix compatibility with Geo::GDAL and Geo::OSR 2.1.2.
-rwxr-xr-xmkindex.pl11
1 files 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 );