Astan Chee wrote:

I would like to zoom to a bounding box with the following bounds:
min x = 1079
min y = 878
max x = 1244
max y = 2956
This is how I'm doing it in floatcanvas:

bounding_box = BBox.asBBox([[minX,minY],[maxX,maxY]])
navCanvas.ZoomToBB(bounding_box)

Is this correct? For some reason, it doesn't scale the height (2078) and width (165) correctly. it seems that the box's height and width have to be the same or it scales to whichever is largest. Is there a way to scale it accordingly so that the height and width aren't scaled like this?

Be default, the scale (ratio of world to pixel coords) on the height and width are the same, so that when you ZoomToBB, it zooms to the scale that will fit the entire BB you pass in.

If you want to have different scales for height and width (X and y) you need to give FloatCanvas as "projection" that scales them differently.

Enclosed is an example of how to do that. (It's also in the Demos dir in SVN)

it might be nice to ahve a utility function that could do this from a bounding box of something, too -- contributions excepted!

-Chris





--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

Attachment: ScaleDemo.py
Description: application/python

_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to