moving LatLongBoundingBox?

Russell Nelson nelson at crynwr.com
Mon Dec 20 15:43:23 CET 2004


Bernhard Herzog writes:
 > Russell Nelson <nelson at crynwr.com> writes:
 > > They both do the same thing, and both classes are derived from
 > > BaseLayer, so shouldn't it be defined in BaseLayer?
 > 
 > That would probably be better.  What do we do about BoundingBox()?
 > Implement it in BaseLayer too with the default implementation simply
 > returning None?

Sure.  I can conceive of a layer which wouldn't have a BoundingBox,
e.g. a 1:20000 map of an entire UTM zone.  You wouldn't want it
counted in the Extents calculation, so returning None would be the
right thing to do.

Either that, or make BoundingBox a pure base class and raise NotImplemented.
But returning None makes more sense and gets handled properly down the road.

 >     - Comparisons to singletons like None should always be done with
 >       'is' or 'is not'.  Also, beware of writing "if x" when you
 >       really mean "if x is not None" -- e.g. when testing whether a
 >       variable or argument that defaults to None was set to some other
 >       value.  The other value might be a value that's false in a
 >       Boolean context!

Hrm.  Well, I guess I was wrong!  Learn Something New Every Day
(LSNED).

-- 
--My blog is at angry-economist.russnelson.com  | Freedom means allowing
Crynwr sells support for free software  | PGPok | people to do things the
521 Pleasant Valley Rd. | +1 315-323-1241 cell  | majority thinks are
Potsdam, NY 13676-3213  | +1 212-202-2318 VOIP  | stupid, e.g. take drugs.




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)