diff --git a/src/uk/me/parabola/imgfmt/app/net/NODHeader.java b/src/uk/me/parabola/imgfmt/app/net/NODHeader.java
index 4c8a713..c273d93 100644
--- a/src/uk/me/parabola/imgfmt/app/net/NODHeader.java
+++ b/src/uk/me/parabola/imgfmt/app/net/NODHeader.java
@@ -61,7 +61,8 @@ public class NODHeader extends CommonHeader {
 		nodes.setPosition(HEADER_LEN);
 		nodes.writeSectionInfo(writer);
 
-		writer.putInt(0x25);
+		// now sets 0x02 (enable turn restrictions?)
+		writer.putInt(0x27);
 
 		writer.putChar(align);
 		writer.putChar((char) (align - 1));
diff --git a/src/uk/me/parabola/imgfmt/app/net/RouteNode.java b/src/uk/me/parabola/imgfmt/app/net/RouteNode.java
index 7ddbf19..7772d0e 100644
--- a/src/uk/me/parabola/imgfmt/app/net/RouteNode.java
+++ b/src/uk/me/parabola/imgfmt/app/net/RouteNode.java
@@ -113,6 +113,22 @@ public class RouteNode implements Comparable {
 		flags |= F_RESTRICTIONS;
 	}
 
+	public RouteArc getArcTo(RouteNode otherNode) {
+		for(RouteArc a : arcs)
+			if(a.getDest() == otherNode)
+				return a;
+
+		return null;
+	}
+
+	public RouteArc getArcFrom(RouteNode otherNode) {
+		for(RouteArc a : arcs)
+			if(a.getSource() == otherNode)
+				return a;
+
+		return null;
+	}
+
 	/**
 	 * Provide an upper bound to the size (in bytes) that
 	 * writing this node will take.
@@ -181,7 +197,7 @@ public class RouteNode implements Comparable {
 	}
 
 	public int getOffsetNod1() {
-		assert offsetNod1 != -1: "failed for node " + nodeId;
+		assert offsetNod1 != -1: "failed for node " + nodeId + " at " + coord.toDegreeString();
 		return offsetNod1;
 	}
 
diff --git a/src/uk/me/parabola/mkgmap/general/RoadNetwork.java b/src/uk/me/parabola/mkgmap/general/RoadNetwork.java
index eb259d3..88a64bc 100644
--- a/src/uk/me/parabola/mkgmap/general/RoadNetwork.java
+++ b/src/uk/me/parabola/mkgmap/general/RoadNetwork.java
@@ -28,6 +28,7 @@ import uk.me.parabola.imgfmt.app.net.RoadDef;
 import uk.me.parabola.imgfmt.app.net.RouteArc;
 import uk.me.parabola.imgfmt.app.net.RouteCenter;
 import uk.me.parabola.imgfmt.app.net.RouteNode;
+import uk.me.parabola.imgfmt.app.net.RouteRestriction;
 import uk.me.parabola.log.Logger;
 
 /**
@@ -169,4 +170,23 @@ public class RoadNetwork {
 	public List<RouteNode> getBoundary() {
 		return boundary;
 	}
+
+	public void addRestriction(CoordNode fromNode, CoordNode toNode, CoordNode viaNode) {
+		RouteNode fn = nodes.get(fromNode.getId());
+		RouteNode tn = nodes.get(toNode.getId());
+		RouteNode vn = nodes.get(viaNode.getId());
+
+		assert fn != null : "can't locate RouteNode with id " + fromNode.getId();
+		assert tn != null : "can't locate RouteNode with id " + toNode.getId();
+		assert vn != null : "can't locate RouteNode with id " + viaNode.getId();
+
+		RouteArc fromArc = vn.getArcTo(fn); // inverse arc gets used
+		RouteArc toArc = vn.getArcTo(tn);
+
+		assert fromArc != null : "can't locate arc from 'via' node";
+		assert toArc != null : "can't locate arc to 'via' node";
+
+		vn.addRestriction(new RouteRestriction(fromArc, toArc));
+    }
+
 }
diff --git a/src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java b/src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
index 850d440..4714cca 100644
--- a/src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
+++ b/src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
@@ -43,6 +43,7 @@ import uk.me.parabola.mkgmap.reader.osm.GType;
 import uk.me.parabola.mkgmap.reader.osm.Node;
 import uk.me.parabola.mkgmap.reader.osm.OsmConverter;
 import uk.me.parabola.mkgmap.reader.osm.Relation;
+import uk.me.parabola.mkgmap.reader.osm.RestrictionRelation;
 import uk.me.parabola.mkgmap.reader.osm.Rule;
 import uk.me.parabola.mkgmap.reader.osm.Style;
 import uk.me.parabola.mkgmap.reader.osm.Way;
@@ -65,6 +66,15 @@ public class StyledConverter implements OsmConverter {
 	private Area bbox = null;
 	private Set<Coord> boundaryCoords = new HashSet<Coord>();
 
+	// restrictions associates lists of turn restrictions with the
+	// Coord corresponding to the restrictions' 'via' node
+	private Map<Coord, List<RestrictionRelation>> restrictions = new HashMap<Coord, List<RestrictionRelation>>();
+
+	// originalWay associates Ways that have been created due to
+	// splitting or clipping with the Ways that they were derived
+	// from
+	private Map<Way, Way> originalWay = new HashMap<Way, Way>();
+
 	private int roadId;
 
 	private final int MAX_NODES_IN_WAY = 16;
@@ -212,6 +222,18 @@ public class StyledConverter implements OsmConverter {
 		// Relations never resolve to a GType and so we ignore the return
 		// value.
 		relationRules.resolveType(relation);
+
+		if(relation instanceof RestrictionRelation) {
+			RestrictionRelation rr = (RestrictionRelation)relation;
+			if(rr.isValid()) {
+				List<RestrictionRelation> lrr = restrictions.get(rr.getViaCoord());
+				if(lrr == null) {
+					lrr = new ArrayList<RestrictionRelation>();
+					restrictions.put(rr.getViaCoord(), lrr);
+				}
+				lrr.add(rr);
+			}
+		}
 	}
 
 	private void addLine(Way way, GType gt) {
@@ -293,6 +315,12 @@ public class StyledConverter implements OsmConverter {
 						}
 					}
 					clippedWays.add(nWay);
+					// associate the original Way
+					// to the new Way
+					Way origWay = originalWay.get(way);
+					if(origWay == null)
+						origWay = way;
+					originalWay.put(nWay, origWay);
 				}
 			}
 		}
@@ -490,12 +518,18 @@ public class StyledConverter implements OsmConverter {
 		if(way.isBoolTag("toll"))
 			road.setToll();
 
+		Way origWay = originalWay.get(way);
+		if(origWay == null)
+		    origWay = way;
+
 		int numNodes = nodeIndices.size();
 		road.setNumNodes(numNodes);
 
 		if(numNodes > 0) {
 			// replace Coords that are nodes with CoordNodes
 			boolean hasInternalNodes = false;
+		        CoordNode lastCoordNode = null;
+			List<RestrictionRelation> lastRestrictions = null;
 			for(int i = 0; i < numNodes; ++i) {
 				int n = nodeIndices.get(i);
 				if(n > 0 && n < points.size() - 1)
@@ -506,7 +540,52 @@ public class StyledConverter implements OsmConverter {
 				if(boundary) {
 					log.info("Way " + way.getName() + "'s point #" + n + " at " + points.get(n).toDegreeString() + " is a boundary node");
 				}
-				points.set(n, new CoordNode(coord.getLatitude(), coord.getLongitude(), nodeId, boundary));
+
+				CoordNode thisCoordNode = new CoordNode(coord.getLatitude(), coord.getLongitude(), nodeId, boundary);
+				points.set(n, thisCoordNode);
+
+				// see if this node plays a role in any
+				// turn restrictions
+
+				if(lastRestrictions != null) {
+					// the previous node was the
+					// location of one or more
+					// restrictions
+					for(RestrictionRelation rr : lastRestrictions) {
+						if(rr.getToWay().equals(origWay)) {
+							rr.setToNode(thisCoordNode);
+						}
+						else if(rr.getFromWay().equals(origWay)) {
+							rr.setFromNode(thisCoordNode);
+						}
+						else {
+							rr.addOtherNode(thisCoordNode);
+						}
+					}
+				}
+
+				List<RestrictionRelation> theseRestrictions = restrictions.get(coord);
+				if(theseRestrictions != null) {
+					// this node is the location
+					// of one or more restrictions
+					for(RestrictionRelation rr : theseRestrictions) {
+						rr.setViaNode(thisCoordNode);
+						if(rr.getToWay().equals(origWay)) {
+							if(lastCoordNode != null)
+								rr.setToNode(lastCoordNode);
+						}
+						else if(rr.getFromWay().equals(origWay)) {
+							if(lastCoordNode != null)
+								rr.setFromNode(lastCoordNode);
+						}
+						else if(lastCoordNode != null) {
+							rr.addOtherNode(lastCoordNode);
+						}
+					}
+				}
+
+				lastRestrictions = theseRestrictions;
+				lastCoordNode = thisCoordNode;
 			}
 
 			road.setStartsWithNode(nodeIndices.get(0) == 0);
@@ -516,7 +595,7 @@ public class StyledConverter implements OsmConverter {
 		lineAdder.add(road);
 
 		if(trailingWay != null)
-		    addRoadWithoutLoops(trailingWay, gt);
+			addRoadWithoutLoops(trailingWay, gt);
 	}
 
 	// split a Way at the specified point and return the new Way
@@ -542,6 +621,12 @@ public class StyledConverter implements OsmConverter {
 		for(int i = numPointsInWay - 1; i > index; --i)
 			wayPoints.remove(i);
 
+		// associate the original Way to the new Way
+		Way origWay = originalWay.get(way);
+		if(origWay == null)
+			origWay = way;
+		originalWay.put(trailingWay, origWay);
+
 		return trailingWay;
 	}
 
diff --git a/src/uk/me/parabola/mkgmap/reader/osm/Node.java b/src/uk/me/parabola/mkgmap/reader/osm/Node.java
index 4c6e468..4a8294c 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/Node.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/Node.java
@@ -35,4 +35,8 @@ public class Node extends Element {
 	public Coord getLocation() {
 		return location;
 	}
+
+	public String toString() {
+		return "NODE: " + getId() + " @ " + location.toDegreeString();
+	}
 }
diff --git a/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java b/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java
new file mode 100644
index 0000000..dfbf179
--- /dev/null
+++ b/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java
@@ -0,0 +1,260 @@
+
+package uk.me.parabola.mkgmap.reader.osm;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import uk.me.parabola.log.Logger;
+
+import uk.me.parabola.mkgmap.general.RoadNetwork;
+
+import uk.me.parabola.mkgmap.reader.osm.Node;
+import uk.me.parabola.mkgmap.reader.osm.Way;
+
+import uk.me.parabola.imgfmt.app.Coord;
+import uk.me.parabola.imgfmt.app.CoordNode;
+
+/**
+ * Representation of an OSM turn restriction
+ *
+ * @author Mark Burton
+ */
+public class RestrictionRelation extends Relation {
+
+    private static final Logger log = Logger.getLogger(RestrictionRelation.class);
+
+    private Way fromWay;
+    private Way toWay;
+    private Coord viaCoord;
+    private String restriction;
+
+    private CoordNode fromNode;
+    private CoordNode toNode;
+    private CoordNode viaNode;
+    private List<CoordNode> otherNodes = new ArrayList<CoordNode>();
+    private final String messagePrefix;
+
+	/**
+	 * Create an instance based on an existing relation.  We need to do
+	 * this because the type of the relation is not known until after all
+	 * its tags are read in.
+	 * @param other The relation to base this one on.
+	 */
+	public RestrictionRelation(Relation other) {
+
+		setId(other.getId());
+
+		messagePrefix = "Turn restriction " + getId() + " ";
+
+		for (Map.Entry<Element, String> pairs: other.getRoles().entrySet()){
+			Element el = pairs.getKey();
+			String role = pairs.getValue();
+			addElement(role, el);
+
+			if("to".equals(role)) {
+				if(toWay != null) {
+					log.error(messagePrefix + "has multiple 'to' members - first 'to' member starts at " + toWay.getPoints().get(0).toDegreeString());
+				}
+				else if(el instanceof Way) {
+					toWay = (Way)el;
+				}
+				else
+					log.error(messagePrefix + "'to' member should be a Way but is a " + el);
+			}
+			else if("from".equals(role)) {
+				if(fromWay != null) {
+					log.error(messagePrefix + "has multiple 'from' members - first 'from' member starts at " + fromWay.getPoints().get(0).toDegreeString());
+				}
+				else if(el instanceof Way) {
+					fromWay = (Way)el;
+				}
+				else
+					log.error(messagePrefix + "'from' member should be a Way but is a " + el);
+			}
+			else if("via".equals(role)) {
+				if(viaCoord != null) {
+					log.warn(messagePrefix + "can't cope (yet) with multiple 'via' members");
+				}
+				else if(el instanceof Node) {
+					viaCoord = ((Node)el).getLocation();
+				}
+				else {
+					String bleat = messagePrefix + "can't cope (yet) with 'via' member not being a node";
+					if(el instanceof Way) {
+						List<Coord> vp = ((Way)el).getPoints();
+						bleat += " ('via' way starts at " + vp.get(0).toDegreeString() + ")";
+					}
+					log.warn(bleat);
+				}
+			}
+			else if("location_hint".equals(role)) {
+				// relax - we don't care about this
+			}
+			else {
+				log.warn(messagePrefix + "unknown member role '" + role + "'");
+			}
+		}
+
+		setName(other.getName());
+
+		copyTags(other);
+
+		restriction = getTag("restriction");
+
+		String[] unsupportedTags = {
+		    "except",
+		    "day_on",
+		    "day_off",
+		    "hour_on",
+		    "hour_off" };
+		for(int i = 0; i < unsupportedTags.length; ++i) {
+			if(getTag(unsupportedTags[i]) != null) {
+				log.warn(messagePrefix + "ignoring unsupported '" + unsupportedTags[i] + "' tag");
+			}
+		}
+	}
+
+	public Way getFromWay() {
+		return fromWay;
+	}
+
+	public Way getToWay() {
+		return toWay;
+	}
+
+	public Coord getViaCoord() {
+		return viaCoord;
+	}
+
+	public String getRestriction() {
+		return restriction;
+	}
+
+	public void setFromNode(CoordNode fromNode) {
+		this.fromNode = fromNode;
+		log.debug(messagePrefix + restriction + " 'from' node is " + fromNode.toDegreeString());
+	}
+
+	public void setToNode(CoordNode toNode) {
+		this.toNode = toNode;
+		log.debug(messagePrefix + restriction + " 'to' node is " + toNode.toDegreeString());
+	}
+
+	public void setViaNode(CoordNode viaNode) {
+		if(this.viaNode == null)
+			log.debug(messagePrefix + restriction + " 'via' node is " + viaNode.toDegreeString());
+		else if(!this.viaNode.equals(viaNode))
+			log.error(messagePrefix + restriction + " 'via' node redefined from " +
+				  this.viaNode.toDegreeString() + " to " +
+				  viaNode.toDegreeString());
+		this.viaNode = viaNode;
+	}
+
+	public void addOtherNode(CoordNode otherNode) {
+		otherNodes.add(otherNode);
+		log.debug(messagePrefix + restriction + " adding 'other' node " + otherNode.toDegreeString());
+	}
+
+	public boolean isValid() {
+		boolean result = true;
+
+		if(fromWay == null) {
+			String bleat = messagePrefix + "lacks 'from' way";
+			if(toWay != null) {
+				bleat += " ('to' way starts at " + toWay.getPoints().get(0).toDegreeString() + ")";
+			}
+			log.error(bleat);
+			return false;
+		}
+
+		if(toWay == null) {
+			String bleat = messagePrefix + "lacks 'to' way";
+			if(fromWay != null) {
+				List<Coord> fp = fromWay.getPoints();
+				bleat += " ('from' way ends at " + fp.get(fp.size() - 1).toDegreeString() + ")";
+			}
+			log.error(bleat);
+			return false;
+		}
+
+		if(viaCoord == null) {
+			List<Coord>fromPoints = fromWay.getPoints();
+			List<Coord>toPoints = toWay.getPoints();
+			for(Coord fp : fromPoints) {
+				for(Coord tp : toPoints) {
+					if(fp.equals(tp)) {
+						if(viaCoord == null) {
+							viaCoord = fp;
+						}
+						else {
+							log.error(messagePrefix + "lacks 'via' node and the 'from' and 'to' ways connect in more than one place - first connection is at " + viaCoord.toDegreeString());
+							return false;
+						}
+					}
+				}
+			}
+
+			if(viaCoord == null) {
+				log.error(messagePrefix + "lacks 'via' node and the 'from' and 'to' ways don't connect");
+				return false;
+			}
+
+			log.warn(messagePrefix + "lacks 'via' node (guessing it should be at " + viaCoord.toDegreeString() + ", why don't you add it to the OSM data?)");
+		}
+
+		Coord e1 = fromWay.getPoints().get(0);
+		Coord e2 = fromWay.getPoints().get(fromWay.getPoints().size() - 1);
+		if(!viaCoord.equals(e1) && !viaCoord.equals(e2)) {
+			log.error(messagePrefix + "'from' way doesn't start or end at 'via' node (" + viaCoord.toDegreeString() + ")");
+			result = false;
+		}
+
+		e1 = toWay.getPoints().get(0);
+		e2 = toWay.getPoints().get(toWay.getPoints().size() - 1);
+		if(!viaCoord.equals(e1) && !viaCoord.equals(e2)) {
+			log.error(messagePrefix + "'to' way doesn't start or end at 'via' node (" + viaCoord.toDegreeString() + ")");
+			result = false;
+		}
+
+		return result;
+	}
+
+	public void addRestriction(RoadNetwork roadNetwork) {
+
+		if(viaNode == null || fromNode == null || toNode == null) {
+			// restriction must have some error (reported earlier)
+		    return;
+		}
+
+		if("no_left_turn".equals(restriction) ||
+		   "no_right_turn".equals(restriction) ||
+		   "no_straight_on".equals(restriction) ||
+		   "no_u_turn".equals(restriction)) {
+			roadNetwork.addRestriction(fromNode, toNode, viaNode);
+			log.info(messagePrefix + restriction + " added at " + viaNode.toDegreeString());
+		}
+		else if("only_left_turn".equals(restriction) ||
+			"only_right_turn".equals(restriction) ||
+			"only_straight_on".equals(restriction)) {
+			for(CoordNode otherNode : otherNodes) {
+				roadNetwork.addRestriction(fromNode, otherNode, viaNode);
+			}
+			log.info(messagePrefix + restriction + " added at " + viaNode.toDegreeString());
+		}
+		else {
+			log.error(messagePrefix + "has unsupported type '" + restriction + "'");
+		}
+	}
+
+	/** Process the ways in this relation.
+	 */
+	public void processElements() {
+		// relax
+	}
+
+	public String toString() {
+		return "[restriction = " + restriction + ", from = " + fromWay + ", to = " + toWay + ", via = " + viaCoord.toDegreeString() + "]";
+	}
+}
diff --git a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5MapDataSource.java b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5MapDataSource.java
index eeece9c..a619786 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5MapDataSource.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5MapDataSource.java
@@ -67,7 +67,7 @@ public class Osm5MapDataSource extends OsmMapDataSource {
 
 			try {
 				Osm5XmlHandler handler = new Osm5XmlHandler(getConfig());
-				handler.setCollector(mapper);
+				handler.setMapper(mapper);
 				Runnable task = new Runnable() {
 					public void run() {
 						addBackground();
diff --git a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
index bfd364a..ffcae98 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
@@ -23,13 +23,15 @@ import java.util.Map;
 import uk.me.parabola.imgfmt.app.Area;
 import uk.me.parabola.imgfmt.app.Coord;
 import uk.me.parabola.log.Logger;
-import uk.me.parabola.mkgmap.general.MapCollector;
+import uk.me.parabola.mkgmap.general.MapDetails;
+import uk.me.parabola.mkgmap.general.RoadNetwork;
 import uk.me.parabola.mkgmap.reader.osm.Element;
 import uk.me.parabola.mkgmap.reader.osm.GeneralRelation;
 import uk.me.parabola.mkgmap.reader.osm.MultiPolygonRelation;
 import uk.me.parabola.mkgmap.reader.osm.Node;
 import uk.me.parabola.mkgmap.reader.osm.OsmConverter;
 import uk.me.parabola.mkgmap.reader.osm.Relation;
+import uk.me.parabola.mkgmap.reader.osm.RestrictionRelation;
 import uk.me.parabola.mkgmap.reader.osm.Way;
 import uk.me.parabola.util.EnhancedProperties;
 
@@ -67,13 +69,14 @@ class Osm5XmlHandler extends DefaultHandler {
 	private long currentElementId;
 
 	private OsmConverter converter;
-	private MapCollector mapper;
+	private MapDetails mapper;
 	private Area bbox;
 	private Runnable endTask;
 
 	private long nextFakeId = 1;
 
 	private final boolean ignoreBounds;
+	private final boolean ignoreTurnRestrictions;
 	private final boolean routing;
 	private final String frigRoundabouts;
 
@@ -81,6 +84,7 @@ class Osm5XmlHandler extends DefaultHandler {
 		ignoreBounds = props.getProperty("ignore-osm-bounds", false);
 		routing = props.containsKey("route");
 		frigRoundabouts = props.getProperty("frig-roundabouts");
+		ignoreTurnRestrictions = props.getProperty("ignore-turn-restrictions", false);
 	}
 
 	/**
@@ -150,6 +154,16 @@ class Osm5XmlHandler extends DefaultHandler {
 				el = wayMap.get(id);
 			} else if ("node".equals(type)) {
 				el = nodeMap.get(id);
+				if(el == null) {
+					// we didn't make a node for
+					// this point earlier, do it
+					// now (if it exists)
+					Coord co = coordMap.get(id);
+					if(co != null) {
+						el = new Node(id, co);
+						nodeMap.put(id, (Node)el);
+					}
+				}
 			} else if ("relation".equals(type)) {
 				el = relationMap.get(id);
 			} else
@@ -269,10 +283,23 @@ class Osm5XmlHandler extends DefaultHandler {
 		if (type != null) {
 			if ("multipolygon".equals(type))
 				currentRelation = new MultiPolygonRelation(currentRelation);
+			else if("restriction".equals(type)) {
+
+				if(ignoreTurnRestrictions)
+					currentRelation = null;
+				else
+					currentRelation = new RestrictionRelation(currentRelation);
+			}
+			else {
+				log.info("ignoring relation type '" + type + "'");
+				currentRelation = null;
+			}
+		}
+		if(currentRelation != null) {
+			relationMap.put(currentRelation.getId(), currentRelation);
+			currentRelation.processElements();
+			currentRelation = null;
 		}
-		relationMap.put(currentRelation.getId(), currentRelation);
-		currentRelation.processElements();
-		currentRelation = null;
 	}
 
 	/**
@@ -289,8 +316,6 @@ class Osm5XmlHandler extends DefaultHandler {
 		for (Relation r : relationMap.values())
 			converter.convertRelation(r);
 
-		relationMap = null;
-
 		for (Node n : nodeMap.values())
 			converter.convertNode(n);
 
@@ -301,6 +326,15 @@ class Osm5XmlHandler extends DefaultHandler {
 
 		wayMap = null;
 
+		RoadNetwork roadNetwork = mapper.getRoadNetwork();
+		for (Relation r : relationMap.values()) {
+			if(r instanceof RestrictionRelation) {
+				((RestrictionRelation)r).addRestriction(roadNetwork);
+			}
+		}
+
+		relationMap = null;
+
 		if(bbox != null) {
 			mapper.addToBounds(new Coord(bbox.getMinLat(),
 						     bbox.getMinLong()));
@@ -392,8 +426,8 @@ class Osm5XmlHandler extends DefaultHandler {
 		this.converter = converter;
 	}
 
-	public void setCollector(MapCollector mapCollector) {
-		mapper = mapCollector;
+	public void setMapper(MapDetails mapper) {
+		this.mapper = mapper;
 	}
 
 	public void setEndTask(Runnable endTask) {
