There is an option to disable the processing of turn restriction relations (--ignore-turn-restrictions), but no option to disable the processing of multipolygon relations. The attached patch introduces --ignore-builtin-relations, which disables the built-in processing of all relations (currently, type={boundary,multipolygon,restiction}).

This patch reduces the processing time of my simple map layers from 2.5 minutes to 2 minutes.

OK to commit this?

        Marko
Index: src/uk/me/parabola/mkgmap/reader/osm/ElementSaver.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/ElementSaver.java	(revision 1916)
+++ src/uk/me/parabola/mkgmap/reader/osm/ElementSaver.java	(working copy)
@@ -67,6 +67,7 @@ public class ElementSaver {
 	private int maxLon = Utils.toMapUnit(-180.0);
 
 	// Options
+	private final boolean ignoreRelations;
 	private final boolean ignoreTurnRestrictions;
 	private final Double minimumArcLength;
 
@@ -94,6 +95,7 @@ public class ElementSaver {
 		else
 			minimumArcLength = null;
 
+		ignoreBuiltinRelations = args.getProperty("ignore-builtin-relations", false);
 		ignoreTurnRestrictions = args.getProperty("ignore-turn-restrictions", false);
 	}
 
@@ -145,6 +147,9 @@ public class ElementSaver {
 	 * @param rel The osm relation.
 	 */
 	public void addRelation(Relation rel) {
+		if (ignoreBuiltinRelations)
+			return;
+
 		String type = rel.getTag("type");
 		if (type != null) {
 			if ("multipolygon".equals(type) || "boundary".equals(type)) {
Index: resources/help/en/options
===================================================================
--- resources/help/en/options	(revision 1916)
+++ resources/help/en/options	(working copy)
@@ -252,6 +252,9 @@ Miscellaneous options:
 --ignore-maxspeeds
 	When reading OSM files, ignore any "maxspeed" tags.
 
+--ignore-builtin-relations
+	When reading OSM files, skip the built-in processing of relations.
+
 --ignore-turn-restrictions
 	When reading OSM files, ignore any "restriction" relations.
 
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to