At the moment processing of multipolygon boundary relations creates a
lot of unwanted effects (artificial boundaries on tile bounds, lots of
warnings etc.).
The patch excludes the boundary relations from the multipolygon
processing. This can be changed with the new option
--process-boundary-relations.
An additional spin-off is the improved performance and less warnings.
WanMil
Index: resources/help/en/options
===================================================================
--- resources/help/en/options (revision 1624)
+++ resources/help/en/options (working copy)
@@ -234,10 +234,17 @@
--ignore-turn-restrictions
When reading OSM files, ignore any "restriction" relations.
+--process-boundary-relations
+ When reading OSM files, boundary relations are processed. By default
+ they are not processed because most of the boundary relations are
+ incomplete due to splitting of OSM files. When processing these
+ incomplete multipolygons additional artificial boundary lines are
+ created on the tile bounds.
+
--ignore-osm-bounds
When reading OSM files, ignore any "bounds" elements.
With this option selected generate-sea sometimes works better,
- but routing accross tiles will not work.
+ but routing across tiles will not work.
--preserve-element-order
Process the map elements (nodes, ways, relations) in the order
Index: src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
(revision 1624)
+++ src/uk/me/parabola/mkgmap/reader/osm/xml/Osm5XmlHandler.java
(working copy)
@@ -109,6 +109,7 @@
private final boolean makeOppositeCycleways;
private final boolean makeCycleways;
private final boolean ignoreBounds;
+ private final boolean processBoundaryRelations;
private final boolean ignoreTurnRestrictions;
private final boolean linkPOIsToWays;
private final boolean generateSea;
@@ -174,6 +175,7 @@
minimumArcLength = null;
frigRoundabouts = props.getProperty("frig-roundabouts");
ignoreTurnRestrictions =
props.getProperty("ignore-turn-restrictions", false);
+ processBoundaryRelations =
props.getProperty("process-boundary-relations", false);
reportUndefinedNodes =
props.getProperty("report-undefined-nodes", false);
String deleteTagsFileName =
props.getProperty("delete-tags-file");
if(deleteTagsFileName != null)
@@ -600,7 +602,13 @@
long id = currentRelation.getId();
relationMap.put(id, currentRelation);
- currentRelation.processElements();
+ if (processBoundaryRelations == false &&
+ currentRelation instanceof MultiPolygonRelation &&
+
((MultiPolygonRelation)currentRelation).isBoundaryRelation()) {
+ log.info("Ignore boundary multipolygon
"+currentRelation.toBrowseURL());
+ } else {
+ currentRelation.processElements();
+ }
List<Map.Entry<String,Relation>> entries =
deferredRelationMap.remove(id);
Index: src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
(revision 1624)
+++ src/uk/me/parabola/mkgmap/reader/osm/MultiPolygonRelation.java
(working copy)
@@ -98,6 +98,10 @@
copyTags(other);
}
+ public boolean isBoundaryRelation() {
+ return getTag("boundary") != null;
+ }
+
/**
* Retrieves the mp role of the given element.
*
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev