Map display squeezed horizontally

Hello, while examining the wrong labels in Mapsource I found another strange problem with my map. Compared with other maps, my own map seems to be squeezed horizontally. I made a screenshot to illustrate this, please see http://www.mipri.de/dl/maps.png I've mounted two screenshots side by side. Both are made from exactly the same Mapsource window, I just switched the map. The left is my own map, the right a map created without own style and TYP file. While the height is absolutely identical in both maps, my own map is squeezed horizontally, showing areas that are not visible in the map on the righthand side, for example the parking below the Min Map. The scale in the lower right corner is identical in both maps, and not squeezed like the map. I've also tried other maps, they all look like the map at the right. So it's definitely my own map which is displayed wrong. My map was built as follows: - Created contour data with srtm2osm, renumbered ways and nodes so that their IDs do not collide with "real" OSM IDs, converted to PBF - Downloaded OSM data for Germany from Geofabric in PBF format - Merged both using the latest stable osmosis - Splitted the resulting PBF - Created the map with the latest mkgmap Does anybody have an idea how this deformation could have been caused? Thank you for your answers, Michael

Hello Michael, the algorithms used in mkgmap could explain some shifting of elements, but I have no idea how a squeeze could happen. The img format requires mkgmap to distribute data to different so called sub divisions, the positions of elements are saved relative to these sub divisions. The more details your map contains, the more sub divs are created. So that would explain small changes when a style adds more details. The sub divisions may overlap, and I assume that rounding errors can cause that you see two objects that are saved in different sub divs with a different distance. I don't know if this can explain what you see? Gerd
Date: Thu, 18 Apr 2013 01:49:22 +0200 From: mipri@gmx.net To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] Map display squeezed horizontally
Hello,
while examining the wrong labels in Mapsource I found another strange problem with my map. Compared with other maps, my own map seems to be squeezed horizontally. I made a screenshot to illustrate this, please see http://www.mipri.de/dl/maps.png
I've mounted two screenshots side by side. Both are made from exactly the same Mapsource window, I just switched the map. The left is my own map, the right a map created without own style and TYP file.
While the height is absolutely identical in both maps, my own map is squeezed horizontally, showing areas that are not visible in the map on the righthand side, for example the parking below the Min Map.
The scale in the lower right corner is identical in both maps, and not squeezed like the map.
I've also tried other maps, they all look like the map at the right. So it's definitely my own map which is displayed wrong.
My map was built as follows:
- Created contour data with srtm2osm, renumbered ways and nodes so that their IDs do not collide with "real" OSM IDs, converted to PBF
- Downloaded OSM data for Germany from Geofabric in PBF format
- Merged both using the latest stable osmosis
- Splitted the resulting PBF
- Created the map with the latest mkgmap
Does anybody have an idea how this deformation could have been caused?
Thank you for your answers,
Michael
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Michael, In Mapsource you can adjust the projection angle of each map with Ctrl Alt A if that is what you are looking for. In Basecamp it only works by editing the windows registry parameters (ProjectionAngle in HKEY_CURRENT_USER\Software\Garmin\SharedSettings\Products) or by setting it in Mapsource. Regarding the land background you can choose your own background with --generate-sea=land-tag=key=value (default is natural=land). If you don't specify a label, it says "unknown area" or "land, non urban" If you specify a label but don't fill in anything (i'm using typ viewer) then it displays nothing but a tiny empty text box. You can also try to remove 0x4b from your typ file.

Minko schrieb: Hello Minko,
In Mapsource you can adjust the projection angle of each map with Ctrl Alt A if that is what you are looking for.
Partial success, thank you. In fact changing the viewing angle in Mapsource results in exactly the deformations I am experiencing with my map. The viewing angle was set to "Let Mapsource decide automatically" for all the maps I've installed. For some reason I do not understand yet, Mapsource selects the same angle for every map except my own. If I am manually setting the viewing angle to the same value for my map *and* the other ones, all the maps are displayed exactly the same. Unfortunately Mapsource doesn't work a s expected. I can only select viewing angles between 5° and 85°. Wouldn't an angle of 0° or 90° (depending on where it is measured) result in the correct aspect ratio? And there is only one scale in the lower right corner of the map window. If the width of the map changes with the viewing angle while the hight stays constant, this scale cannot fit to both. And finally, Mapsource doesn't let me set an angle other than 35°. If I am selecting another value, it jumps back to 35° after restarting. But well, this is not an mkgmap issue...
Regarding the land background you can choose your own background with --generate-sea=land-tag=key=value (default is natural=land). If you don't specify a label, it says "unknown area" or "land, non urban" If you specify a label but don't fill in anything (i'm using typ viewer) then it displays nothing but a tiny empty text box.
This sounds quite promising, I will try it out. Basically I could leave the default unchanged and assign the desired ID to natural=land in the polygons style?
You can also try to remove 0x4b from your typ file.
If I am doing this the label is gone, but I am no longer able to change the color of the background. Michael

Michael wrote:
This sounds quite promising, I will try it out. Basically I could leave the default unchanged and assign the desired ID to natural=land in the polygons style?
yes, but bare in mind that natural=land is also a common OSM tag. If someone wants to render an island in a lake with natural=land and you render natural=land as background, the island disappears under the lake. On the other hand, the opposite is also possible, when you have an island as natural=land and a lake on this island with natural=water. If you want to put natural=land above natural=water then the lake disappears. This kind of tagging is obsolete, since it is more common now to use multipolygons to avoid those problems, so I think using a background polygon for natural=land should be fine.

Gerd Petermann schrieb: Hello Gerd,
the algorithms used in mkgmap could explain some shifting of elements, but I have no idea how a squeeze could happen. The img format requires mkgmap to distribute data to different so called sub divisions, the positions of elements are saved relative to these sub divisions. The more details your map contains, the more sub divs are created. So that would explain small changes when a style adds more details. The sub divisions may overlap, and I assume that rounding errors can cause that you see two objects that are saved in different sub divs with a different distance. I don't know if this can explain what you see?
I don't think so. If I understood you correctly, for a given object this would result in always the same shift, independent of the position of the object inside the map window. This is not what I am seeing here. My objects are moved from both sides left and right towards the center of the map window. For the parking at the right in my sample images this results in a move to the left. If I however move the map window so that the parking comes to the border on the left, it still gets moved to the center of the map window, but now this is a shift to the right. But I think Minko got it by pointing to the viewing angle in Mapsource. Michael

The actual reason for this problem is, that Mapsource >=6.14 and Basecamp cache the map before/while you view it. Therefore it needs to fix the projections. Hence - the more out of the center of the map you move (south/north), the more distorted it will be. Moving east/west of course doesn't create distortion. Mapsource 6.13.6 doesn't do this (use 6.13.6 and not 6.13.7 because of bugs in 6.13.7) - however doesn't have anti-aliasing and actually quite a few other handy features that you can use with mkgmap. Also 6.13.6 doesn't display all extended types (many but not all of the same as Mapsource 6.16, basecamp, or the GPS devices). On 20.04.2013 06:49, Gerd Petermann wrote:
Hi Michael,
But I think Minko got it by pointing to the viewing angle in Mapsource.
sure, Minkos explanation is much better.
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

Felix Hartmann schrieb:
The actual reason for this problem is, that Mapsource >=6.14 and Basecamp cache the map before/while you view it. Therefore it needs to fix the projections. Hence - the more out of the center of the map you move (south/north), the more distorted it will be. Moving east/west of course doesn't create distortion.
Thank you Felix, now it's clear. I had confused "projection angle" with "viewing angle" (the angle at which a viewer is looking to the map, caused by a tilt of the map). If the projection angle is the latitude for which the correct horizontal width of the map display is calculated, it is clear that areas north of this latitude get stretched, while areas south of it are shown squeezed. Although I am creating a map for Germany, there are some huge but almost empty tiles up to N 60°. One of them covers the whole area between Berlin and Helsinki, others are far out on the Atlantic Ocean, west of Scottland. If Mapsource automatically selects an projection angle in the middle between the points with the max. and the min. latitude, this will result in a projectoion angle of more than 50° for my map and so almost the whole area of Germany appears to be squeezed. Is there an easy way to remove these tiles from the map (I think they only contain ferry lines, pipelines etc.) without using --keep-complete=false for the splitter and without causing artifacts by cutting the contour lines (they are merged to the OSM data before splitting)? Thank you, Michael

Hi Michael, Michael Prinzing-3 wrote
Although I am creating a map for Germany, there are some huge but almost empty tiles up to N 60°. One of them covers the whole area between Berlin and Helsinki, others are far out on the Atlantic Ocean, west of Scottland. If Mapsource automatically selects an projection angle in the middle between the points with the max. and the min. latitude, this will result in a projectoion angle of more than 50° for my map and so almost the whole area of Germany appears to be squeezed.
Is there an easy way to remove these tiles from the map (I think they only contain ferry lines, pipelines etc.) without using --keep-complete=false for the splitter and without causing artifacts by cutting the contour lines (they are merged to the OSM data before splitting)?
Strange. When I create a map for Germany the tiles are not covering much more. I assume the problem is caused by the SRTM data. You can use a polygon file with splitter to make sure that you only get tiles for the wanted area. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Map-display-squeezed-horizontally-tp5757527p5... Sent from the Mkgmap Development mailing list archive at Nabble.com.

GerdP schrieb: Hello Gerd,
Michael Prinzing-3 wrote
Although I am creating a map for Germany, there are some huge but almost empty tiles up to N 60°. One of them covers the whole area between Berlin and Helsinki, others are far out on the Atlantic Ocean, west of Scottland. If Mapsource automatically selects an projection angle in the middle between the points with the max. and the min. latitude, this will result in a projectoion angle of more than 50° for my map and so almost the whole area of Germany appears to be squeezed.
Is there an easy way to remove these tiles from the map (I think they only contain ferry lines, pipelines etc.) without using --keep-complete=false for the splitter and without causing artifacts by cutting the contour lines (they are merged to the OSM data before splitting)?
Strange. When I create a map for Germany the tiles are not covering much more. I assume the problem is caused by the SRTM data.
I'll have a deeper look into this, but I cannot imagine the contour data being the cause. I've created the contour data for the rectangle 47.15 5.75 55.15 15.15 This is a lot smaller than the areas covered by the almost empty tiles. Even more, I am splitting the contour lines into parts, none of them consisting of more than 2000 nodes, and then I am using osmosis to cut them to the shape of Germany. I have to use osmosis' parameter completeWays=yes when I am doing this, but even if 1999 out of the max 2000 nodes of a contour line are outside the bounding polygon this should be no more than a few kilometers. It's difficult to find the few data inside the huge and almost empty tiles without coastlines and cities, but at N 54° 42,0' E 13° 51,0' for example there are 3 ferry lines crossing: "Swinoujscie - Trelleborg", "Finnlines" and "Klaipeda - Kiel". All these lines leave the area my map should cover and seem to be included completely.
You can use a polygon file with splitter to make sure that you only get tiles for the wanted area.
Isn't a line starting inside the bounding polygon and ending outside inluded completely if --keep-complete=false is not set? Thank you, Michael

Hello Michael,
47.15 5.75 55.15 15.15
This is a lot smaller than the areas covered by the almost empty tiles. Even more, I am splitting the contour lines into parts, none of them consisting of more than 2000 nodes, and then I am using osmosis to cut them to the shape of Germany. I have to use osmosis' parameter completeWays=yes when I am doing this, but even if 1999 out of the max 2000 nodes of a contour line are outside the bounding polygon this should be no more than a few kilometers.
It's difficult to find the few data inside the huge and almost empty tiles without coastlines and cities, but at N 54° 42,0' E 13° 51,0' for example there are 3 ferry lines crossing: "Swinoujscie - Trelleborg", "Finnlines" and "Klaipeda - Kiel". All these lines leave the area my map should cover and seem to be included completely.
The question is only the bounding box, because that is used to calculate the tiles. So, maybe osmosis calculates a new bbox on the data in the files. In that case you should pass a bbox or polygon to osmosis.
You can use a polygon file with splitter to make sure that you only get tiles for the wanted area.
Isn't a line starting inside the bounding polygon and ending outside inluded completely if --keep-complete=false is not set?
yes, sure, but splitter will write tiless with different bounding boxes. By the way, make sure that you don't use option --ignore-osm-bounds in mkgmap. Gerd

Gerd Petermann schrieb: Hello Gerd,
47.15 5.75 55.15 15.15
This is a lot smaller than the areas covered by the almost empty tiles. Even more, I am splitting the contour lines into parts, none of them consisting of more than 2000 nodes, and then I am using osmosis to cut them to the shape of Germany. I have to use osmosis' parameter completeWays=yes when I am doing this, but even if 1999 out of the max 2000 nodes of a contour line are outside the bounding polygon this should be no more than a few kilometers.
It's difficult to find the few data inside the huge and almost empty tiles without coastlines and cities, but at N 54° 42,0' E 13° 51,0' for example there are 3 ferry lines crossing: "Swinoujscie - Trelleborg", "Finnlines" and "Klaipeda - Kiel". All these lines leave the area my map should cover and seem to be included completely.
The question is only the bounding box, because that is used to calculate the tiles. So, maybe osmosis calculates a new bbox on the data in the files.
Yes, the problem was the bounding box, and it has to do with a change in Osmosis. Versions 0.40 and newer do not write a bounding box to the target file of a merge task if at least one source file has no bounding box. Version 0.39 wrote a bounding box to the target file in this case. My contour data does not include a bounding box, so merging the original germany.osm.pbf with my contour data resulted in a file without a bounding box.
In that case you should pass a bbox or polygon to osmosis.
This will of course eliminate the data outside the desired area, but even when using --bounding-box while merging the files with Osmosis 0.40 or newer there is no bounding box written to the target file! I think I will add a bounding box manually to my contour data. Passing a bounding box to the splitter does also work. Thank you, Michael
participants (6)
-
Felix Hartmann
-
Gerd Petermann
-
GerdP
-
Michael Prinzing
-
Michael Prinzing
-
Minko