Hi Peter,

I think the only alternative to interpolation is to use the height of the 
nearest hgt point for a given DEM point.
One may minimize this distance by chosing proper dem-dist values and by 
aligning the tiles to the raster
given by hgt. Example:
If the upper left corner of your img file is at lat 51.0 , lon 10.0 and 
dem-dist is 2^32/(360*3600) ~ 3314,
the DEM points will be close to the hgt points in file N51E010.hgt if that is 
in 1'' resolution.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag von Peter 
Danninger <pe...@danninger.eu>
Gesendet: Mittwoch, 10. Januar 2018 17:53:46
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] HGT - getElevation()

I don't think rounding or interpolating
will deliver any better results.
If you have 1" .hgt files, you get
an altitude value every 30m.
With 3" .hgt files much worse, every 90m.
In the mountains, between 2 points
may be a big wall with some 100m
height-difference.
So if you have small deviations in lat/lon,
you will evtl. get very false elevation values.

If you interpolate altitude-values,
you calculate wrong values by design :-(

May be I'm wrong, but this is my theory.

lg Peter


Am 10.01.2018 um 17:39 schrieb Gerd Petermann:
> Hi Andrzej,
>
> if you want to try this:
> you can easily change the code in interpolatedHeight to return the height in 
> feet, just make sure that you don't convert UNDEF.
>
> The only other change that is needed is  in this line in DemHeader:
> writer.putInt(0); // 0: elevation in metres, 1: foot
>
> well, the comment should say feet , not foot
>
> Gerd
>
> ________________________________________
> Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag von Frank 
> Stinner <frank.stin...@kabelmail.de>
> Gesendet: Mittwoch, 10. Januar 2018 17:27:22
> An: mkgmap-dev@lists.mkgmap.org.uk
> Betreff: Re: [mkgmap-dev] HGT - getElevation()
>
> Hi Gerd and Andrzej,
>
> i think "overkill" is a good word.
>
> For algorithm that'a only numbers, it does not matter. The questions is, how 
> exact are the hgt-values. We don't know that, but i don't believe it is
> +-1m or so. I'm not wondering, when the hgt's have +-5m or +-10m. The 
> copernicus-data have +-7m and i don't believe the technic was worse.
>
> That's why feets are overkill. The numbers are 3 times greater, that's why 
> the dem's are greater. It's not worth it.
>
>
> Frank
>
> ---
> Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
> https://www.avast.com/antivirus
>
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>

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

Reply via email to