On Saturday, 15. November 2008 20:53:42 [EMAIL PROTECTED] wrote:
> Hi, Oliver
>
> >>> Another topic is to optimize the copy action of the elevation data.
> >>> It's less a question of how to do it, more one of who is doing it.
> >>> Either way, me or you, is ok for me. It's just important to assign it
> >>> to one, to avoid double work.
> >>
> >> I want investigate this task. I have some ideas and need make some
> >> experiments.
> >
> > Ok, it's yours. I will ammuse myself with stacking raster, vector and DEM
> > layers this weekend. Need to find a good concept for that.
>
> I'm create first version of the optimization patch. It's draft only, but
> reflect the main idea: "get elevation of all points and make one request
> of RasterIO".

Hi Andrew,

just my 2 cents from looking over the patch:

I would have done the API a bit different by passing a buffer to 
IMap::getElevation(). Of course you need some additional data like the buffer 
dimensions,  topLeft, bottomRight and step size in meter for x and y. By that 
you can get the elevation matrix with one single call. And you can allocate 
the buffer on the stack instead on the heap with new/delete. I don't like new 
and delete on simple objects as this is prone to memory leaks. 

To let RasterIO do the interpolation might be a good idea. It will do it fast. 
But I don't think it does a good one. If you do an overzoom into a raster map 
you will notice that the pixels will get squares and these squares just get 
larger. That won't fit for elevation data. A 90m SRTM data will become like 
stairs on a 1m resolution map. The interpolation you disabled (float ele = 
w.c1 * e[0] + w.c2 * e[1] + w.c3 * e[2] + w.c4 * e[3];) will do better. 

But maybe RasterIO recognize the special character of the DEM data and applies 
a better interpolation. It's worth a try. 

Just for the records: Contour shading does quite the same. It just does not 
look as staircasey because the array is smoothed by a lowpass filter. But it 
would have been too bad to derive the elevation value from it. That is why I 
made this 4 point interpolation. Once we can interpolate a whole region fast, 
I will use it for shading. That should make much better results. 

I can't apply the patch locally as my source tree is on hiatus for Garmin typ 
file implementation. But I will try after that.

Oliver







-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QLandkarte-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkarte-users

Reply via email to