logo separator

[mkgmap-dev] Anti-island check confused; defined a monster multipolygon

From Mark Burton markb at ordern.com on Sat Feb 6 16:20:20 GMT 2010

Hello Marko,

> > > It seems that the anti-island check got the piecewise defined coast line
> > > of Inarinjärvi (Lake Inari) wrong.  I now defined a multipolygon for the
> > > lake and its about 700 islands, hopefully making no mistake in the process:
> > > http://www.openstreetmap.org/browse/relation/402543
> > 
> > When you say "wrong", what exactly do you mean?
> 
> I mean these messages from --generate-sea=multipolygon,no-sea-sectors:
> 
> 2010/02/06 12:16:26 WARNING (Osm5XmlHandler): 63240003.osm.gz: Converting anti-island starting at http://www.openstreetmap.org/?mlat=68.79379&mlon=27.95413&zoom=17 into an island as it is surrounded by water
> 2010/02/06 12:16:26 WARNING (Osm5XmlHandler): 63240003.osm.gz: Converting anti-island starting at http://www.openstreetmap.org/?mlat=69.41525&mlon=28.71751&zoom=17 into an island as it is surrounded by water
> 2010/02/06 12:16:26 WARNING (Osm5XmlHandler): 63240003.osm.gz: Converting anti-island starting at http://www.openstreetmap.org/?mlat=66.56882&mlon=27.78983&zoom=17 into an island as it is surrounded by water
> 
> Today, I started from the first one and defined the Inarinjärvi multipolygon.
> A couple of days ago, I checked all anti-island warnings and fixed the
> genuine ones.  These three cases look like a lake mistaken for an anti-island.
> 
> I do not blame mkgmap; I think that the right thing is to define
> multipolygons for all lakes.

Hmm, I wonder if the test to see if an anti-island is contained within
an island is failing if the anti-island reaches a tile edge. If you
still have the same data, could you try modifying containsPointsOf() in
Way.java so that it looks like this:

	public boolean containsPointsOf(Way other) {
		Polygon thisPoly = new Polygon();
		for(Coord p : points)
			thisPoly.addPoint(p.getLongitude(), p.getLatitude());
		for(Coord p : other.points)
			if(thisPoly.contains(p.getLongitude(), p.getLatitude()))
				return true;
		return false;
	}

i.e. make it return true if any point is inside rather than all points
are inside.

Mark



More information about the mkgmap-dev mailing list