Skip to content
Advertisement

Plot .tif GDAL raster using matplotlib Basemap

I have a bit of code from here that I am using for plotting a geotiff image (Landsat):

JavaScript

But, it fails at ct.TransformPoints(xy_source.reshape(2, size).T)) and I’m not sure why. The error it gives me:

TypeError: in method ‘CoordinateTransformation_TransformPoints’, argument 1 of type ‘OSRCoordinateTransformationShadow *’

Which I do not understand. Any OSR guru’s out there?

Thanks for reading.

EDIT 1 The projection of my .TIFF

JavaScript

Also,

JavaScript

Advertisement

Answer

The solution is to install the proj4 package. Otherwise, the input projection is not understood by osr.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement