special case where splitting fails without a log message

Hi Ticker, while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self-intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options. Look at 67.6742611, 14.6783525 Found this with some check code that compares the area of the original polygon with that of sum of the parts. Gerd

Hi Gerd OK - I've reproduced this. Is split-failed.osm self-intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected. I'll investigate more. Ticker On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd OK - I've reproduced this. Is split-failed.osm self-intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected. I'll investigate more. Ticker On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted. I'll undo my trunk changes and look again. Does JOSM have self-intersection checking? Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems. Ticker On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self-intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Sorry - sea.zip! On Tue, 2021-05-25 at 12:36 +0100, Ticker Berkin wrote:
Hi Gerd
I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted.
I'll undo my trunk changes and look again.
Does JOSM have self-intersection checking?
Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems.
Ticker
On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self-intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, with the attached patch ShapeMerger avoids to produce shapes where more than the start point is visited twice. This produces much larger img files (even larger than trunk) but PolygonSplitter doesn't complain. I have to find out what GpsMapEdit means with "has a jitter". Maybe only those are problematic. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 14:00 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Sorry - sea.zip! On Tue, 2021-05-25 at 12:36 +0100, Ticker Berkin wrote:
Hi Gerd
I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted.
I'll undo my trunk changes and look again.
Does JOSM have self-intersection checking?
Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems.
Ticker
On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self-intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd Patch attached that I hope fixes the splitting problem. I haven't looked at your change yet, but your split-failed.osm test had, and needed, lots of points visited twice and I don't see how this can, or should, be avoided. Ticker On Tue, 2021-05-25 at 15:56 +0000, Gerd Petermann wrote:
Hi Ticker,
with the attached patch ShapeMerger avoids to produce shapes where more than the start point is visited twice. This produces much larger img files (even larger than trunk) but PolygonSplitter doesn't complain.
I have to find out what GpsMapEdit means with "has a jitter". Maybe only those are problematic.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 14:00 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Sorry - sea.zip!
On Tue, 2021-05-25 at 12:36 +0100, Ticker Berkin wrote:
Hi Gerd
I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted.
I'll undo my trunk changes and look again.
Does JOSM have self-intersection checking?
Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems.
Ticker
On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self-intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Sorry - excess stuff in patch, correct one now. Ticker On Tue, 2021-05-25 at 17:46 +0100, Ticker Berkin wrote:
Hi Gerd
Patch attached that I hope fixes the splitting problem.
I haven't looked at your change yet, but your split-failed.osm test had, and needed, lots of points visited twice and I don't see how this can, or should, be avoided.
Ticker
On Tue, 2021-05-25 at 15:56 +0000, Gerd Petermann wrote:
Hi Ticker,
with the attached patch ShapeMerger avoids to produce shapes where more than the start point is visited twice. This produces much larger img files (even larger than trunk) but PolygonSplitter doesn't complain.
I have to find out what GpsMapEdit means with "has a jitter". Maybe only those are problematic.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 14:00 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Sorry - sea.zip!
On Tue, 2021-05-25 at 12:36 +0100, Ticker Berkin wrote:
Hi Gerd
I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted.
I'll undo my trunk changes and look again.
Does JOSM have self-intersection checking?
Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems.
Ticker
On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self -intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Sorry - excess stuff in patch, correct one now. Ticker On Tue, 2021-05-25 at 17:46 +0100, Ticker Berkin wrote:
Hi Gerd
Patch attached that I hope fixes the splitting problem.
I haven't looked at your change yet, but your split-failed.osm test had, and needed, lots of points visited twice and I don't see how this can, or should, be avoided.
Ticker
On Tue, 2021-05-25 at 15:56 +0000, Gerd Petermann wrote:
Hi Ticker,
with the attached patch ShapeMerger avoids to produce shapes where more than the start point is visited twice. This produces much larger img files (even larger than trunk) but PolygonSplitter doesn't complain.
I have to find out what GpsMapEdit means with "has a jitter". Maybe only those are problematic.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 14:00 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Sorry - sea.zip!
On Tue, 2021-05-25 at 12:36 +0100, Ticker Berkin wrote:
Hi Gerd
I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted.
I'll undo my trunk changes and look again.
Does JOSM have self-intersection checking?
Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems.
Ticker
On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self -intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, doesn't help much with the low-res-opt branch. I've attached a patch which contains my test code. It writes gpx files, so please modify the path. I use it with in Eclipse a breakpoint on the line log.error("split failed, ratio:", ratio); to be able to load the GPX files into JOSM for further analyses. I use it with my precomp-sea test-environment, see http://gis.19327.n8.nabble.com/precomp-sea-test-environment-tt5974624.html options: --output-dir=e:\ld --gmapi --precomp-sea=f:\osm\sea.zip --max-jobs=1 --style-file=e:\precomp-sea-check\sea-check -c e:\precomp-sea-check\tiles\template.args or with the files in https://files.mkgmap.org.uk/download/507/xxx.zip and options --output-dir=e:\ld --gmapi --generate-sea=multipolygon,floodblocker --max-jobs=1 --preserve-element-order --allow-reverse-merge -c e:\xxx\template.args If I got that right your algo has problems when the polygon goes through points A and B twice, once in A-B direction and and again in B-A and the cut is between A and B? I try to find efficient code to detect and avoid just those. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 18:49 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Sorry - excess stuff in patch, correct one now. Ticker On Tue, 2021-05-25 at 17:46 +0100, Ticker Berkin wrote:
Hi Gerd
Patch attached that I hope fixes the splitting problem.
I haven't looked at your change yet, but your split-failed.osm test had, and needed, lots of points visited twice and I don't see how this can, or should, be avoided.
Ticker
On Tue, 2021-05-25 at 15:56 +0000, Gerd Petermann wrote:
Hi Ticker,
with the attached patch ShapeMerger avoids to produce shapes where more than the start point is visited twice. This produces much larger img files (even larger than trunk) but PolygonSplitter doesn't complain.
I have to find out what GpsMapEdit means with "has a jitter". Maybe only those are problematic.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 14:00 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Sorry - sea.zip!
On Tue, 2021-05-25 at 12:36 +0100, Ticker Berkin wrote:
Hi Gerd
I'm getting very confused by this. When I build with my trunk (some filter order changes + a few others), I see a whole lot more that JOSM shows. It and your 6324001.img just show a central bit. Looking with GPSMapEdit with "Highlight Polygon Contours". I also see areas where all islands are inverted.
I'll undo my trunk changes and look again.
Does JOSM have self-intersection checking?
Was the gpx trace hi-res (30bit) and then this kept when generating the osm. If not, then I'd expect problems.
Ticker
On Tue, 2021-05-25 at 11:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I didn't investigate the details. I've created the osm data by converting a gpx back to osm. I guess in the original input duplicate points are identical. I found more such cases where parts are removed.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 25. Mai 2021 12:51 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
OK - I've reproduced this. Is split-failed.osm self -intersecting? I'm not sure how to tell from Josm, but it looks like it isn't. I get the messages from shapeSplitter because it thinks it is and then the result is not good - as expected.
I'll investigate more.
Ticker
On Tue, 2021-05-25 at 10:04 +0000, Gerd Petermann wrote:
Hi Ticker,
while looking at the problems with sea I found this case where ShapeSplitter removes a small part of an island from a self -intersecting polygon in res 24. Compiled with mkgmap from trunk, default style and no options.
Look at 67.6742611, 14.6783525
Found this with some check code that compares the area of the original polygon with that of sum of the parts.
Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I hope the only case where my algo still has problems is when 2 lines intersect the cut line at identical points and they have the same area to that side of the line (implying they follow exactly the same path or intersect each other). This should generate the warning: "Lines hit divider at same points and have same area sign" I've been thinking of ways to resolve this and should be possible. If you are not seeing this warning and it is flagging errors, then either another pathological case that I need to consider or it is self -intersecting. My last patch should, I hope, fix the case you mention unless - see above. I stress-tested with GB, trunk. shapeMerge with no point limit and got a few examples of this and some "shape / hole" conflict, which I think might be real self-intersection problems. I'm going to add more diags and generate a gpx when errors/debugEnabled. I was hoping to find a good self-intersection algo, but the ones I thought might be ok are good for detecting line segments that cross but not for when all the difficulties are lines following each other and crossings happen at nodes. Ticker On Wed, 2021-05-26 at 04:46 +0000, Gerd Petermann wrote:
Hi Ticker,
doesn't help much with the low-res-opt branch. I've attached a patch which contains my test code. It writes gpx files, so please modify the path. I use it with in Eclipse a breakpoint on the line log.error("split failed, ratio:", ratio); to be able to load the GPX files into JOSM for further analyses. I use it with my precomp-sea test-environment, see http://gis.19327.n 8.nabble.com/precomp-sea-test-environment-tt5974624.html options: --output-dir=e:\ld --gmapi --precomp-sea=f:\osm\sea.zip --max -jobs=1 --style-file=e:\precomp-sea-check\sea-check -c e:\precomp-sea -check\tiles\template.args
or with the files in https://files.mkgmap.org.uk/download/507/xxx.zip and options --output-dir=e:\ld --gmapi --generate-sea=multipolygon,floodblocker --max-jobs=1 --preserve-element-order --allow-reverse-merge -c e:\xxx\template.args
If I got that right your algo has problems when the polygon goes through points A and B twice, once in A-B direction and and again in B-A and the cut is between A and B?
I try to find efficient code to detect and avoid just those.
Gerd

