I'm trying to plot a GeoTIFF in Python using Basemap. I can do so correctly with cyl projection like this:

m = Basemap(projection='cyl',
            llcrnrlat=LL[1], urcrnrlat=UR[1],
            llcrnrlon=LL[0], urcrnrlon=UR[0])

But if I try to do so in the ortho projection, it does not work. I'm using this function call:

m = Basemap(projection='ortho',
            lon_0 = origin[0],
            lat_0 = origin[1],
            llcrnrlat=LL[1], urcrnrlat=UR[1],
            llcrnrlon=LL[0], urcrnrlon=UR[0])

Basemap / matplotlib crashes with the error:

AttributeError: 'Basemap' object has no attribute '_height'

If I remove the llcrnX arguments, the ortho projection works, but I see the whole globe. I guess this is OK, if I can then somehow plot my image using the corner coordinate. Basemap documentation states that the corners may be specified.

  • Did you ever get this to work? I just got this error. – Мати Тернер Dec 20 '14 at 2:01
  • 1
    Doc error - you can't use lat/lon, you have to use llcrnrx, llcrnry, etc. – mankoff Dec 20 '14 at 3:49
  • This is how it works for me [The parameters are for COMS-1 sattelite]: map = Basemap(projection='ortho', resolution='l', lat_0=36.0, lon_0=130.0, llcrnrx=-1393134.5247400326, llcrnry=-1494753.6065000296, urcrnrx=1393134.1277100428, urcrnry=1350584.3149082884) – visoft Apr 14 '15 at 9:12

This is due to a document error - you can't use lat/lon, you have to use llcrnrx, llcrnry, etc. –

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.