Hi Chris
>
> First, I'd like to hear more about your project -- I've been meaning to 
> integrate FloatCanvas with GDAL/OGR as well -- I'd love to see what 
> you've done.
>
>   
I'd be happy to send you some code, however its very messy at the 
moment, so I'll send it once I've tidied it up a bit :)
>   
>> I have changed it to a 'canvas'.ZoomToBB( 
>> self.bounding_box), but I get the following error
>>     
>> File 
>> "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/lib/floatcanvas/FloatCanvas.py",
>>  
>> line 2706, in ZoomToBB
>>     self.ViewPortCenter = N.array (((BoundingBox[0,0]+BoundingBox[1,0])/2,
>> AttributeError: MapCanvas instance has no attribute '__getitem__'
>>
>> where MapCanvas is the python class I've written.
Turns out I passed in self explicitly by accident.  So I was calling 
ZoomToBB(self,self.bounding_box), and because ZoomToBB can take three 
parameters, it wasn't obvious.  For anyone working with the bounding 
box, it is important to be aware that you are working with pixel 
coordinates.  This had me confused for a bit when I was trying to use 
the pixel-based bounding box with data in world coordinates!

Cheers, Sam
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to