Hi Ticker, OK, I think your patch improves some cases. I've also fixed another potential cause for these problems with r4744. I think I have to find a way to avoid those segments which are visited multiple times in the same direction. There's probably always an alternative merge order that avoids this. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 26. Mai 2021 10:36 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I hope the only case where my algo still has problems is when 2 lines intersect the cut line at identical points and they have the same area to that side of the line (implying they follow exactly the same path or intersect each other). This should generate the warning: "Lines hit divider at same points and have same area sign" I've been thinking of ways to resolve this and should be possible. If you are not seeing this warning and it is flagging errors, then either another pathological case that I need to consider or it is self -intersecting. My last patch should, I hope, fix the case you mention unless - see above. I stress-tested with GB, trunk. shapeMerge with no point limit and got a few examples of this and some "shape / hole" conflict, which I think might be real self-intersection problems. I'm going to add more diags and generate a gpx when errors/debugEnabled. I was hoping to find a good self-intersection algo, but the ones I thought might be ok are good for detecting line segments that cross but not for when all the difficulties are lines following each other and crossings happen at nodes. Ticker On Wed, 2021-05-26 at 04:46 +0000, Gerd Petermann wrote:
Hi Ticker,
doesn't help much with the low-res-opt branch. I've attached a patch which contains my test code. It writes gpx files, so please modify the path. I use it with in Eclipse a breakpoint on the line log.error("split failed, ratio:", ratio); to be able to load the GPX files into JOSM for further analyses. I use it with my precomp-sea test-environment, see http://gis.19327.n 8.nabble.com/precomp-sea-test-environment-tt5974624.html options: --output-dir=e:\ld --gmapi --precomp-sea=f:\osm\sea.zip --max -jobs=1 --style-file=e:\precomp-sea-check\sea-check -c e:\precomp-sea -check\tiles\template.args
or with the files in https://files.mkgmap.org.uk/download/507/xxx.zip and options --output-dir=e:\ld --gmapi --generate-sea=multipolygon,floodblocker --max-jobs=1 --preserve-element-order --allow-reverse-merge -c e:\xxx\template.args
If I got that right your algo has problems when the polygon goes through points A and B twice, once in A-B direction and and again in B-A and the cut is between A and B?
I try to find efficient code to detect and avoid just those.
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I have to design a shape that does this and think what it means. With the extra handling needed for identical opposite lines it will be easy to detect. Maybe possible to just chuck it. I'm out for the rest of the day so can't do anything until tomorrow. Ticker On Wed, 2021-05-26 at 08:46 +0000, Gerd Petermann wrote:
Hi Ticker,
OK, I think your patch improves some cases. I've also fixed another potential cause for these problems with r4744.
I think I have to find a way to avoid those segments which are visited multiple times in the same direction. There's probably always an alternative merge order that avoids this.
Gerd

