mkgmap r2179: Still NullPointerException in BoundaryUtil

Hi, I compiled mkgmap r2179 and tried to create the bounds files with it: osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1 Thorsten -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

Hi Thorsten, I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero. It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away. I am not sure if WanMil is already working on this? Gerd Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi WanMil, I have coded a small test that tries to detect these "spike-like" areas. Idea: If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area. I am not sure regarding the threshold value, but I think the principle is ok. What do you think? Gerd
Date: Tue, 24 Jan 2012 08:04:47 -0800 From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, On Tue, Jan 24, Gerd Petermann wrote:
Hi WanMil,
I have coded a small test that tries to detect these "spike-like" areas. Idea: If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area.
This patch does at least not fix my problem, still get exact the same stack trace. Thorsten
I am not sure regarding the threshold value, but I think the principle is ok. What do you think?
Gerd
Date: Tue, 24 Jan 2012 08:04:47 -0800 From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

Hi Thorsten, don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere. Gerd
Date: Tue, 24 Jan 2012 22:57:19 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi WanMil,
I have coded a small test that tries to detect these "spike-like" areas. Idea: If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area.
This patch does at least not fix my problem, still get exact the same stack trace.
Thorsten
I am not sure regarding the threshold value, but I think the principle is ok. What do you think?
Gerd
Date: Tue, 24 Jan 2012 08:04:47 -0800 From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere.
Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :( Thorsten
Date: Tue, 24 Jan 2012 22:57:19 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi WanMil,
I have coded a small test that tries to detect these "spike-like" areas. Idea: If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area.
This patch does at least not fix my problem, still get exact the same stack trace.
Thorsten
I am not sure regarding the threshold value, but I think the principle is ok. What do you think?
Gerd
Date: Tue, 24 Jan 2012 08:04:47 -0800 From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

Hi Thorsten, please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files. ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere.
Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
Date: Tue, 24 Jan 2012 22:57:19 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi WanMil,
I have coded a small test that tries to detect these "spike-like" areas. Idea: If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area.
This patch does at least not fix my problem, still get exact the same stack trace.
Thorsten
I am not sure regarding the threshold value, but I think the principle is ok. What do you think?
Gerd
Date: Tue, 24 Jan 2012 08:04:47 -0800 From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files.
Hm, somehow I'm not able to apply the patch, I only got rejects, but the patch should fit ...
ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere.
Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
Date: Tue, 24 Jan 2012 22:57:19 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi WanMil,
I have coded a small test that tries to detect these "spike-like" areas. Idea: If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area.
This patch does at least not fix my problem, still get exact the same stack trace.
Thorsten
I am not sure regarding the threshold value, but I think the principle is ok. What do you think?
Gerd
Date: Tue, 24 Jan 2012 08:04:47 -0800 From: gpetermann_muenchen@hotmail.com To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote > > Hi, > > I compiled mkgmap r2179 and tried to create the bounds files with > it: > > osmconvert data/planet/planet-120122.osm.pbf --out-o5m > osmfilter data/boundaries/world-20120122.o5m --keep-nodes= > '--keep-ways-relations=boundary=administrative =postal_code postal_code=' > mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz > --bounds=data/boundaries/20120122 > Schwerwiegend (BoundarySaver): Calculate bbox to > (-90.12222290039062,-180.24444580078125) to > (82.6120376586914,179.17156219482422) > Exception in thread "main" java.lang.NullPointerException > at > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) > at > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) > at > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) > at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) > at > uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) > at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) > Command exited with non-zero status 1 > > > Thorsten > > -- > Thorsten Kukuk, Project Manager/Release Manager SLES > SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@.org > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

