diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2017-01-14 00:32:05 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2017-01-14 00:32:05 +0100 |
commit | 30bb1cfeb8d781bb503fb49ca9b43d90e9d1d7d1 (patch) | |
tree | 35800ea805035fd1dbe66fe1ba1c0a5629502774 | |
parent | 8465584bcaf32d251f0fca544668ca847d0288e1 (diff) |
Fix compatibility with Geo::GDAL and Geo::OSR 2.1.2.
-rwxr-xr-x | mkindex.pl | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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 ); |