[mkgmap-dev] Splitter only writes points, not ways on huge file?

2021-05-27 Thread Felix Hartmann
I used phyghtmap to create a huge file (60GB) of 10m equidistance osm.pbf
contourlines data.

phyghtmap --jobs=2 --polygon=/home/contourlines/bounds/asia.poly --step=10
 --no-zero-contour --void-range-max=-420 --output-prefix="Asia10m"
--line-cat=500,100--start-node-id=1000 --start-way-id=1000
--source=view1,srtm1,view3,srtm3 --max-nodes-per-way=230
--max-nodes-per-tile=0 --pbf

I am not fully sure that this pbf file is correct, but I created it exactly
the same way as smaller countries. Maybe its also phyghtmap going wrong.
But I doubt it with phyghtmaps incremental approach of just constantly
writing out data.

When splitting it with splitter - and opening up one of the osm.pbf files
in JOSM - I noticed it contains only the contourline nodes, no lines.
I think the Asia continent file spans 360 degrees - so maybe that causes
problems with splitter?



I have uploaded a splitted file here:
https://openmtbmap.org/75400407.osm.pbf
If you load it in Josm, you will notice it is alll the points but no
lines...

-- 
Felix Hartman - Openmtbmap.org & VeloMap.org
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
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 +, 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  im Auftrag
> von Gerd Petermann 
> 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  im Auftrag
> von Gerd Petermann 
> 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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 +, 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
> > > > 
> > > > 

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Gerd 
Petermann 
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  im Auftrag von Gerd 
Petermann 
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  im Auftrag von Ticker 
Berkin 
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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 +, 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  im
> > > > Auftrag
> > > > von Ticker Berkin 
> > > > 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 

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Gerd 
Petermann 
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  im Auftrag von Ticker 
Berkin 
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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 +, 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  im
> > > > Auftrag
> > > > von Ticker Berkin 
> > > > 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 

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Ticker 
Berkin 
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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 +, 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  im
> > > > Auftrag
> > > > von Ticker Berkin 
> > > > 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
> > 

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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 +, 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  im
> > > > Auftrag
> > > > von Ticker Berkin 
> > > > 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
> 

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Ticker 
Berkin 
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
Hi Gerd

JOSM gives a self-crossing way validation error on this.

Ticker

On Thu, 2021-05-27 at 14:53 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
Hi Gerd

JOSM gives a self-crossing way validation error on this.

Ticker

On Thu, 2021-05-27 at 14:53 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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 +, 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  im
> > > Auftrag
> > > von Ticker Berkin 
> > > 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
Hi Ticker,

no need to hurry ;)
Here is one:
https://files.mkgmap.org.uk/download/508/water.osm

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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  im Auftrag
> > von Ticker Berkin 
> > 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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 +, 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-devIndex: src/uk/me/parabola/util/ShapeSplitter.java
===
--- src/uk/me/parabola/util/ShapeSplitter.java	(revision 4745)
+++ src/uk/me/parabola/util/ShapeSplitter.java	(working copy)
@@ -12,21 +12,20 @@
  */
 package uk.me.parabola.util;
 
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
 import java.awt.Shape;
 import java.awt.geom.Path2D;
 import java.awt.geom.PathIterator;
 import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
-// RWB new bits
-import java.util.ArrayList;
-import java.util.List;
-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
 import uk.me.parabola.imgfmt.Utils;
 import uk.me.parabola.imgfmt.app.Area;
 import uk.me.parabola.imgfmt.app.Coord;
-
 import uk.me.parabola.log.Logger;
