logo separator

[mkgmap-dev] Bug (?) in performance branch

From WanMil wmgcnfg at web.de on Sun Mar 4 16:13:20 GMT 2012

Hi,

the performance branch does not find any bounds information for a few 
ways and nodes. It's about 10 ways per tile where this happens.

Having on look on them some are well explainable because they are 
located in the North Sea. But others are located completely within a 
country (e.g. in the middle of France or Dutch). From my understanding 
they must be assigned at least with the country information beause these 
countries do not have holes.

The following patch creates a GPX file for each node/way that is not 
assigned with any bounds information. This makes it quite easy to check 
where the errorneous ways/nodes are located.

WanMil

Index: src/uk/me/parabola/mkgmap/reader/osm/LocationHook.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/LocationHook.java	(revision 2234)
+++ src/uk/me/parabola/mkgmap/reader/osm/LocationHook.java	(working copy)
@@ -12,6 +12,7 @@
   */
  package uk.me.parabola.mkgmap.reader.osm;

+import java.util.Collections;
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.List;
@@ -24,6 +25,7 @@
  import uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryQuadTree;
  import uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil;
  import uk.me.parabola.util.EnhancedProperties;
+import uk.me.parabola.util.GpxCreator;

  public class LocationHook extends OsmReadingHooksAdaptor {
  	private static final boolean PRINT_RESULT = false;
@@ -157,6 +159,8 @@
  		if (elem instanceof Node){
  			Node node = (Node) elem;
  			tags = search(node.getLocation());
+			if (tags == null)
+			GpxCreator.createGpx(GpxCreator.getGpxBaseName()+"n"+elem.getId(), 
Collections.singletonList(((Node) elem).getLocation()));
  		}
  		else if (elem instanceof Way){
  			Way way = (Way) elem;
@@ -181,8 +185,10 @@
  						break;
  				}
  			}
-			if (tags == null)
+			if (tags == null) {
+				GpxCreator.createGpx(GpxCreator.getGpxBaseName()+"w"+way.getId(), 
way.getPoints());
  				++cntwayNotFnd;
+			}
  		}

  		if (tags == null){



More information about the mkgmap-dev mailing list