multiple rasters && mapview
Bernhard Herzog
bh at intevation.de
Fri Jan 14 22:13:40 CET 2005
Jonathan Coles <jonathan at jpcoles.com> writes:
> when i first implemented the raster code i discovered that the bounding
> box of the projected image is different (usually larger) than the
> bounding box returned from layer.LatLongBoundingBox(). this is because
> the image may curve outward between the two extreme x points, but the
> extreme of the outward curve is not recognized as the extend of the
> bounding box.
[...]
> if you can figure out how to correctly determine the projected bounding
> box size, then i think you will be able to a) decrease the rendering
> time since gdal isn't making an image for the whole window and b) easily
> allow for multiple raster layers without using masks.
It can't be done properly without masks because as you note the boundary
of the projected image is not rectangular. It usually has curved edges
and even if it were rectangular, it's may not be axis aligned. The only
way to draw that properly while only drawing the part of the window
actually covered by the projected image is to return an image with an
appropriate alpha channel or a mask bitmap in addition the actual image.
The strategy I used in Skencil 0.6 is to have one raster image, let's
call it C for "canvas") the size of the window. When a raster image is
to be rendered, it is rendered into C while also determining which
pixels are actually covered by the rendered image. The image may be
transformed with an arbitrary affine transformation, so the region
covered often isn't a simple axis aligned rectangle, although it's not
as complicated as the case Thuban has to handle. The image C is reused
for every raster image so that it doesn't have to be allocated over and
over again. It should be possible to do something similar in Thuban.
Bernhard
--
Intevation GmbH http://intevation.de/
Skencil http://skencil.org/
Thuban http://thuban.intevation.org/
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)