hmm, I just tested it on a clean trunk src without problems. Gerd Thorsten Kukuk wrote
On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files.
Hm, somehow I'm not able to apply the patch, I only got rejects, but the patch should fit ...
ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called
anywhere.
Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
Date: Tue, 24 Jan 2012 22:57:19 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException
in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi WanMil,
I have coded a small test that tries to detect these "spike-like"
areas. Idea:
If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove the way from the area.
This patch does at least not fix my problem, still get exact the same stack trace.
Thorsten
I am not sure regarding the threshold value, but I think the principle is ok. What do you think?
Gerd
> Date: Tue, 24 Jan 2012 08:04:47 -0800 > From: gpetermann_muenchen@ > To: mkgmap-dev@.org > Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil > > Hi Thorsten, > > I can confirm this problem. I can repdroduce it with a "boundary" which > contains these 4 points: > [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] > The Way.clockwise() method says it is counter-clockwise. > Besides rounding errors, it is a line, not a shape, and I guess that causes > the problem. The clockwise() method calculates an area size of 3, which is > almost zero. > > It is quite likely that the intersection of two areas produces these "nearly > empty" (parts of) areas, what we need is a filter that throws them away. > > I am not sure if WanMil is already working on this? > > Gerd > > > Thorsten Kukuk wrote > > > > Hi, > > > > I compiled mkgmap r2179 and tried to create the bounds files with > > it: > > > > osmconvert data/planet/planet-120122.osm.pbf --out-o5m > > osmfilter data/boundaries/world-20120122.o5m --keep-nodes= > > '--keep-ways-relations=boundary=administrative =postal_code postal_code=' > > mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz > > --bounds=data/boundaries/20120122 > > Schwerwiegend (BoundarySaver): Calculate bbox to > > (-90.12222290039062,-180.24444580078125) to > > (82.6120376586914,179.17156219482422) > > Exception in thread "main" java.lang.NullPointerException > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) > > at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) > > at > > uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) > > at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) > > Command exited with non-zero status 1 > > > > > > Thorsten > > > > -- > > Thorsten Kukuk, Project Manager/Release Manager SLES > > SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg > > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) > > _______________________________________________ > > mkgmap-dev mailing list > > mkgmap-dev@.org > > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > > > > > -- > View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... > Sent from the Mkgmap Development mailing list archive at Nabble.com. > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@.org > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/mkgmap-r2179-Still-NullPointerException-in-Bo... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi, I'm also getting rejects using fresh checked out from trunk and applying this patch. I'm using Ubuntu (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java Hunk #1 FAILED at 92. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java Hunk #1 FAILED at 45. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java Hunk #1 FAILED at 22. Hunk #2 FAILED at 293. Hunk #3 FAILED at 313. 3 out of 3 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java Hunk #1 FAILED at 35. Hunk #2 FAILED at 46. Hunk #3 FAILED at 67. Hunk #4 FAILED at 84. Hunk #5 FAILED at 138. 5 out of 5 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/FloatCoord.java (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/Java2DConverter.java Hunk #1 FAILED at 213. //Martin Am 2012-01-26 11:38, schrieb GerdP:
hmm, I just tested it on a clean trunk src without problems.
Gerd
Thorsten Kukuk wrote
On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files. Hm, somehow I'm not able to apply the patch, I only got rejects, but the patch should fit ...
ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere. Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
Date: Tue, 24 Jan 2012 22:57:19 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
> Hi WanMil, > > I have coded a small test that tries to detect these "spike-like" areas. Idea: > If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove > the way from the area. This patch does at least not fix my problem, still get exact the same stack trace.
Thorsten
> I am not sure regarding the threshold value, but I think the principle is ok. > What do you think? > > Gerd > > >> Date: Tue, 24 Jan 2012 08:04:47 -0800 >> From: gpetermann_muenchen@ >> To: mkgmap-dev@.org >> Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil >> Hi Thorsten, >> >> I can confirm this problem. I can repdroduce it with a "boundary" which >> contains these 4 points: >> [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] >> The Way.clockwise() method says it is counter-clockwise. >> Besides rounding errors, it is a line, not a shape, and I guess that causes >> the problem. The clockwise() method calculates an area size of 3, which is >> almost zero. >> >> It is quite likely that the intersection of two areas produces these "nearly >> empty" (parts of) areas, what we need is a filter that throws them away. >> I am not sure if WanMil is already working on this? >> >> Gerd >> >> >> Thorsten Kukuk wrote >>> Hi, >>> >>> I compiled mkgmap r2179 and tried to create the bounds files with >>> it: >>> >>> osmconvert data/planet/planet-120122.osm.pbf --out-o5m >>> osmfilter data/boundaries/world-20120122.o5m --keep-nodes= >>> '--keep-ways-relations=boundary=administrative =postal_code postal_code=' >>> mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz >>> --bounds=data/boundaries/20120122 >>> Schwerwiegend (BoundarySaver): Calculate bbox to >>> (-90.12222290039062,-180.24444580078125) to >>> (82.6120376586914,179.17156219482422) >>> Exception in thread "main" java.lang.NullPointerException >>> at >>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) >>> at >>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) >>> at >>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) >>> at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) >>> at >>> uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) >>> at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) >>> Command exited with non-zero status 1 >>> >>> >>> Thorsten >>> >>> -- >>> Thorsten Kukuk, Project Manager/Release Manager SLES >>> SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg >>> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) >>> _______________________________________________ >>> mkgmap-dev mailing list >>> mkgmap-dev@.org >>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >>> >> >> -- >> View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... >> Sent from the Mkgmap Development mailing list archive at Nabble.com. >> _______________________________________________ >> mkgmap-dev mailing list >> mkgmap-dev@.org >> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@.org > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/mkgmap-r2179-Still-NullPointerException-in-Bo... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi, attached is a new patch I made, the formating isn't 100% ok, but for testing, it should be enough. Thorsten On Thu, Jan 26, Martin wrote:
Hi,
I'm also getting rejects using fresh checked out from trunk and applying this patch. I'm using Ubuntu
(Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java Hunk #1 FAILED at 92. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java Hunk #1 FAILED at 45. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java Hunk #1 FAILED at 22. Hunk #2 FAILED at 293. Hunk #3 FAILED at 313. 3 out of 3 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java Hunk #1 FAILED at 35. Hunk #2 FAILED at 46. Hunk #3 FAILED at 67. Hunk #4 FAILED at 84. Hunk #5 FAILED at 138. 5 out of 5 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/FloatCoord.java (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/Java2DConverter.java Hunk #1 FAILED at 213.
//Martin
Am 2012-01-26 11:38, schrieb GerdP:
hmm, I just tested it on a clean trunk src without problems.
Gerd
Thorsten Kukuk wrote
On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files. Hm, somehow I'm not able to apply the patch, I only got rejects, but the patch should fit ...
ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere. Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
> Date: Tue, 24 Jan 2012 22:57:19 +0100 > From: kukuk@ > To: mkgmap-dev@.org > Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil > > Hi Gerd, > > On Tue, Jan 24, Gerd Petermann wrote: > >> Hi WanMil, >> >> I have coded a small test that tries to detect these "spike-like" areas. Idea: >> If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove >> the way from the area. > This patch does at least not fix my problem, still get exact the > same stack trace. > > Thorsten > > >> I am not sure regarding the threshold value, but I think the principle is ok. >> What do you think? >> >> Gerd >> >> >>> Date: Tue, 24 Jan 2012 08:04:47 -0800 >>> From: gpetermann_muenchen@ >>> To: mkgmap-dev@.org >>> Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil >>> Hi Thorsten, >>> >>> I can confirm this problem. I can repdroduce it with a "boundary" which >>> contains these 4 points: >>> [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] >>> The Way.clockwise() method says it is counter-clockwise. >>> Besides rounding errors, it is a line, not a shape, and I guess that causes >>> the problem. The clockwise() method calculates an area size of 3, which is >>> almost zero. >>> >>> It is quite likely that the intersection of two areas produces these "nearly >>> empty" (parts of) areas, what we need is a filter that throws them away. >>> I am not sure if WanMil is already working on this? >>> >>> Gerd >>> >>> >>> Thorsten Kukuk wrote >>>> Hi, >>>> >>>> I compiled mkgmap r2179 and tried to create the bounds files with >>>> it: >>>> >>>> osmconvert data/planet/planet-120122.osm.pbf --out-o5m >>>> osmfilter data/boundaries/world-20120122.o5m --keep-nodes= >>>> '--keep-ways-relations=boundary=administrative =postal_code postal_code=' >>>> mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz >>>> --bounds=data/boundaries/20120122 >>>> Schwerwiegend (BoundarySaver): Calculate bbox to >>>> (-90.12222290039062,-180.24444580078125) to >>>> (82.6120376586914,179.17156219482422) >>>> Exception in thread "main" java.lang.NullPointerException >>>> at >>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) >>>> at >>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) >>>> at >>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) >>>> at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) >>>> at >>>> uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) >>>> at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) >>>> Command exited with non-zero status 1 >>>> >>>> >>>> Thorsten >>>> >>>> -- >>>> Thorsten Kukuk, Project Manager/Release Manager SLES >>>> SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg >>>> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) >>>> _______________________________________________ >>>> mkgmap-dev mailing list >>>> mkgmap-dev@.org >>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >>>> >>> >>> -- >>> View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... >>> Sent from the Mkgmap Development mailing list archive at Nabble.com. >>> _______________________________________________ >>> mkgmap-dev mailing list >>> mkgmap-dev@.org >>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >> >> _______________________________________________ >> mkgmap-dev mailing list >> mkgmap-dev@.org >> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > -- > Thorsten Kukuk, Project Manager/Release Manager SLES > SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@.org > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/mkgmap-r2179-Still-NullPointerException-in-Bo... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