Hi Gerd I think this can cope with any number of lines, in either/both directions, following the same path. Also it should give better output if same number of lines in both directions. With debug, if it notices a problem, it generates a GPX trace of the original and traces of all the resultant bits individually in a subdirectory relevant to the split line. I've tested it on a few examples, but I'll stress-test GBR again and check the shapes where it detects problems. I probably need to tidy up some message levels and comments. Ticker On Wed, 2021-05-26 at 11:17 +0100, Ticker Berkin wrote:
Hi Gerd
I have to design a shape that does this and think what it means. With the extra handling needed for identical opposite lines it will be easy to detect. Maybe possible to just chuck it.
I'm out for the rest of the day so can't do anything until tomorrow.
Ticker
On Wed, 2021-05-26 at 08:46 +0000, Gerd Petermann wrote:
Hi Ticker,
OK, I think your patch improves some cases. I've also fixed another potential cause for these problems with r4744.
I think I have to find a way to avoid those segments which are visited multiple times in the same direction. There's probably always an alternative merge order that avoids this.
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, sounds good. I'm making progress with a better ShapeMerger that produces less jitter, but so far it still produces some. Will try it later.. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 12:49 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I think this can cope with any number of lines, in either/both directions, following the same path. Also it should give better output if same number of lines in both directions. With debug, if it notices a problem, it generates a GPX trace of the original and traces of all the resultant bits individually in a subdirectory relevant to the split line. I've tested it on a few examples, but I'll stress-test GBR again and check the shapes where it detects problems. I probably need to tidy up some message levels and comments. Ticker On Wed, 2021-05-26 at 11:17 +0100, Ticker Berkin wrote:
Hi Gerd
I have to design a shape that does this and think what it means. With the extra handling needed for identical opposite lines it will be easy to detect. Maybe possible to just chuck it.
I'm out for the rest of the day so can't do anything until tomorrow.
Ticker
On Wed, 2021-05-26 at 08:46 +0000, Gerd Petermann wrote:
Hi Ticker,
OK, I think your patch improves some cases. I've also fixed another potential cause for these problems with r4744.
I think I have to find a way to avoid those segments which are visited multiple times in the same direction. There's probably always an alternative merge order that avoids this.
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow. Ticker

