Re: [mkgmap-dev] HGT - getElevation()

2018-01-16 Thread Andrzej Popowski

Hi Gerd,

I have done 2 kind of tests, both with mkgmap patched with your patch 
for aligned HGT.


Fist test is more or less the same what you propose. I looked for a 
round peak on a map and then searched for the highest value of DEM on a 
peak, moving cursor around. With zoom 20m, I tried to estimate area, 
where DEM is the highest and then I noted coordinates of the center of 
this area.


Then I loaded original HGT into QGIS and looked for the coordinates and 
position inside HGT pixel, which is displayed by QGIS as a square. I got 
very good match, coordinates were near the center of the pixel and 
height was the same as in Mapsource.


In second test I calculated manually areas.list with 2 tiles for 
splitter. One tile aligned with HGT raster, second with left and top 
edge moved by about half of HGT pixel size. I had to tweak these tiles a 
bit and the final result was this:


2900: 2291022,918087 to 2297546,946049
#   : aligned

2901: 2291022,918097 to 2297534,946049
#   : non-aligned

After compiling these tiles, I got 2 maps with following coordinates:

N: 49.299989, S: 49.15, W: 19.700010, E: 20.39
DEM layers: 1, N: 49.300010, W: 19.700010

N: 49.299731, S: 49.15, W: 19.700224, E: 20.39
DEM layers: 1, N: 49.300010, W: 19.700010

As you can see, DEM position was the same, but map position was a bit 
different in both tiles. Then I saved both tiles on virtual drive, where 
they could be seen by BaseCamp as independent maps. I could switch 
between tiles and compare shading. I uploaded screenshots.


I think about 2 more ways of testing. Frank in his manual about DEM, 
described a clever way to sample DEM values from Mapsource. His tools 
could be used to validate DEM conversion.


Another way could be to artificially move DEM area by multiple of HGT 
pixel size. This would create a DEM with bigger offset but with the same 
heights taken from interpolation. If the look of the map wouldn't 
change, then we could assume, that programs can deal with offset correctly.


--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] HGT - getElevation()

2018-01-16 Thread Gerd Petermann
Hi Andrzej,

can you explain in detail what you did? Did you use patched mkgmap for this?

reg. testing: My current thinking is that we should look at the height values 
displayed
at the status line when in highest zoom (20m). For example, create a map that 
contains
an area around -20.0 -64.0 , use Strg+T to jump to exactly
S20 W64 , make sure that the cursor is in the crosshair and it should display 
1284m because
that is the value that I find as 1st value in s21w064.hgt (it starts with 
0x0504).
Repeat this procedure with different maps, one with bbox aligned, one with a 
large difference
(1/2 hgt pixel width, maybe also 1/3 and 3/4 or so).
All this with unpatched and patched r4068.
I assume that we get the best result with an input file that has a bounds 
statement
which places the upper left corner as close as possible to the hgt raster.

Does that make sense?

Gerd


Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Dienstag, 16. Januar 2018 16:36:22
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] HGT - getElevation()

Hi Gerd,

I have tried to align pbf bbox with HGT. I have ceated 2 maps, one with
god alignment and second with left and top edge moved by 1/2 HGT pixel
size. I have used HGT with resolution 3600, so the movement was about
15m. I think shading is the same on both maps. There is no obvious
change, but I can't make BaseCamp to display maps at exactly the same
position, so there is a small movement of all objects. See pictures:
http://files.mkgmap.org.uk/download/396/hgt-aligned.png
http://files.mkgmap.org.uk/download/397/hgt-nonaligned.png

DEM layer is the same for both maps, position and size exactly the same.

I have found, why shading on your map looks more detailed. You have
created only single layer of DEM, while I use 4 layers. Shading with
multiple layers looks softer. Another weird effect is that with single
layer, shading gets softer, when you set "Map Detail" to higher in
Mapsource. With multilayer is opposite, probably Mapsource switches
between layers.

--
Best regards,
Andrzej
___
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


Re: [mkgmap-dev] HGT - getElevation()

2018-01-16 Thread Gerd Petermann
Hi Andrzej,
sorry, maybe I made again something wrong while testing :-((
This testing is really difficult, maybe I've exchanged results of patched and 
unpatched version. In this case my
previous post was completely wrong.
Or one of my unit tests is wrong. I'll check this again tomorrow, need some 
rest now ;-)

Gerd



Von: mkgmap-dev  im Auftrag von Gerd 
Petermann 
Gesendet: Dienstag, 16. Januar 2018 17:40:54
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] HGT - getElevation()

Hi Andrzej,

reg. screen shots:
I created my two screenshots this way:
1) locate a position -> create 1st screenshot -> leave MapSource
2) replace map content (I just rename dirs, both maps are created with the same 
options, just different binaries)
3) open MapSource, press Strg+G two times, create 2nd screenshot
I think the same works with Basecamp, both remember the position in the map in 
this case.
You can also use Strg+T to jump to a position.

I've also tested quality again now and found that DEM data is clearly better 
when DEM bbox is aligned to hgt raster.
So, yes, we should align, and I was wrong, there is no need to change splitter 
for that, we just have to align the DEM bbox :-)

This allows to get the best result out of a hgt file without using a dem-dist 
value that is lower than the resolution of the hgt file.
Question is if anything is improved with e.g. dem-dists=3312,... when 
dem-dists=9942 gives the best possible result?

Gerd
P.S. please review new patch, last one did not use moved value for right 
boundary


Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Dienstag, 16. Januar 2018 16:36:22
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] HGT - getElevation()

Hi Gerd,

