logo separator

[mkgmap-dev] [PATCH] --ignore-builtin-relations

From Marko Mäkelä marko.makela at iki.fi on Sun Apr 17 09:54:44 BST 2011

On Sat, Apr 16, 2011 at 12:27:30PM +0300, Marko Mäkelä wrote:
>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)
>@@ -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)) {

Sorry, this was a brain-fart. Initially, I had the check like this:

-               String type = rel.getTag("type");
+		String type = ignoreBuiltinRelations ? null : rel.getTag("type");

But then I confused the type != null check with the rel != null later in 
the function.

Interestingly, the execution time is about the same, even if the 
processing of all relations is skipped. There are not that many route 
relations in my map, after all. My initial tests were with the correct 
patch yielded the largest .img file for the bus routes, about 900 kB.  
Other .img files were smaller, starting from 15 kB. The empty .img files 
produced by this incorrect patch are 9728 bytes. The whole gmapsupp.img 
is about 90 MB.

Sorry for the confusion,

	Marko



More information about the mkgmap-dev mailing list