Hi Thorsten, it seems thatmy tortoisesvn cannot produce patches that are accepted on linux. Do you have a hint for me what to do ? Gerd Date: Thu, 26 Jan 2012 11:54:48 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil Hi, attached is a new patch I made, the formating isn't 100% ok, but for testing, it should be enough. Thorsten On Thu, Jan 26, Martin wrote:
Hi,
I'm also getting rejects using fresh checked out from trunk and applying this patch. I'm using Ubuntu
(Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java Hunk #1 FAILED at 92. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java Hunk #1 FAILED at 45. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java Hunk #1 FAILED at 22. Hunk #2 FAILED at 293. Hunk #3 FAILED at 313. 3 out of 3 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java Hunk #1 FAILED at 35. Hunk #2 FAILED at 46. Hunk #3 FAILED at 67. Hunk #4 FAILED at 84. Hunk #5 FAILED at 138. 5 out of 5 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/FloatCoord.java (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/Java2DConverter.java Hunk #1 FAILED at 213.
//Martin
Am 2012-01-26 11:38, schrieb GerdP:
hmm, I just tested it on a clean trunk src without problems.
Gerd
Thorsten Kukuk wrote
On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files. Hm, somehow I'm not able to apply the patch, I only got rejects, but the patch should fit ...
ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
Hi Thorsten,
don't worry, the patch was not meant to fix your problem. It just adds a method to class Way, but the method is not even called anywhere. Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
> Date: Tue, 24 Jan 2012 22:57:19 +0100 > From: kukuk@ > To: mkgmap-dev@.org > Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil > > Hi Gerd, > > On Tue, Jan 24, Gerd Petermann wrote: > >> Hi WanMil, >> >> I have coded a small test that tries to detect these "spike-like" areas. Idea: >> If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove >> the way from the area. > This patch does at least not fix my problem, still get exact the > same stack trace. > > Thorsten > > >> I am not sure regarding the threshold value, but I think the principle is ok. >> What do you think? >> >> Gerd >> >> >>> Date: Tue, 24 Jan 2012 08:04:47 -0800 >>> From: gpetermann_muenchen@ >>> To: mkgmap-dev@.org >>> Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil >>> Hi Thorsten, >>> >>> I can confirm this problem. I can repdroduce it with a "boundary" which >>> contains these 4 points: >>> [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] >>> The Way.clockwise() method says it is counter-clockwise. >>> Besides rounding errors, it is a line, not a shape, and I guess that causes >>> the problem. The clockwise() method calculates an area size of 3, which is >>> almost zero. >>> >>> It is quite likely that the intersection of two areas produces these "nearly >>> empty" (parts of) areas, what we need is a filter that throws them away. >>> I am not sure if WanMil is already working on this? >>> >>> Gerd >>> >>> >>> Thorsten Kukuk wrote >>>> Hi, >>>> >>>> I compiled mkgmap r2179 and tried to create the bounds files with >>>> it: >>>> >>>> osmconvert data/planet/planet-120122.osm.pbf --out-o5m >>>> osmfilter data/boundaries/world-20120122.o5m --keep-nodes= >>>> '--keep-ways-relations=boundary=administrative =postal_code postal_code=' >>>> mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz >>>> --bounds=data/boundaries/20120122 >>>> Schwerwiegend (BoundarySaver): Calculate bbox to >>>> (-90.12222290039062,-180.24444580078125) to >>>> (82.6120376586914,179.17156219482422) >>>> Exception in thread "main" java.lang.NullPointerException >>>> at >>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) >>>> at >>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) >>>> at >>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) >>>> at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) >>>> at >>>> uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) >>>> at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) >>>> Command exited with non-zero status 1 >>>> >>>> >>>> Thorsten >>>> >>>> -- >>>> Thorsten Kukuk, Project Manager/Release Manager SLES >>>> SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg >>>> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) >>>> _______________________________________________ >>>> mkgmap-dev mailing list >>>> mkgmap-dev@.org >>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >>>> >>> >>> -- >>> View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... >>> Sent from the Mkgmap Development mailing list archive at Nabble.com. >>> _______________________________________________ >>> mkgmap-dev mailing list >>> mkgmap-dev@.org >>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >> >> _______________________________________________ >> mkgmap-dev mailing list >> mkgmap-dev@.org >> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > -- > Thorsten Kukuk, Project Manager/Release Manager SLES > SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@.org > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/mkgmap-r2179-Still-NullPointerException-in-Bo... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On Sat, Feb 04, Gerd Petermann wrote:
Hi Thorsten,
it seems thatmy tortoisesvn cannot produce patches that are accepted on linux. Do you have a hint for me what to do ?
Sorry, no, I wasn't able to find out what exactly the linux patch utility did not like on the patches. Thorsten
Gerd
Date: Thu, 26 Jan 2012 11:54:48 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi,
attached is a new patch I made, the formating isn't 100% ok, but for testing, it should be enough.
Thorsten
On Thu, Jan 26, Martin wrote:
Hi,
I'm also getting rejects using fresh checked out from trunk and applying this patch. I'm using Ubuntu
(Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java Hunk #1 FAILED at 92. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/Boundary.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java Hunk #1 FAILED at 45. 1 out of 1 hunk FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryElement.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java Hunk #1 FAILED at 22. Hunk #2 FAILED at 293. Hunk #3 FAILED at 313. 3 out of 3 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundarySaver.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java Hunk #1 FAILED at 35. Hunk #2 FAILED at 46. Hunk #3 FAILED at 67. Hunk #4 FAILED at 84. Hunk #5 FAILED at 138. 5 out of 5 hunks FAILED -- saving rejects to file src/uk/me/parabola/mkgmap/reader/osm/boundary/BoundaryUtil.java.rej (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/FloatCoord.java (Stripping trailing CRs from patch.) patching file src/uk/me/parabola/util/Java2DConverter.java Hunk #1 FAILED at 213.
//Martin
Am 2012-01-26 11:38, schrieb GerdP:
hmm, I just tested it on a clean trunk src without problems.
Gerd
Thorsten Kukuk wrote
On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed. If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files. Hm, somehow I'm not able to apply the patch, I only got rejects, but the patch should fit ...
ciao, Gerd
Date: Wed, 25 Jan 2012 08:11:30 +0100 From: kukuk@ To: mkgmap-dev@.org Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi Gerd,
On Tue, Jan 24, Gerd Petermann wrote:
> Hi Thorsten, > > don't worry, the patch was not meant to fix your problem. > It just adds a method to class Way, but the method is not even called anywhere. Sorry, was clearly too late yesterday for me, I should have seen that the new method isn't called anywhere :(
Thorsten
>> Date: Tue, 24 Jan 2012 22:57:19 +0100 >> From: kukuk@ >> To: mkgmap-dev@.org >> Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil >> >> Hi Gerd, >> >> On Tue, Jan 24, Gerd Petermann wrote: >> >>> Hi WanMil, >>> >>> I have coded a small test that tries to detect these "spike-like" areas. Idea: >>> If the area size is much smaller (I used 20 as a threshold) than that of the bounding box we should remove >>> the way from the area. >> This patch does at least not fix my problem, still get exact the >> same stack trace. >> >> Thorsten >> >> >>> I am not sure regarding the threshold value, but I think the principle is ok. >>> What do you think? >>> >>> Gerd >>> >>> >>>> Date: Tue, 24 Jan 2012 08:04:47 -0800 >>>> From: gpetermann_muenchen@ >>>> To: mkgmap-dev@.org >>>> Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil >>>> Hi Thorsten, >>>> >>>> I can confirm this problem. I can repdroduce it with a "boundary" which >>>> contains these 4 points: >>>> [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] >>>> The Way.clockwise() method says it is counter-clockwise. >>>> Besides rounding errors, it is a line, not a shape, and I guess that causes >>>> the problem. The clockwise() method calculates an area size of 3, which is >>>> almost zero. >>>> >>>> It is quite likely that the intersection of two areas produces these "nearly >>>> empty" (parts of) areas, what we need is a filter that throws them away. >>>> I am not sure if WanMil is already working on this? >>>> >>>> Gerd >>>> >>>> >>>> Thorsten Kukuk wrote >>>>> Hi, >>>>> >>>>> I compiled mkgmap r2179 and tried to create the bounds files with >>>>> it: >>>>> >>>>> osmconvert data/planet/planet-120122.osm.pbf --out-o5m >>>>> osmfilter data/boundaries/world-20120122.o5m --keep-nodes= >>>>> '--keep-ways-relations=boundary=administrative =postal_code postal_code=' >>>>> mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz >>>>> --bounds=data/boundaries/20120122 >>>>> Schwerwiegend (BoundarySaver): Calculate bbox to >>>>> (-90.12222290039062,-180.24444580078125) to >>>>> (82.6120376586914,179.17156219482422) >>>>> Exception in thread "main" java.lang.NullPointerException >>>>> at >>>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) >>>>> at >>>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) >>>>> at >>>>> uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) >>>>> at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) >>>>> at >>>>> uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) >>>>> at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) >>>>> Command exited with non-zero status 1 >>>>> >>>>> >>>>> Thorsten >>>>> >>>>> -- >>>>> Thorsten Kukuk, Project Manager/Release Manager SLES >>>>> SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg >>>>> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) >>>>> _______________________________________________ >>>>> mkgmap-dev mailing list >>>>> mkgmap-dev@.org >>>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >>>>> >>>> >>>> -- >>>> View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... >>>> Sent from the Mkgmap Development mailing list archive at Nabble.com. >>>> _______________________________________________ >>>> mkgmap-dev mailing list >>>> mkgmap-dev@.org >>>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >>> >>> _______________________________________________ >>> mkgmap-dev mailing list >>> mkgmap-dev@.org >>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev >> -- >> Thorsten Kukuk, Project Manager/Release Manager SLES >> SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg >> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) >> _______________________________________________ >> mkgmap-dev mailing list >> mkgmap-dev@.org >> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@.org > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.19327.n5.nabble.com/mkgmap-r2179-Still-NullPointerException-in-Bo... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

