multiple rasters && mapview

Jan-Oliver Wagner jan at intevation.de
Fri Jan 14 17:37:19 CET 2005


On Wed, Jan 12, 2005 at 08:59:49AM -0500, Jonathan Coles wrote:
> Am Samstag, den 08.01.2005, 02:10 -0500 schrieb Russell Nelson:
> > I'm still tracking down the problem with multiple rasters.  The
> > intrinsic problem is that ProjectRasterFile (called from
> > baserenderer.py and implemented in gdalwarp.cpp) always creates a
> > bitmap that fills the viewport.  
> 
> > The fix is going to have to be in the way ProjectRasterFile gets
> > called.  Instead of creating a BMP image, it needs to return a
> > wxImage, clipping mask, and offset.  
> 
> 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 use those values to calculate the parameters to
> ProjectRasterFile gdal generates an image which does not properly cover
> the area you want. the quick fix was to have gdal generate an image that
> covers the whole window. while obviously not ideal, this worked for a
> first attempt.
> 
> i hacked up a quick solution (disclaimer: may not work in all instances)
> that renders as little of the raster layer image as possible. however,
> as i said before, since the projected bounding box information is
> incorrect the image is not quite right. 
> 
> 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.
> 
> try the modifications to renderer.py and baserenderer.py i've listed
> below and then load the iceland_sample_raster.thuban file to see what
> i'm talking about. my code base is based on a cvs checkout from last
> night.

I've tried your patch and besides the visual effects I observed
increased instead of reduced render time. I've used the profiling
extension to measure this.

In fact, the performance dramtaically goes down the deeper I zoom
into the Iceland raster map.

> p.s. a big hello to everyone at intevation! hope you are all doing well.

Nice to read from you, Jonathan. Good to know you scan the thuban-devel
and jump up if we are talking about your code ;-)
Things are well but busy at Intevation.

Best

	Jan
-- 
Jan-Oliver Wagner               http://intevation.de/~jan/

Intevation GmbH                      http://intevation.de/
FreeGIS                                http://freegis.org/




More information about the Thuban-devel mailing list

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