logo separator

[mkgmap-dev] HGT - getElevation()

From Gerd Petermann gpetermann_muenchen at hotmail.com on Tue Jan 9 19:12:23 GMT 2018

Hi Andrzej,

the patch keeps my simple code for an arithmetic mean if interpolatedHeight returns UNDEF:
                if (rc == HGTReader.UNDEF) {
                        int sum = 0;
                        int valid = 0;
                        int[] heights = { hLT, hRT, hLB, hRB };
                        for (int h : heights) {
                                if (h == HGTReader.UNDEF)
                                        continue;
                                valid++;
                                sum += h;
                        }
                        if(valid >= 2)
                                rc = Math.round((double)sum/valid);
                }
I think this should be removed?

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej at poczta.onet.pl>
Gesendet: Dienstag, 9. Januar 2018 19:10:15
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] HGT - getElevation()

Hi Gerd,

I have prepared a patch with bilinear interpolation, which supports
missing values. It can restore single missing value, but if more values
are missing it simply returns the nearest value without interpolation.

--
Best regards,
Andrzej


More information about the mkgmap-dev mailing list