On Sat, Feb 04, 2012 at 10:22:04AM +0100, Thorsten Kukuk wrote:
Sorry, no, I wasn't able to find out what exactly the linux patch utility did not like on the patches.
Educated guess: CR+LF instead of LF as line terminator. Fix: tr -d \\015 < bad.patch > good.patch or patch -lp0<bad.patch (Or both, in case the mkgmap svn contains CR+LF line endings. For that, the fix would be "svn propset svn:eol-style native" on all text files in the repository.) Best regards, Marko

Hi Marko, I tried to apply my patch boundary_prep_quadtree_v1.patch on the performance branch in my linux environment. I still wasn't able to do it :-(
Date: Sat, 4 Feb 2012 11:32:03 +0200 From: marko.makela@iki.fi To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] Trouble applying patches
On Sat, Feb 04, 2012 at 10:22:04AM +0100, Thorsten Kukuk wrote:
Sorry, no, I wasn't able to find out what exactly the linux patch utility did not like on the patches.
Educated guess: CR+LF instead of LF as line terminator. Fix: tr -d \\015 < bad.patch > good.patch or patch -lp0<bad.patch
I tried both, did not help
(Or both, in case the mkgmap svn contains CR+LF line endings. For that, the fix would be "svn propset svn:eol-style native" on all text files in the repository.)
Do you mean my repository or that on http://svn.parabola.me.uk/mkgmap ? When I do it on my repo and create a new patch, the patch contains these changes as well. I don't think that's wanted? So, if anybody is able to apply my patch on linux, please post what to do, or even better: Tell me how to create patches that work on both systems. Ciao, Gerd

