OK, let's try again. The attached patch adds a duplicate() method to
the Way class.

It's only really needed when using the continue patch. You will have to
edit StyledConverter.class in the do while loop where it's
looping around until foundType.isFinal() and in the body of the loop
it is calling addRoad() or addLine(). In there, if the foundType is not
final you want to pass a duplicate of the way rather than the original.

so instead of: addRoad(way, foundType)

you have: addRoad(way.duplicate(), foundType)

If foundType.isFinal() is true, you don't need to duplicate the way
(although if you do, no harm should come of it, just wastes a little
time).

Mark


diff --git a/src/uk/me/parabola/mkgmap/reader/osm/Way.java b/src/uk/me/parabola/mkgmap/reader/osm/Way.java
index 1c152ef..a646af6 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/Way.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/Way.java
@@ -42,6 +42,17 @@ public class Way extends Element {
 		setId(id);
 	}
 
+	// create a new Way that is a duplicate of this one - the new Way
+	// has a shallow copy of the points list so that changes to the
+	// original list don't affect the points in the duplicate
+
+	public Way duplicate() {
+		Way dup = new Way(getId(), new ArrayList<Coord>(points));
+		dup.setName(getName());
+		dup.copyTags(this);
+		return dup;
+	}
+
 	/**
 	 * Get the points that make up the way.  We attempt to re-order the segments
 	 * and return a list of points that traces the route of the way.
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to