+import uk.me.parabola.util.GpxCreator;
 
 public class ShapeSplitter {
 	private static final Logger log = Logger.getLogger(ShapeSplitter.class);
@@ -321,14 +320,15 @@
 	 * @param origList list of shapes to which we append new shapes formed from above
 	 * @param fullArea of orig polygon. used for sign and handling of last line segment
 	 */
-	private static void processLineList(List lineInfo, List> origList, long fullArea) {
+	private static int processLineList(List lineInfo, List> origList, long fullArea) {
+		int errorCount = 0;
 		if (origList == null) // never wanted this side
-			return;
+			return errorCount;
 		MergeCloseHelper firstLine = lineInfo.get(0);
 		if (lineInfo.size() == 1) { // single shape that never crossed line
 			if (!firstLine.points.isEmpty()) // all on this side
 firstLine.closeAppend(origList, false);
-			return;
+			return errorCount;
 		}
 		// look at last item in list of lines
 		MergeCloseHelper lastLine = lineInfo.get(lineInfo.size()-1);
@@ -343,7 +343,7 @@
 		if (lineInfo.size() == 1) { // simple poly that crossed once and back
 			firstLine.setMoreInfo(0);
 			firstLine.closeAppend(origList, true);
-			return;
+			return errorCount;
 		}
 		// Above were the simple cases - probably 99% of calls.
 
@@ -360,7 +360,7 @@
 		boolean someDirectionsNotSet = false;
 		int areaDirection = 0;
 		String diagMsg = "";
- 		for (MergeCloseHelper thisLine : lineInfo) {
+		for (MergeCloseHelper thisLine : lineInfo) {
 			thisLine.setMoreInfo(fullAreaSign);
 			if (thisLine.direction == 0)
 someDirectionsNotSet = true;
@@ -382,20 +382,58 @@
 		}
 		if (!diagMsg.isEmpty()) {
 			log.warn(diagMsg, "Probably self-intersecting polygon", 

Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Ticker 
Berkin 
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 +, 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  im Auftrag
> von Ticker Berkin 
> 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
Thanks Gerd, that works for me

Ticker

On Thu, 2021-05-27 at 12:54 +, 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  im Auftrag
> von Ticker Berkin 
> 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Ticker 
Berkin 
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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Gerd Petermann
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  im Auftrag von Ticker 
Berkin 
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 +, 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


Re: [mkgmap-dev] special case where splitting fails without a log message

2021-05-27 Thread Ticker Berkin
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 +, 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-devIndex: src/uk/me/parabola/util/ShapeSplitter.java
===
--- src/uk/me/parabola/util/ShapeSplitter.java	(revision 4745)
+++ src/uk/me/parabola/util/ShapeSplitter.java	(working copy)
@@ -12,21 +12,20 @@
  */
 package uk.me.parabola.util;
 
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
 import java.awt.Shape;
 import java.awt.geom.Path2D;
 import java.awt.geom.PathIterator;
 import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 
-// RWB new bits
-import java.util.ArrayList;
-import java.util.List;
-import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
 import uk.me.parabola.imgfmt.Utils;
 import uk.me.parabola.imgfmt.app.Area;
 import uk.me.parabola.imgfmt.app.Coord;
-
 import uk.me.parabola.log.Logger;
+import uk.me.parabola.util.GpxCreator;
 
 public class ShapeSplitter {
 	private static final Logger log = Logger.getLogger(ShapeSplitter.class);
@@ -321,14 +320,15 @@
 	 * @param origList list of shapes to which we append new shapes formed from above
 	 * @param fullArea of orig polygon. used for sign and handling of last line segment
 	 */
-	private static void processLineList(List lineInfo, List> origList, long fullArea) {
+	private static int processLineList(List lineInfo, List> origList, long fullArea) {
+		int errorCount = 0;
 		if (origList == null) // never wanted this side
-			return;
+			return errorCount;
 		MergeCloseHelper firstLine = lineInfo.get(0);
 		if (lineInfo.size() == 1) { // single shape that never crossed line
 			if (!firstLine.points.isEmpty()) // all on this side
 firstLine.closeAppend(origList, false);
-			return;
+			return errorCount;
 		}
 		// look at last item in list of lines
 		MergeCloseHelper lastLine = lineInfo.get(lineInfo.size()-1);
@@ -343,7 +343,7 @@
 		if (lineInfo.size() == 1) { // simple poly that crossed once and back
 			firstLine.setMoreInfo(0);
 			firstLine.closeAppend(origList, true);
-			return;
+			return errorCount;
 		}
 		// Above were the simple cases - probably 99% of calls.
 
@@ -360,7 +360,7 @@
 		boolean someDirectionsNotSet = false;
 		int areaDirection = 0;
 		String diagMsg = "";
- 		for (MergeCloseHelper thisLine : lineInfo) {
+		for (MergeCloseHelper thisLine : lineInfo) {
 			thisLine.setMoreInfo(fullAreaSign);
 			if (thisLine.direction == 0)
 someDirectionsNotSet = true;
@@ -382,20 +382,58 @@
 		}
 		if (!diagMsg.isEmpty()) {
 			log.warn(diagMsg, "Probably self-intersecting polygon", fullAreaSign, someDirectionsNotSet, areaDirection);
-			for (MergeCloseHelper thisLine : lineInfo) {
-log.warn(thisLine);
-if (log.isDebugEnabled())
-	for (Coord co : thisLine.points)
-		log.debug("line", co, co.getHighPrecLat(), co.getHighPrecLon());
-			}
+			++errorCount;
 		}
 
 		lineInfo.sort(null);
+		errorCount += processDups(lineInfo);
 
 		int dummy = doLines(0, Integer.MAX_VALUE, null, lineInfo, origList);
 		assert dummy == lineInfo.size();
+		for (MergeCloseHelper thisLine : lineInfo)
+			errorCount += thisLine.errorCount;
+		return errorCount;
 	} // processLineList
 
+	private static int processDups(List lineInfo) {
+		// find groups of duplicates, drop equal numbers of different direction (ie keep just 1)
+		int errorCount = 0; // shouldn't be any
+		List newList = new ArrayList<>(lineInfo.size());
+		MergeCloseHelper forwardLine = null, backwardLine = null, lastIfDup = null;
+		int directionBalance = 0;
+		for (MergeCloseHelper