logo separator

[mkgmap-dev] HGT - getElevation()

From Andrzej Popowski popej at poczta.onet.pl on Wed Jan 10 12:33:32 GMT 2018

Hi Frank and Gerd,

 > It's a little bit more to calculate

The actual code is quite simple, it is 3 times linear interpolation:

double hxt = (1.0D - qx)*hlt + qx*hrt;
double hxb = (1.0D - qx)*hlb + qx*hrb;
return (1.0D - qy)*hxb + qy*hxt;

 > i would be very defensive with interpolation in the case of
 > missing values.

I got the same feeling. The best way to fill voids is to process whole 
HGT. And I believe that DEM providers already have done it, so any 
attempt at simple extrapolation would rather add errors than make output 
better. In my code I preserve voids. If requested coordinates are near 
void HGT node, then returned value is void.

-- 
Best regards,
Andrzej


More information about the mkgmap-dev mailing list