Hi Ticker, I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is. In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way" Hope this helps. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow. Ticker _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Thanks Gerd, that works for me Ticker On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes. I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Thanks Gerd, that works for me Ticker On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd next patch also has a problem - sorry to waste your time. Can I have your test data. Ticker On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd next patch also has a problem - sorry to waste your time. Can I have your test data. Ticker On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd JOSM gives a self-crossing way validation error on this. Ticker On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd JOSM gives a self-crossing way validation error on this. Ticker On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd JOSM gives a self-crossing way validation error on this. Ticker On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I'm confused. After mp hole cutting and shape merging, I expect a single closed way that will have in/out lines, probably on top of each other, to connect each area that was a hole, eventually, to a point on the outside of the shape. However, JOSM does show the water band on the outside of what were the islands, and on both sides of the joining lines. Ticker On Thu, 2021-05-27 at 15:10 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
JOSM gives a self-crossing way validation error on this.
Ticker
On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, JOSM shows the islands properly when you zoom in. And yes, it shows water on both sides of the connecting lines. Very simiar to the Garmin renderer. Does that help? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I'm confused. After mp hole cutting and shape merging, I expect a single closed way that will have in/out lines, probably on top of each other, to connect each area that was a hole, eventually, to a point on the outside of the shape. However, JOSM does show the water band on the outside of what were the islands, and on both sides of the joining lines. Ticker On Thu, 2021-05-27 at 15:10 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
JOSM gives a self-crossing way validation error on this.
Ticker
On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, I've attached my current state of work as patch for the branch. It fixes some bugs and merges shapes in a way that is less likely to produce long connections to islands. I think the main problem for shape splitter is when such a connection has a U-shape and the cut goes through it horizontally. But I'm just guessing... Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 17:59 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Ticker, JOSM shows the islands properly when you zoom in. And yes, it shows water on both sides of the connecting lines. Very simiar to the Garmin renderer. Does that help? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I'm confused. After mp hole cutting and shape merging, I expect a single closed way that will have in/out lines, probably on top of each other, to connect each area that was a hole, eventually, to a point on the outside of the shape. However, JOSM does show the water band on the outside of what were the islands, and on both sides of the joining lines. Ticker On Thu, 2021-05-27 at 15:10 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
JOSM gives a self-crossing way validation error on this.
Ticker
On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, I've probably not understood the problem before. I've added test code to find situations where the ShapeSplitter complains and I found a rather simple case where the ShapeMerger produces a self-crossing shape (see attached gpx). Now I have an idea what to look for. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 18:14 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Ticker, I've attached my current state of work as patch for the branch. It fixes some bugs and merges shapes in a way that is less likely to produce long connections to islands. I think the main problem for shape splitter is when such a connection has a U-shape and the cut goes through it horizontally. But I'm just guessing... Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 17:59 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Ticker, JOSM shows the islands properly when you zoom in. And yes, it shows water on both sides of the connecting lines. Very simiar to the Garmin renderer. Does that help? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I'm confused. After mp hole cutting and shape merging, I expect a single closed way that will have in/out lines, probably on top of each other, to connect each area that was a hole, eventually, to a point on the outside of the shape. However, JOSM does show the water band on the outside of what were the islands, and on both sides of the joining lines. Ticker On Thu, 2021-05-27 at 15:10 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
JOSM gives a self-crossing way validation error on this.
Ticker
On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd There is something about "water.osm" that is breaking the original logic of ShapeSplitter in a way I'm having trouble understanding. A whole lot of points get assigned to 2 loops. It doesn't seem to be related to multiple identical paths around the cut-line, which should now work correctly with this patch - sorry about the 2 failed attempts yesterday. You mentioned slightly adjusting the high-prec values to help shapeSplitter. I think it best not to do this. You'd have to get it absolutely correct all the way through and, say, in cases where 3 lines follow the same path it becomes impossible. Also the algo it makes some decisions on very fine distinctions in areas which allow it to get rid of spikes and similar and so this wouldn't happen. Patch attached. with INFO/DEBUG enabled, it generates lots of gps traces: original, the various loops either side of the cut-line and all the resultant shapes. Ticker On Fri, 2021-05-28 at 05:03 +0000, Gerd Petermann wrote:
Hi Ticker,
I've probably not understood the problem before. I've added test code to find situations where the ShapeSplitter complains and I found a rather simple case where the ShapeMerger produces a self-crossing shape (see attached gpx). Now I have an idea what to look for.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 18:14 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Ticker,
I've attached my current state of work as patch for the branch. It fixes some bugs and merges shapes in a way that is less likely to produce long connections to islands.
I think the main problem for shape splitter is when such a connection has a U-shape and the cut goes through it horizontally. But I'm just guessing...
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 17:59 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Ticker,
JOSM shows the islands properly when you zoom in. And yes, it shows water on both sides of the connecting lines. Very simiar to the Garmin renderer. Does that help?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I'm confused. After mp hole cutting and shape merging, I expect a single closed way that will have in/out lines, probably on top of each other, to connect each area that was a hole, eventually, to a point on the outside of the shape.
However, JOSM does show the water band on the outside of what were the islands, and on both sides of the joining lines.
Ticker
On Thu, 2021-05-27 at 15:10 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
JOSM gives a self-crossing way validation error on this.
Ticker
On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, yes, we are getting closer ;) Attached is another special case where the splitter claims that something is wrong: SCHWERWIEGEND (ShapeSplitter): e:\xxx\63240001.osm.pbf: splitErrors: 1 on 43536384 true points 1076 area -42018655858 lowest 202035601 http://www.openstreetmap.org/?mlat=67.739804&mlon=14.564171&zoom=17 I don't see anything wrong in the result, though. o_hp.gpx is split into 3 parts s*.gpx Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Freitag, 28. Mai 2021 07:43 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd There is something about "water.osm" that is breaking the original logic of ShapeSplitter in a way I'm having trouble understanding. A whole lot of points get assigned to 2 loops. It doesn't seem to be related to multiple identical paths around the cut-line, which should now work correctly with this patch - sorry about the 2 failed attempts yesterday. You mentioned slightly adjusting the high-prec values to help shapeSplitter. I think it best not to do this. You'd have to get it absolutely correct all the way through and, say, in cases where 3 lines follow the same path it becomes impossible. Also the algo it makes some decisions on very fine distinctions in areas which allow it to get rid of spikes and similar and so this wouldn't happen. Patch attached. with INFO/DEBUG enabled, it generates lots of gps traces: original, the various loops either side of the cut-line and all the resultant shapes. Ticker On Fri, 2021-05-28 at 05:03 +0000, Gerd Petermann wrote:
Hi Ticker,
I've probably not understood the problem before. I've added test code to find situations where the ShapeSplitter complains and I found a rather simple case where the ShapeMerger produces a self-crossing shape (see attached gpx). Now I have an idea what to look for.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 18:14 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Ticker,
I've attached my current state of work as patch for the branch. It fixes some bugs and merges shapes in a way that is less likely to produce long connections to islands.
I think the main problem for shape splitter is when such a connection has a U-shape and the cut goes through it horizontally. But I'm just guessing...
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Donnerstag, 27. Mai 2021 17:59 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Ticker,
JOSM shows the islands properly when you zoom in. And yes, it shows water on both sides of the connecting lines. Very simiar to the Garmin renderer. Does that help?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:48 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I'm confused. After mp hole cutting and shape merging, I expect a single closed way that will have in/out lines, probably on top of each other, to connect each area that was a hole, eventually, to a point on the outside of the shape.
However, JOSM does show the water band on the outside of what were the islands, and on both sides of the joining lines.
Ticker
On Thu, 2021-05-27 at 15:10 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, sure. I've converted a gpx output to OSM. All polygons with holes are not valid OSM ways, but they are very normal as MapShape. Validator doesn't help much with these polygons.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 17:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
JOSM gives a self-crossing way validation error on this.
Ticker
On Thu, 2021-05-27 at 14:53 +0000, Gerd Petermann wrote:
Hi Ticker,
no need to hurry ;) Here is one: https://files.mkgmap.org.uk/download/508/water.osm
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
next patch also has a problem - sorry to waste your time. Can I have your test data.
Ticker
On Thu, 2021-05-27 at 14:33 +0000, Gerd Petermann wrote:
Hi Ticker,
with my current test environment the patch doesn't improve the result. It reports some errors (the old code didn't always detect them) and eithers add or removes parts of the heavily merged shapes.
I've inspected one shape and found no obvious problem. No point is visited more then twice, but 167 points are visited twice. Let me know if you need the data.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 16:09 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Thanks Gerd, that works for me
Ticker
On Thu, 2021-05-27 at 12:54 +0000, Gerd Petermann wrote:
Hi Ticker,
I first convert the gpx layer to a data layer, then add the tag natural=water Next execute validator which will complain that the way is not closed. Right click on that warning allows to "zoom to problem" . This tells you where the first point is.
In the "OSM data" preferences I've enabled "Draw segment order numbers on selected way"
Hope this helps.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 14:21 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
Trying to use JOSM to decide if a gpx trace represents a self -intersecting polygon is difficult. Is there a way of forcing it to consider it closed and then check itself? Failing that, number the points or segments somehow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I'm coming to the conclusion that water.osm is invalid. I've attached an example part. This goes through the cut-line following the same path in and out, and defines both shape and a hole at the same time, which is impossible without the lines crossing. Ticker