I have tried to align pbf bbox with HGT. I have ceated 2 maps, one with
god alignment and second with left and top edge moved by 1/2 HGT pixel
size. I have used HGT with resolution 3600, so the movement was about
15m. I think shading is the same on both maps. There is no obvious
change, but I can't make BaseCamp to display maps at exactly the same
position, so there is a small movement of all objects. See pictures:
http://files.mkgmap.org.uk/download/396/hgt-aligned.png
http://files.mkgmap.org.uk/download/397/hgt-nonaligned.png

DEM layer is the same for both maps, position and size exactly the same.

I have found, why shading on your map looks more detailed. You have
created only single layer of DEM, while I use 4 layers. Shading with
multiple layers looks softer. Another weird effect is that with single
layer, shading gets softer, when you set "Map Detail" to higher in
Mapsource. With multilayer is opposite, probably Mapsource switches
between layers.

--
Best regards,
Andrzej
___
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


Re: [mkgmap-dev] HGT - getElevation()

2018-01-16 Thread Gerd Petermann
Hi Andrzej,

reg. screen shots:
I created my two screenshots this way:
1) locate a position -> create 1st screenshot -> leave MapSource
2) replace map content (I just rename dirs, both maps are created with the same 
options, just different binaries)
3) open MapSource, press Strg+G two times, create 2nd screenshot
I think the same works with Basecamp, both remember the position in the map in 
this case.
You can also use Strg+T to jump to a position.

I've also tested quality again now and found that DEM data is clearly better 
when DEM bbox is aligned to hgt raster.
So, yes, we should align, and I was wrong, there is no need to change splitter 
for that, we just have to align the DEM bbox :-)

This allows to get the best result out of a hgt file without using a dem-dist 
value that is lower than the resolution of the hgt file.
Question is if anything is improved with e.g. dem-dists=3312,... when 
dem-dists=9942 gives the best possible result?

Gerd
P.S. please review new patch, last one did not use moved value for right 
boundary


Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Dienstag, 16. Januar 2018 16:36:22
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] HGT - getElevation()

Hi Gerd,

I have tried to align pbf bbox with HGT. I have ceated 2 maps, one with
god alignment and second with left and top edge moved by 1/2 HGT pixel
size. I have used HGT with resolution 3600, so the movement was about
15m. I think shading is the same on both maps. There is no obvious
change, but I can't make BaseCamp to display maps at exactly the same
position, so there is a small movement of all objects. See pictures:
http://files.mkgmap.org.uk/download/396/hgt-aligned.png
http://files.mkgmap.org.uk/download/397/hgt-nonaligned.png

DEM layer is the same for both maps, position and size exactly the same.

I have found, why shading on your map looks more detailed. You have
created only single layer of DEM, while I use 4 layers. Shading with
multiple layers looks softer. Another weird effect is that with single
layer, shading gets softer, when you set "Map Detail" to higher in
Mapsource. With multilayer is opposite, probably Mapsource switches
between layers.

--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


dem-move2.patch
Description: dem-move2.patch
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] HGT - getElevation()

2018-01-16 Thread Andrzej Popowski

Hi Gerd,

I have tried to align pbf bbox with HGT. I have ceated 2 maps, one with 
god alignment and second with left and top edge moved by 1/2 HGT pixel 
size. I have used HGT with resolution 3600, so the movement was about 
15m. I think shading is the same on both maps. There is no obvious 
change, but I can't make BaseCamp to display maps at exactly the same 
position, so there is a small movement of all objects. See pictures:

http://files.mkgmap.org.uk/download/396/hgt-aligned.png
http://files.mkgmap.org.uk/download/397/hgt-nonaligned.png

DEM layer is the same for both maps, position and size exactly the same.

I have found, why shading on your map looks more detailed. You have 
created only single layer of DEM, while I use 4 layers. Shading with 
multiple layers looks softer. Another weird effect is that with single 
layer, shading gets softer, when you set "Map Detail" to higher in 
Mapsource. With multilayer is opposite, probably Mapsource switches 
between layers.


--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] v4058 dem-tdb crashes

2018-01-16 Thread Gerd Petermann
Hi Andrzej,

the same problem occured with maxlon=0 in r4065.

The new code works fine as long as you don't try to retrieve data outside the 
initial area.
I've added some unit tests to prove that now, see
http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=4068

Gerd



Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Dienstag, 16. Januar 2018 14:59:40
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] v4058 dem-tdb crashes

Hi Gerd,

thanks again, America South compiled OK.

A tile with lower edge at 0 compiles properly, but don't you expect the
same problem with lower or right border?

--
Best regards,
Andrzej
___
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


Re: [mkgmap-dev] v4058 dem-tdb crashes

2018-01-16 Thread Andrzej Popowski

Hi Gerd,

thanks again, America South compiled OK.

A tile with lower edge at 0 compiles properly, but don't you expect the 
same problem with lower or right border?


--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] HGT - getElevation()

2018-01-16 Thread Gerd Petermann
Hi Andrzej,

okay, got it. You are right, one should test the encoded values.
OSM data might as well be shifted due to wrong sat images.
I'm still coding the unit tests, next I'll look again at the different versions 
of the patch.

ciao,
Gerd


Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Montag, 15. Januar 2018 23:33:03
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] HGT - getElevation()

Hi Gerd,

I use SRTM3 v3, so map can be different, but I'm surprised by difference
in details. That's why I wanted to recompile map.

I can see shift in shading when aligning DEM, I told so in my first
post. But I rather don't notice that shading doesn't fit map features.
Probably this becomes visible, when comparing 2 versions.

Judging shadings can be a bit subjective. I have tried to verify actual
height displayed under cursor versus HGT data and this looked good.

--
Best regards,
Andrzej
___
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