On 2012-02-04 05:20, Gerd Petermann wrote:
Hi Marko,
I tried to apply my patch boundary_prep_quadtree_v1.patch on the performance branch in my linux environment. I still wasn't able to do it :-(
There are a couple of issues with the patch: * It uses CRLF line endings. GNU patch tries to be helpful by converting to LF line endings. Unfortunately, the files being patched have CRLF line endings, so patch's helpfulness actually gets in the way. This can be worked around by using the '--binary' option when patching. * The last hunk is corrupt. The hunk header contains: @@ -281,4 +281,154 @@ which indicates that 150 new lines were added (154 minus 4). There are actually 151 new lines in the hunk, so either 154 should be 155 or there's a stray line that should be deleted. After editing the patch and changing that 154 to 155, I was able to apply the patch on my Linux system using the following command: patch -p0 --binary <verify_boundary.patch I like Marko's suggestion of running 'svn propset svn:eol-style native' on all text files in the repository. That will help avoid such problems in the future. -Richard

On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed.
Ok, I could build the boundaries for the whole planet file without problems now. Seems to work :) I looked at some "undecided_inner_outer" removals: looks like the boundaries in the US are a real mess, the errors where correct. I looked at some "too_small" errors but couldn't find out what's going on there.
If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files.
Maybe I didn't uncomment all lines I need, but I cannot find any other/new files with this data. Thorsten -- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)

