logo separator

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

From Vadim bombur at mail.ru on Fri Feb 8 17:13:31 GMT 2019

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


More information about the mkgmap-dev mailing list