Hi Gerd Some of the diags I've added to shapeSplitter might cause exceptions if log.isDebugEnabled() and one of the sides of the split isn't required. I didn't notice this for a while because just looking at the first part and Main doesn't show exception traces. The extra testing and error tracking are becoming unwieldy because of the way it is structured so I think I should enclose it in a class and tidy them up a bit - I'll do this next week. Ticker

Hi Ticker, I thought I already confirmed that the data that was used to produced water.osm was invalid? See http://gis.19327.n8.nabble.com/special-case-where-splitting-fails-without-a-... I've just committed r4746 in the low-res-opt branch, see my comments in the commit message https://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=4746 Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Freitag, 28. Mai 2021 18:24 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I'm coming to the conclusion that water.osm is invalid. I've attached an example part. This goes through the cut-line following the same path in and out, and defines both shape and a hole at the same time, which is impossible without the lines crossing. Ticker

Hi Gerd shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow. Ticker

Hi Ticker, just to make sure: The triangle was connected to the outside. My algo to find holes also failed with that. I also tried a completely different approach using java path with WindingRule.WIND_EVEN_ODD (this is also used in JOSM). Works quite well but is much slower.. I'm back to the idea suggested in TODO: Keep the MP as is and do the splitting once for each level. I've implemented part of this but it only makes sense when the splitting is 100% reliable, else it is possible that huge areas are wrong. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Montag, 31. Mai 2021 18:12 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow. Ticker _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I've added code to deal with some variants of the case as described - I hope this will be enough to cope with more complex shapes generated by ShapeMerger. There might be a bit more I can do without having to resort to more complex geometry analysis if it still gives problems. I've also restructured it a bit. Patch attached based on low-res-opt. Trunk version will be the same (but the patch would be different) Ticker On Mon, 2021-05-31 at 17:12 +0100, Ticker Berkin wrote:
Hi Gerd
shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, please check https://files.mkgmap.org.uk/download/509/special-v5.zip Can you tell me why ShapeSplitter drops some points, e.g the one near 68.2669706, 15.1206053 without complaining? None of the points in the original data is visited more than twice and all highprec equal points are unique. I'm working on an improvement to make the connecting lines shorter, but I don't see yet how I can avoid to have connecting lines like that. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 1. Juni 2021 17:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I've added code to deal with some variants of the case as described - I hope this will be enough to cope with more complex shapes generated by ShapeMerger. There might be a bit more I can do without having to resort to more complex geometry analysis if it still gives problems. I've also restructured it a bit. Patch attached based on low-res-opt. Trunk version will be the same (but the patch would be different) Ticker On Mon, 2021-05-31 at 17:12 +0100, Ticker Berkin wrote:
Hi Gerd
shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I see what you mean. Is this with splitShaeFix_5_lowRes.patch? I'll investigate. Is there an OSM file I can run with? Ticker On Wed, 2021-06-02 at 06:32 +0000, Gerd Petermann wrote:
Hi Ticker,
please check https://files.mkgmap.org.uk/download/509/special-v5.zip
Can you tell me why ShapeSplitter drops some points, e.g the one near 68.2669706, 15.1206053 without complaining? None of the points in the original data is visited more than twice and all highprec equal points are unique.
I'm working on an improvement to make the connecting lines shorter, but I don't see yet how I can avoid to have connecting lines like that.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 1. Juni 2021 17:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I've added code to deal with some variants of the case as described - I hope this will be enough to cope with more complex shapes generated by ShapeMerger.
There might be a bit more I can do without having to resort to more complex geometry analysis if it still gives problems.
I've also restructured it a bit.
Patch attached based on low-res-opt. Trunk version will be the same (but the patch would be different)
Ticker
On Mon, 2021-05-31 at 17:12 +0100, Ticker Berkin wrote:
Hi Gerd
shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I'm thinking this is a problem with high-precision points and the coordPool Ticker On Wed, 2021-06-02 at 10:23 +0100, Ticker Berkin wrote:
Hi Gerd
I see what you mean. Is this with splitShaeFix_5_lowRes.patch? I'll investigate. Is there an OSM file I can run with?
Ticker
On Wed, 2021-06-02 at 06:32 +0000, Gerd Petermann wrote:
Hi Ticker,
please check https://files.mkgmap.org.uk/download/509/special-v5.zip
Can you tell me why ShapeSplitter drops some points, e.g the one near 68.2669706, 15.1206053 without complaining? None of the points in the original data is visited more than twice and all highprec equal points are unique.
I'm working on an improvement to make the connecting lines shorter, but I don't see yet how I can avoid to have connecting lines like that.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 1. Juni 2021 17:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I've added code to deal with some variants of the case as described - I hope this will be enough to cope with more complex shapes generated by ShapeMerger.
There might be a bit more I can do without having to resort to more complex geometry analysis if it still gives problems.
I've also restructured it a bit.
Patch attached based on low-res-opt. Trunk version will be the same (but the patch would be different)
Ticker
On Mon, 2021-05-31 at 17:12 +0100, Ticker Berkin wrote:
Hi Gerd
shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, yes, was with splitShapeFix_5_lowRes.patch I've just noticed that s_3 and s_4 were from a different split. The shape was the result of various steps with "too small island removal" and "cut again after full merge". Maybe you can reproduce with the attached file. I've loaded the gpx into JOSM, fixed the duplicated points and used Shift+J (join overlapping areas) Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 2. Juni 2021 11:23 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I see what you mean. Is this with splitShaeFix_5_lowRes.patch? I'll investigate. Is there an OSM file I can run with? Ticker On Wed, 2021-06-02 at 06:32 +0000, Gerd Petermann wrote:
Hi Ticker,
please check https://files.mkgmap.org.uk/download/509/special-v5.zip
Can you tell me why ShapeSplitter drops some points, e.g the one near 68.2669706, 15.1206053 without complaining? None of the points in the original data is visited more than twice and all highprec equal points are unique.
I'm working on an improvement to make the connecting lines shorter, but I don't see yet how I can avoid to have connecting lines like that.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 1. Juni 2021 17:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I've added code to deal with some variants of the case as described - I hope this will be enough to cope with more complex shapes generated by ShapeMerger.
There might be a bit more I can do without having to resort to more complex geometry analysis if it still gives problems.
I've also restructured it a bit.
Patch attached based on low-res-opt. Trunk version will be the same (but the patch would be different)
Ticker
On Mon, 2021-05-31 at 17:12 +0100, Ticker Berkin wrote:
Hi Gerd
shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I was beginning to suspect this - there were 2 very close cut-lines which is why I thought coords were not behaving. I've reproduced with the .osm and am investigating Ticker On Wed, 2021-06-02 at 09:50 +0000, Gerd Petermann wrote:
Hi Ticker,
yes, was with splitShapeFix_5_lowRes.patch I've just noticed that s_3 and s_4 were from a different split. The shape was the result of various steps with "too small island removal" and "cut again after full merge".
Maybe you can reproduce with the attached file. I've loaded the gpx into JOSM, fixed the duplicated points and used Shift+J (join overlapping areas)
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 2. Juni 2021 11:23 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I see what you mean. Is this with splitShaeFix_5_lowRes.patch? I'll investigate. Is there an OSM file I can run with?
Ticker
On Wed, 2021-06-02 at 06:32 +0000, Gerd Petermann wrote:
Hi Ticker,
please check https://files.mkgmap.org.uk/download/509/special-v5.zip
Can you tell me why ShapeSplitter drops some points, e.g the one near 68.2669706, 15.1206053 without complaining? None of the points in the original data is visited more than twice and all highprec equal points are unique.
I'm working on an improvement to make the connecting lines shorter, but I don't see yet how I can avoid to have connecting lines like that.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Dienstag, 1. Juni 2021 17:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I've added code to deal with some variants of the case as described - I hope this will be enough to cope with more complex shapes generated by ShapeMerger.
There might be a bit more I can do without having to resort to more complex geometry analysis if it still gives problems.
I've also restructured it a bit.
Patch attached based on low-res-opt. Trunk version will be the same (but the patch would be different)
Ticker
On Mon, 2021-05-31 at 17:12 +0100, Ticker Berkin wrote:
Hi Gerd
shapeSplitter will have problems (ie get it wrong some of the time) where there are in/out lines to a hole that share the same cut point as a line that is the boundary between a shape and hole; could be many holes (or shapes) and many lines. The simple sort/dedupe I was doing isn't adequate. I'll come up with something better tomorrow.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd I've found and fixed some stupid mistakes - sorry for wasting your time. Patch attached - works with your test case. Ticker

