logo separator

[mkgmap-dev] DEM: performance with bicubic interpolation

From Gerd Petermann gpetermann_muenchen at hotmail.com on Tue Jan 23 13:51:55 GMT 2018

Hi Andrzej,

I think this code is optimized for the case that you use fillArray() once and calculate the interpolation with
multiple different combinations of qx + qy.
When you use e.g. a 3'' hgt file with dem-dists=9936,... this happens rarely. When you use the same file with dem-dists=2000
this algo is probable faster if we detect the cases where we can reuse the class and the filled array, but such a value doesn't
 make sense. Maybe it is also faster for a value like 4971 (9942/2), I did not try that because I thought that one should try to be close to the hgt res.

See also http://www.paulinternet.nl/?page=bicubic
where I found the simple code that is now used. It also offers a variant similar to the one from Ken Perlin.

I'll try later if this code really improves throughput when users specifies small values for dem-dists.
If that is not much faster I'd prefer to keep the rather simple code that is used now
and rather tell the user that the dem-dists value is too small.
To be honest, I am not sure if any value that is much smaller than the hgt resolution makes sense,
as it just blows up DEM with interpolated values, but maybe I don't understand the math enough.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej at poczta.onet.pl>
Gesendet: Dienstag, 23. Januar 2018 13:22:01
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] DEM: performance with bicubic interpolation

Hi Gerd,

there are different kind of bicubic interpolations. I'm not good at this
math, I think the previous version was actually bicubic spline
interpolation. See other possibilities here:
http://mrl.nyu.edu/~perlin/cubic/Cubic_java.html

I don't know, which type of spline or cubic interpolation is best for
DEM. Maybe differences aren't big, but I think it is better to have good
interpolation than fast one. You compile a map once but then many people
can use it.

It shouldn't be difficult to include an option like:
--dem-interp=..

--
Best regards,
Andrzej



_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list