Hi Thorsten, maybe you have to change the backslash to slash in the path names. Else you should find them in sub directory bnd_gpx Gerd
Date: Thu, 26 Jan 2012 14:15:56 +0100 From: kukuk@suse.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
On Thu, Jan 26, Gerd Petermann wrote:
Hi Thorsten,
please try the attached patch. It is not elegant, but I think it will solve the problem. As mentioned before, the problem is caused by rounding errors, so I've coded a check that detects when this situation happens. Area parts that cause this error are removed.
Ok, I could build the boundaries for the whole planet file without problems now. Seems to work :)
I looked at some "undecided_inner_outer" removals: looks like the boundaries in the US are a real mess, the errors where correct. I looked at some "too_small" errors but couldn't find out what's going on there.
If you like, you can unncomment the lines around GpxCreator to write the deleted parts to files.
Maybe I didn't uncomment all lines I need, but I cannot find any other/new files with this data.
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi, in case your are right Gerd (I have no time today to check that in deep), it is a bug of the clockwise method. So this method needs a bugfix - not the parts that use the method clockwise method. WanMil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi WanMil, I verified the result of the area calculation with a slightly different algorithm that I found in the net, that produced always exactly the same result. Maybe it is not a good idea to use integer/long values for this. I'll continue investigation with this tomorrow. ciao, Gerd
Date: Tue, 24 Jan 2012 22:30:50 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi,
in case your are right Gerd (I have no time today to check that in deep), it is a bug of the clockwise method. So this method needs a bugfix - not the parts that use the method clockwise method.
WanMil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code postal_code=' mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144) at uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110) at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126) at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Rather the same method is implemented in Multipolygon.calcAreaSize(List<Coord> points). Maybe the two methods can be merged to use the same area calculation. The Multipolygon variant uses doubles. Maybe the fixes it. I don't mind moving the calculation from the Multipolygon class to a better util class. WanMil
Hi WanMil,
I verified the result of the area calculation with a slightly different algorithm that I found in the net, that produced always exactly the same result. Maybe it is not a good idea to use integer/long values for this. I'll continue investigation with this tomorrow.
ciao, Gerd
Date: Tue, 24 Jan 2012 22:30:50 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi,
in case your are right Gerd (I have no time today to check that in deep), it is a bug of the clockwise method. So this method needs a bugfix - not the parts that use the method clockwise method.
WanMil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code
postal_code='
mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169)
at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144)
at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110)
at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at
uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I think the problem is in the Java2DConverter.areaToShapes() method which rounds the float values to int. This is not a problem for the boundaries that are created with OSM points, but with areas created with Area.intersect() or Area.substract() we see some points with fractions. In Way we are using these rounded values to calculate the area size and determine whether the way is clockwise or counter-clockwise. Sometimes the rounding error is too big (bigger than the area size), so the clockwise() method returns wrong results. I have coded a quick hack with coords stored in floats, and this seems to fix the problem, but I find many other places where this problem might show up, so I'll continue searching for a real solution. Gerd
Date: Tue, 24 Jan 2012 22:50:07 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Rather the same method is implemented in Multipolygon.calcAreaSize(List<Coord> points). Maybe the two methods can be merged to use the same area calculation. The Multipolygon variant uses doubles. Maybe the fixes it.
I don't mind moving the calculation from the Multipolygon class to a better util class.
WanMil
Hi WanMil,
I verified the result of the area calculation with a slightly different algorithm that I found in the net, that produced always exactly the same result. Maybe it is not a good idea to use integer/long values for this. I'll continue investigation with this tomorrow.
ciao, Gerd
Date: Tue, 24 Jan 2012 22:30:50 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi,
in case your are right Gerd (I have no time today to check that in deep), it is a bug of the clockwise method. So this method needs a bugfix - not the parts that use the method clockwise method.
WanMil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code
postal_code='
mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169)
at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144)
at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110)
at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at
uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I have checked the Way.clockwise() method and I think it's completely correct. I doubt that it is possible to create an overflow with normal map data. Also the 4 points example should be completely correct if the points are given as longitude/latitude. In this case it is counterclockwise. [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The misinterpretation is caused by errornously assigning longitude to the x axis but it is the y axis. WanMil
Rather the same method is implemented in Multipolygon.calcAreaSize(List<Coord> points). Maybe the two methods can be merged to use the same area calculation. The Multipolygon variant uses doubles. Maybe the fixes it.
I don't mind moving the calculation from the Multipolygon class to a better util class.
WanMil
Hi WanMil,
I verified the result of the area calculation with a slightly different algorithm that I found in the net, that produced always exactly the same result. Maybe it is not a good idea to use integer/long values for this. I'll continue investigation with this tomorrow.
ciao, Gerd
Date: Tue, 24 Jan 2012 22:30:50 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
Hi,
in case your are right Gerd (I have no time today to check that in deep), it is a bug of the clockwise method. So this method needs a bugfix - not the parts that use the method clockwise method.
WanMil
Hi Thorsten,
I can confirm this problem. I can repdroduce it with a "boundary" which contains these 4 points: [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559] The Way.clockwise() method says it is counter-clockwise. Besides rounding errors, it is a line, not a shape, and I guess that causes the problem. The clockwise() method calculates an area size of 3, which is almost zero.
It is quite likely that the intersection of two areas produces these "nearly empty" (parts of) areas, what we need is a filter that throws them away.
I am not sure if WanMil is already working on this?
Gerd
Thorsten Kukuk wrote
Hi,
I compiled mkgmap r2179 and tried to create the bounds files with it:
osmconvert data/planet/planet-120122.osm.pbf --out-o5m osmfilter data/boundaries/world-20120122.o5m --keep-nodes= '--keep-ways-relations=boundary=administrative =postal_code
postal_code='
mkgmap --createboundsfile=data/boundaries/boundaries-20120122.osm.gz --bounds=data/boundaries/20120122 Schwerwiegend (BoundarySaver): Calculate bbox to (-90.12222290039062,-180.24444580078125) to (82.6120376586914,179.17156219482422) Exception in thread "main" java.lang.NullPointerException at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadBoundaryFile(BoundaryUtil.java:169)
at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.workoutBoundaryRelations(BoundaryPreparer.java:144)
at
uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer.run(BoundaryPreparer.java:110)
at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:333) at
uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:112) Command exited with non-zero status 1
Thorsten
-- Thorsten Kukuk, Project Manager/Release Manager SLES SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@.org http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- View this message in context: http://gis.638310.n2.nabble.com/mkgmap-r2179-Still-NullPointerException-in-B... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Date: Thu, 26 Jan 2012 22:42:36 +0100 From: wmgcnfg@web.de To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] mkgmap r2179: Still NullPointerException in BoundaryUtil
I have checked the Way.clockwise() method and I think it's completely correct. I doubt that it is possible to create an overflow with normal map data.
Correct. There is no problem with overflow. The problem is in the routine Java2DConverter.areaToShapes(). ... int lat = Math.round(res[1]); int lon = Math.round(res[0]); ... In special cases, this rounding can change a clockwise way to an counter-clockwise way or vice versa.
Also the 4 points example should be completely correct if the points are given as longitude/latitude. In this case it is counterclockwise. [2412980/371559, 2412981/371558, 2412992/371544, 2412980/371559]
Sorry, the points are given as lat/lon pairs, but that doesn't matter, you are right, the way with these (rounded) values is counter-clockwise. The non-rounded values are different and describe a way that is clockwise.
The misinterpretation is caused by errornously assigning longitude to the x axis but it is the y axis.
I know that I tend to misinterpret the names (my patch used height for latitude values and width for longitude values :-( , but the result doesn't depend on the interpretation. Gerd
participants (7)
-
Gerd Petermann
-
GerdP
-
Marko Mäkelä
-
Martin
-
Richard Hansen
-
Thorsten Kukuk
-
WanMil