logo separator

[mkgmap-dev] Artifacts in final map (.MP -> .IMG conversion)

From Gerd Petermann gpetermann_muenchen at hotmail.com on Fri Feb 8 17:27:41 GMT 2019

Hi Vadim,

if you are sure that all further lines starting with DATA0  are inner rings, it would be rather easy to implement support for that. It would be a lot more effort if this format also supports multiple outer rings like in OSM(1), or if multiple lines build one ring and so on.
(1) like type=multipolygon relations in OSM

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Vadim <bombur at mail.ru>
Gesendet: Freitag, 8. Februar 2019 18:13
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] Artifacts in final map (.MP -> .IMG conversion)

Thank you very much for your answer!

Unfortunately, you are right.
Tested Mkgmap with .MP file containing only one multipolygon.
Even with a single hole (inner ring) in the polygon artifacts appear.
Tried converters: mp2osm and pfm2osm, but without success.

In the .MP format in a polygon declaration, the first line, starting with
DATA, is interpreted as an external polygon. Subsequent lines with DATA - as
internal polygons (holes).
Example:
===============
[POLYGON]
Type=0x10F00
Label=0m
Data0=(47.10833863,-122.58886798),(47.1085766,-122.58880805)... -- OUTER
RING
Data0=(47.112746813,-122.575967689),(47.112912753,-122.576180323)... --INNER
RING
Data0=(47.12197852,-122.57097549),(47.12206612,-122.57104106)... --INNER
RING
Data0=(47.12129872,-122.570572),(47.12133023,-122.57074099)... --INNER RING
Data0=(47.11818971,-122.57436289),(47.1182273,-122.574508)... --INNER RING
[END]
===============

I looked at the source (PolishMapDataSource.java) and saw the following:
------
if (name.startsWith("Data")) {
                        List<Coord> newPoints = coordsFromString(value);

                        if(points != null)
                                points.addAll(newPoints); //!!!!!!!!//
                        else
                                points = newPoints;
                        setResolution(shape, name);
------
I am not JAVA-programmer, but I suspect that the error is in the line
*points.addAll(newPoints)* -- Mkgmap simply sums the coordinates from
different DATA lines !!!

To be sure, I made an experiment.
Created 2 .MP files.
In the first one I described 1 multipolygon (one external polygon and four
internal).
In the second one define 1 polygon created by summing the coordinates of the
polygons from the first .MP file.
Converted both files using Mkgmap and compared the resulting .IMG files.
They matched!
Test files: https://yadi.sk/d/EuCVJEiucFoKQg





--
Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list