Index: src/uk/me/parabola/imgfmt/app/net/RoadDef.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/RoadDef.java	(revision 3394)
+++ src/uk/me/parabola/imgfmt/app/net/RoadDef.java	(working copy)
@@ -146,6 +146,8 @@
 	private final String name;
 	private List<Numbers> numbersList;
 	private int nodeCount;
+	
+	private List<RouteNode> routeNodes = new ArrayList<>();
 
 	public RoadDef(long id, String name) {
 		this.id = id;
@@ -525,15 +527,14 @@
 		// possible.
 		// This might be unnecessary if we just make sure
 		// that every road starts with a node.
-		int nbits = nnodes;
-		if (!startsWithNode)
-			nbits++;
+		int nbits = routeNodes.size();
 		writer.putChar((char) nbits);
 		boolean[] bits = new boolean[nbits];
-		for (int i = 0; i < bits.length; i++)
-			bits[i] = true;
-		if (!startsWithNode)
-			bits[0] = false;
+		for (int i = 0; i < bits.length; i++){
+			if (routeNodes.get(i).isUsedForRouting()){
+				bits[i] = true;
+			}
+		}
 		for (int i = 0; i < bits.length; i += 8) {
 			int b = 0;
             for (int j = 0; j < 8 && j < bits.length - i; j++)
@@ -749,4 +750,8 @@
 		return previouslyIssued;
 	}
 
+	public void addRouteNode(RouteNode node) {
+		routeNodes.add(node);
+	}
+
 }
Index: src/uk/me/parabola/imgfmt/app/net/RoadNetwork.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/RoadNetwork.java	(revision 3394)
+++ src/uk/me/parabola/imgfmt/app/net/RoadNetwork.java	(working copy)
@@ -79,6 +79,7 @@
 		int pointsHash = 0;
 
 		int npoints = coordList.size();
+		RouteNode lastNode = null;
 		for (int index = 0; index < npoints; index++) {
 			Coord co = coordList.get(index);
 
@@ -110,12 +111,14 @@
 
 				RouteNode node1 = getOrAddNode(lastId, lastCoord);
 				RouteNode node2 = getOrAddNode(id, co);
-
+				lastNode = node2;
 				if(node1 == node2)
 					log.error("Road " + roadDef + " contains consecutive identical nodes at " + co.toOSMURL() + " - routing will be broken");
 				else if(arcLength == 0)
 					log.warn("Road " + roadDef + " contains zero length arc at " + co.toOSMURL());
 
+				roadDef.addRouteNode(node1);
+				
 				Coord forwardBearingPoint = coordList.get(lastIndex + 1);
 				if(lastCoord.equals(forwardBearingPoint)) {
 					// bearing point is too close to last node to be
@@ -194,6 +197,8 @@
 			arcLength = 0;
 			pointsHash = co.hashCode();
 		}
+		if (lastNode != null)
+			roadDef.addRouteNode(lastNode);
 		roadDef.setLength(roadLength);
 	}
 
Index: src/uk/me/parabola/imgfmt/app/net/RouteNode.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/net/RouteNode.java	(revision 3394)
+++ src/uk/me/parabola/imgfmt/app/net/RouteNode.java	(working copy)
@@ -77,6 +77,8 @@
 	private byte nodeClass;
 	
 	private byte nodeGroup = -1;
+	
+	private boolean usedForRouting = true;
 
 	public RouteNode(Coord coord) {
 		this.coord = (CoordNode) coord;
@@ -1111,4 +1113,8 @@
 	public int hashCode(){
 		return getCoord().getId();
 	}
+
+	public boolean isUsedForRouting() {
+		return usedForRouting;
+	}
 }
