multiple rasters && mapview
Jonathan Coles
jonathan at jpcoles.com
Tue Jan 18 00:32:21 CET 2005
Am Freitag, den 14.01.2005, 22:13 +0100 schrieb Bernhard Herzog:
> 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.
i think what i had in mind about not needing a mask is different than
what you are thinking. what i meant to say was, if you are simplying
trying not to have gdal generate a large image that covers the screen,
and are content to have a smaller image that may contain patches of "no
data" pixels, then it isn't necessary to use a mask, just a better
bounding box.
i agree with you, however, that a mask (or alpha channel) is necessary
to get a "tight" image where there are no "no data" pixels.
> 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.
i'm sending out a email in a few minutes that discusses a solution. gdal
warp actually supports "no data" and i can tell DrawBitmap what color to
consider the mask color. apply the patches and run the
iceland_sample_raster to see what i mean.
--jonathan
--
=====================================================================
Jonathan Coles http://www.jpcoles.com
jonathan at jpcoles.com GnuPG Key: /gpg_pub_key.asc
=====================================================================
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)