Hi Ticker, That seems to work better. I still see some error messages but those are probably really invalid shapes produced by ShapeMerger. At least I see that one point is visited more than twice and that should not happen. Maybe you can add unit tests to test the error cases? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 2. Juni 2021 16:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message Hi Gerd I've found and fixed some stupid mistakes - sorry for wasting your time. Patch attached - works with your test case. Ticker

Hi Gerd Thinking about this a bit more, there are still some cases where adjacent shapes are next to cut-lines to get to holes (ie 3 or more lines at same cut-point) that might not be ordered correctly. I think it is possible to fix these by adding another sort structure. Starting on this, I didn't like some of my new awkward shape handling code and it has is a bug in the handling of the last element in the list - fixed in the tidy-up I've attached low-res-opt patch Ticker On Wed, 2021-06-02 at 14:58 +0000, Gerd Petermann wrote:
Hi Ticker,
That seems to work better. I still see some error messages but those are probably really invalid shapes produced by ShapeMerger. At least I see that one point is visited more than twice and that should not happen.
Maybe you can add unit tests to test the error cases?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 2. Juni 2021 16:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I've found and fixed some stupid mistakes - sorry for wasting your time.
Patch attached - works with your test case.
Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd Found stupid mistake, updated patch attached. Also, if debug enabled, always splits both sides of the line, and, if both sides are collected to the same list, just gives 1 gpx trace for it. Ticker On Thu, 2021-05-27 at 10:54 +0000, Gerd Petermann wrote:
Hi Ticker,
sounds good. I'm making progress with a better ShapeMerger that produces less jitter, but so far it still produces some. Will try it later..
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 27. Mai 2021 12:49 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] special case where splitting fails without a log message
Hi Gerd
I think this can cope with any number of lines, in either/both directions, following the same path. Also it should give better output if same number of lines in both directions.
With debug, if it notices a problem, it generates a GPX trace of the original and traces of all the resultant bits individually in a subdirectory relevant to the split line.
I've tested it on a few examples, but I'll stress-test GBR again and check the shapes where it detects problems.
I probably need to tidy up some message levels and comments.
Ticker
On Wed, 2021-05-26 at 11:17 +0100, Ticker Berkin wrote:
Hi Gerd
I have to design a shape that does this and think what it means. With the extra handling needed for identical opposite lines it will be easy to detect. Maybe possible to just chuck it.
I'm out for the rest of the day so can't do anything until tomorrow.
Ticker
On Wed, 2021-05-26 at 08:46 +0000, Gerd Petermann wrote:
Hi Ticker,
OK, I think your patch improves some cases. I've also fixed another potential cause for these problems with r4744.
I think I have to find a way to avoid those segments which are visited multiple times in the same direction. There's probably always an alternative merge order that avoids this.
Gerd
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (4)
-
Gerd Petermann
-
Gerd Petermann
-
Ticker Berkin
-
Ticker Berkin