logo separator

[mkgmap-dev] [PATCH v1] Self intersection warning in mp

From Marko Mäkelä marko.makela at iki.fi on Sat Jan 30 21:36:48 GMT 2010

Hi WanMil,

On Sat, Jan 30, 2010 at 09:46:56AM +0100, WanMil wrote:
> The mp code warns if a polygon intersects itself.
> +		if (log.isWarnEnabled()) {
> +			if (area.isSingular() == false) {

You might write this as log.isWarnEnabled() && !area.isSingular()
and get rid of one unnecessary level of indentation.  Java should
do short-circuit evaluation of logic expressions, like any C-like
language.

> +				log.warn("Way", w.getId(), "intersects itself.");
> +				log.warn("The way is composed of");
> +				logWayURLs(Level.WARNING, "-", w);

Sorry, I do not seem to be getting any output from logWayURLs, and the
generated way ID is of no use to me.  I am running with 2 threads, and
I first assumed that the output could be interleaved with the output
of another thread, but the following log excerpt shows that it is not
the case (logWayURLs does nothing for the last "intersects itself" warning).

The log excerpt follows:

[snip from the beginning to the first "intersects itself"]
2010/01/30 22:27:52 WARNING (MultiPolygonRelation): 63240001.osm.gz: Way 4611686
018427391472 intersects itself.
2010/01/30 22:27:52 WARNING (MultiPolygonRelation): 63240001.osm.gz: The way is 
composed of
2010/01/30 22:27:52 WARNING (MultiPolygonRelation): 63240001.osm.gz: singularAre
aToWay called with non singular area. Multipolygon  http://www.openstreetmap.org
/browse/relation/77593
[snip to the last "intersects itself"]
2010/01/30 22:37:58 WARNING (MultiPolygonRelation): 63240003.osm.gz: Way 4611686018427465744 intersects itself.
2010/01/30 22:37:58 WARNING (MultiPolygonRelation): 63240003.osm.gz: The way is composed of
2010/01/30 22:37:58 WARNING (MultiPolygonRelation): 63240003.osm.gz: Multipolygon http://www.openstreetmap.org/browse/relation/4611686018427463424 contains intersected or overlapping ways
2010/01/30 22:38:05 WARNING (MapBuilder): 63240003.osm.gz: Highway 4 has no region (define a default region to zap this warning)
[end of log]

Best regards,

	Marko



More information about the mkgmap-dev mailing list