> In principle, it should be quite possible to route across tiles that
> have a wiggly boundary. This could be achieved quite straightforwardly
> by the splitter tagging the boundary points so that mkgmap knows where
> they are.

The attached patch is possibly all you need in mkgmap to be able to
route across non-straight boundaries - it simply recognises nodes that
have been tagged with mkgmap:on-boundary=1. Note, that this is an
XML attribute on the node element not an OSM "tag" element. 

The splitter would have to add this tag to the last point in each way
that has been split at a tile boundary.

Completely untested but it could be worth experimenting with.

Mark
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 a4227e6..5186bf1 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
@@ -154,7 +154,8 @@ class Osm5XmlHandler extends DefaultHandler {
 
 				addNode(attributes.getValue("id"),
 						attributes.getValue("lat"),
-						attributes.getValue("lon"));
+						attributes.getValue("lon"),
+						"1".equals(attributes.getValue("mkgmap:on-boundary")));
 
 			} else if (qName.equals("way")) {
 				mode = MODE_WAY;
@@ -758,7 +759,7 @@ class Osm5XmlHandler extends DefaultHandler {
 	 * @param slat The lat as a string.
 	 * @param slon The longitude as a string.
 	 */
-	private void addNode(String sid, String slat, String slon) {
+	private void addNode(String sid, String slat, String slon, boolean onBoundary) {
 		if (sid == null || slat == null || slon == null)
 			return;
 		
@@ -770,6 +771,10 @@ class Osm5XmlHandler extends DefaultHandler {
 			currentElementId = id;
 			if (bbox == null)
 				mapper.addToBounds(co);
+			if(onBoundary) {
+				co.setOnBoundary(true);
+				co.incHighwayCount();
+			}
 		} catch (NumberFormatException e) {
 			// ignore bad numeric data.
 		}
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to