1

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.

3
  • Did you ever get this to work? I just got this error. Commented Dec 20, 2014 at 2:01
  • 1
    Doc error - you can't use lat/lon, you have to use llcrnrx, llcrnry, etc.
    – mankoff
    Commented Dec 20, 2014 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
    Commented Apr 14, 2015 at 9:12

1 Answer 1

1

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 and acknowledge you have read our privacy policy.

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