[mkgmap] 01/04: Imported Upstream version 0.0.0+svn3552

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Fri May 1 18:01:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository mkgmap.

commit 3f7bf1e17b7adb0c8f28f31910bc43abc4aef78a
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri May 1 19:48:02 2015 +0200

    Imported Upstream version 0.0.0+svn3552
---
 doc/options.txt                                    | 28 +++++++++----------
 doc/styles/internal-tags.txt                       | 24 ++++++++--------
 doc/styles/rules-filters.txt                       | 14 +++++-----
 doc/styles/rules.txt                               | 14 +++++-----
 doc/tutorial/publish.txt                           | 32 +++++++++++-----------
 resources/help/en/options                          | 22 +++++++--------
 resources/mkgmap-version.properties                |  4 +--
 resources/styles/default/inc/address               |  2 ++
 scripts/download/pre-commit-crlf                   |  2 +-
 src/uk/me/parabola/mkgmap/main/MapMaker.java       |  4 +--
 .../mkgmap/reader/osm/RestrictionRelation.java     | 32 ++++++++++++++--------
 .../mkgmap/reader/polish/PolishMapDataSource.java  | 24 ++++++++--------
 12 files changed, 107 insertions(+), 95 deletions(-)

diff --git a/doc/options.txt b/doc/options.txt
index 5e7456b..54d1300 100644
--- a/doc/options.txt
+++ b/doc/options.txt
@@ -283,20 +283,20 @@ drop-down. The default is "OSM map".
 :   Area name is displayed on Garmin units (or at least on eTrex) as the second 
 part of the mapname in the list of the individual maps.
 
-;--copyright-message=note
-: 	Specify a copyright message for files that do not contain one.
-
-;--copyright-file=file
-: 	Specify copyright messages from a file.
-Note that the first copyright message is not displayed on a device, but is 
-shown in BaseCamp.
-
-;--license-file=file
-: 	Specify a file which content will be added as license. 
-All entries of all maps will be merged in the overview map.
-
-=== Optimization options ===
-
+;--copyright-message=note
+: 	Specify a copyright message for files that do not contain one.
+
+;--copyright-file=file
+: 	Specify copyright messages from a file.
+Note that the first copyright message is not displayed on a device, but is 
+shown in BaseCamp.
+
+;--license-file=file
+: 	Specify a file which content will be added as license. 
+All entries of all maps will be merged in the overview map.
+
+=== Optimization options ===
+
 ;--reduce-point-density=NUM
 : 	Simplifies the ways with the Douglas Peucker algorithm.
 NUM is the maximal allowed error distance, by which the resulting
diff --git a/doc/styles/internal-tags.txt b/doc/styles/internal-tags.txt
index 04a3af8..be2bd71 100644
--- a/doc/styles/internal-tags.txt
+++ b/doc/styles/internal-tags.txt
@@ -59,15 +59,15 @@ A112 | Usually only the first label is displayed. On some units the second label
 [options="header"]
 |=========================================================
 | Tag | Description     | Required mkgmap option
-| +mkgmap:way-has-pois+  | +true+ for ways that have at least one point with a tag +access=\*+, +barrier=\*+, or +highway=*+ | 'link-pois-to-ways'
-| +mkgmap:dead-end-check+  | Set to +false+ to disable the dead end check for a specific way | 'report-dead-ends'
-| +mkgmap:flare-check+  | Set to +true+ to force the flare check for a specific way, set to +false+ to disable it | 'check-roundabout-flares'
-| +mkgmap:dir-check+  | Set to +false+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts'
-| +mkgmap:no-dir-check+  | Set to +true+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts'
-| +mkgmap:synthesised+  | Set to +true+ to tell mkgmap that this is an additional way created using the continue statement in an action block and that it should be excluded from checks | 'check-roundabouts', 'check-roundabout-flares'
-    
-|=========================================================
-
+| +mkgmap:way-has-pois+  | +true+ for ways that have at least one point with a tag +access=\*+, +barrier=\*+, or +highway=*+ | 'link-pois-to-ways'
+| +mkgmap:dead-end-check+  | Set to +false+ to disable the dead end check for a specific way | 'report-dead-ends'
+| +mkgmap:flare-check+  | Set to +true+ to force the flare check for a specific way, set to +false+ to disable it | 'check-roundabout-flares'
+| +mkgmap:dir-check+  | Set to +false+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts'
+| +mkgmap:no-dir-check+  | Set to +true+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts'
+| +mkgmap:synthesised+  | Set to +true+ to tell mkgmap that this is an additional way created using the continue statement in an action block and that it should be excluded from checks | 'check-roundabouts', 'check-roundabout-flares'
+    
+|=========================================================
+
  
 .POI address tags
 [options="header"]
@@ -113,9 +113,9 @@ is used to assign the country location.
 | +mkgmap:admin_level10+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=10+ the element is located in | 'bounds'    
 | +mkgmap:admin_level11+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=11+ the element is located in | 'bounds'    
 | +mkgmap:postcode+  | Name of the postal code relation/polygon the element is located in | 'bounds'    
-| +mkgmap:area2poi+  | The value is +true+ if the POI is derived from a polygon | 'add-poi-to-areas'    
-| +mkgmap:line2poi+  | The value is +true+ if the POI is derived from a line | 'add-poi-to-lines'    
-| +mkgmap:line2poitype+  | The tag is set for each POI generated from a line. Possible values are: +start+, +end+, +mid+, +inner+. | 'add-poi-to-lines'    
+| +mkgmap:area2poi+  | The value is +true+ if the POI is derived from a polygon | 'add-pois-to-areas'    
+| +mkgmap:line2poi+  | The value is +true+ if the POI is derived from a line | 'add-pois-to-lines'    
+| +mkgmap:line2poitype+  | The tag is set for each POI generated from a line. Possible values are: +start+, +end+, +mid+, +inner+. | 'add-pois-to-lines'    
 | +mkgmap:exit_hint+  | +true+ for the part on link roads that should contain information about the exit | 'process-exits'    
 | +mkgmap:exit_hint_name+  | The +name+ tag value of the links exit node | 'process-exits'    
 | +mkgmap:exit_hint_ref+  | The +ref+ tag value of the links exit node | 'process-exits'    
diff --git a/doc/styles/rules-filters.txt b/doc/styles/rules-filters.txt
index 97fb833..9bd816c 100644
--- a/doc/styles/rules-filters.txt
+++ b/doc/styles/rules-filters.txt
@@ -135,13 +135,13 @@ Used to check for duplicate values. If the value of this tag is contained in the
 the value of the tag named as the argument to +not-contained+, then value
 of this tag is set to undefined.
 
-....
-type=route & route=bus & ref=* {
-   apply {
-      set route_ref='$(route_ref),${ref\|not-contained:,:route_ref}' \| '$(route_ref)' \| '${ref}';
-   }
-}
-....
+....
+type=route & route=bus & ref=* {
+   apply {
+      set route_ref='$(route_ref),${ref\|not-contained:,:route_ref}' \| '$(route_ref)' \| '${ref}';
+   }
+}
+....
 
 Here, +ref+ value is only added to +route_ref+ when it is not already contained in that list
 (with separator ','). Otherwise, the value of +route_ref+ is unchanged.
diff --git a/doc/styles/rules.txt b/doc/styles/rules.txt
index 5c427c8..8eff544 100644
--- a/doc/styles/rules.txt
+++ b/doc/styles/rules.txt
@@ -727,13 +727,13 @@ a single OSM element. This could be for clever effects created by
 stacking two lines on top of each other.
 For example if you want to mark a bridge in a distinctive way you
 could match on +bridge=yes+, you would then almost always use +continue+ so
-that the +highway+ tag could be matched later. If you failed to do this
-then there might be a break in the road for routing purposes.
-
-Note that when using the _continue_ statement, the action block
-of the rule (if there is one) will only be applied _within this rule_ and
-not during any following rule matches.  Use the _continue with_actions_
-statement if you want to change this behaviour (see next section).
+that the +highway+ tag could be matched later. If you failed to do this
+then there might be a break in the road for routing purposes.
+
+Note that when using the _continue_ statement, the action block
+of the rule (if there is one) will only be applied _within this rule_ and
+not during any following rule matches.  Use the _continue with_actions_
+statement if you want to change this behaviour (see next section).
 
 === continue with_actions ===
 The with_actions statement modifies the continue behaviour in such a way,
diff --git a/doc/tutorial/publish.txt b/doc/tutorial/publish.txt
index 3476975..5858b72 100644
--- a/doc/tutorial/publish.txt
+++ b/doc/tutorial/publish.txt
@@ -30,19 +30,19 @@ The default is "OSM map".
 --area-name::
 Area name is displayed on Garmin units (or at least on eTrex) as the
 second part of the mapname in the list of the individual maps.
-
---copyright-message=note::
-Specify a copyright message for files that do not contain one.
-A fixed copyright message that is visible in BaseCamp, but not on a
-device, is also included.
-
---copyright-file=file::
-Specify copyright messages from a file. Used if you need to display more
-than one copyright message or do not want the fixed copyright message to
-be included. Note that the first copyright message is not displayed on a
-device, but is shown in BaseCamp. You can make the first line of the
-copyright file blank to work around this.
-
---license-file=file::
-The contents of the file will be used as licence information to
-be added to the map.
+
+--copyright-message=note::
+Specify a copyright message for files that do not contain one.
+A fixed copyright message that is visible in BaseCamp, but not on a
+device, is also included.
+
+--copyright-file=file::
+Specify copyright messages from a file. Used if you need to display more
+than one copyright message or do not want the fixed copyright message to
+be included. Note that the first copyright message is not displayed on a
+device, but is shown in BaseCamp. You can make the first line of the
+copyright file blank to work around this.
+
+--license-file=file::
+The contents of the file will be used as licence information to
+be added to the map.
diff --git a/resources/help/en/options b/resources/help/en/options
index 5a978e6..b37dd71 100644
--- a/resources/help/en/options
+++ b/resources/help/en/options
@@ -290,17 +290,17 @@ Product description options:
   Area name is displayed on Garmin units (or at least on eTrex) as the second 
   part of the mapname in the list of the individual maps.
    
---copyright-message=note
-	Specify a copyright message for files that do not contain one.
-
---copyright-file=file
-	Specify copyright messages from a file.
-	Note that the first copyright message is not displayed on a device, but is 
-	shown in BaseCamp.
-
---license-file=file
-	Specify a file which content will be added as license. 
-  All entrys of all maps will be merged in the overview map.
+--copyright-message=note
+	Specify a copyright message for files that do not contain one.
+
+--copyright-file=file
+	Specify copyright messages from a file.
+	Note that the first copyright message is not displayed on a device, but is 
+	shown in BaseCamp.
+
+--license-file=file
+	Specify a file which content will be added as license. 
+  All entrys of all maps will be merged in the overview map.
 
 Optimization options:
 
diff --git a/resources/mkgmap-version.properties b/resources/mkgmap-version.properties
index e93b584..3b51c84 100644
--- a/resources/mkgmap-version.properties
+++ b/resources/mkgmap-version.properties
@@ -1,2 +1,2 @@
-svn.version: 3498
-build.timestamp: 2015-03-18T08:13:59+0000
+svn.version: 3552
+build.timestamp: 2015-04-29T07:57:34+0100
diff --git a/resources/styles/default/inc/address b/resources/styles/default/inc/address
index f01b26e..4a85973 100644
--- a/resources/styles/default/inc/address
+++ b/resources/styles/default/inc/address
@@ -59,6 +59,8 @@ mkgmap:country=CHE & mkgmap:city!=* & mkgmap:admin_level8=* { set mkgmap:city='$
  
 # Canada
 mkgmap:country=CAN & mkgmap:region!=* & mkgmap:admin_level4=* { set mkgmap:region='${mkgmap:admin_level4}' }
+mkgmap:country=CAN & mkgmap:city!=* & mkgmap:admin_level8=Toronto & mkgmap:admin_level9=* { set mkgmap:city='${mkgmap:admin_level9}' }
+mkgmap:country=CAN & mkgmap:city!=* & mkgmap:admin_level8=Ottawa & mkgmap:admin_level9=* { set mkgmap:city='${mkgmap:admin_level9}' }
 mkgmap:country=CAN & mkgmap:city!=* & mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8|subst:City of }' }
 
 # United States
diff --git a/scripts/download/pre-commit-crlf b/scripts/download/pre-commit-crlf
index e548139..c0b6a70 100755
--- a/scripts/download/pre-commit-crlf
+++ b/scripts/download/pre-commit-crlf
@@ -12,7 +12,7 @@ SVNLOOK=/usr/bin/svnlook
 $SVNLOOK changed -t "$TXN" "$REPOS" | while read kind file
 do
 		$SVNLOOK -t "$TXN" cat "$REPOS" "$file" > $TMP
-		file $TMP | grep -q 'CRLF line'
+		file $TMP | grep -q 'with CRLF'
 		if [ $? = 0 ]; then
 				echo "File '$file' contains CRLF line endings" >&2
 				exit 2
diff --git a/src/uk/me/parabola/mkgmap/main/MapMaker.java b/src/uk/me/parabola/mkgmap/main/MapMaker.java
index 567ebef..5b58556 100644
--- a/src/uk/me/parabola/mkgmap/main/MapMaker.java
+++ b/src/uk/me/parabola/mkgmap/main/MapMaker.java
@@ -113,8 +113,8 @@ public class MapMaker implements MapProcessor {
 
 			MapBuilder builder = new MapBuilder();
 			builder.config(args.getProperties());
-			if (args.getProperties().getProperty("route", false)){
-				if(! OverviewBuilder.OVERVIEW_PREFIX.equals(mapNamePrefix))
+			if(! OverviewBuilder.OVERVIEW_PREFIX.equals(mapNamePrefix)){
+				if (args.getProperties().containsKey("route") || args.getProperties().containsKey("net"))
 					builder.setDoRoads(true);
 			}
 			builder.makeMap(map, src);
diff --git a/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java b/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java
index 4e7b6fe..afc3044 100644
--- a/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java
+++ b/src/uk/me/parabola/mkgmap/reader/osm/RestrictionRelation.java
@@ -46,6 +46,7 @@ public class RestrictionRelation extends Relation {
     private List<Long> toWayIds = new ArrayList<>(2);
     private List<Long> viaWayIds = new ArrayList<>(2);
     private List<Coord> viaPoints = new ArrayList<>(2);
+    private HashSet<Long> updatedViaWays = new HashSet<>(); 
     private Coord viaCoord;
     private String restriction;
 	private byte exceptMask;
@@ -666,21 +667,25 @@ public class RestrictionRelation extends Relation {
 			return;
 		if (viaWayIds.contains(way.getId()) == false)
 			return;
+		if(updatedViaWays.contains(way.getId())){
+			log.error(messagePrefix, "internal error: via way is updated again");
+		}
 		Coord first = way.getPoints().get(nodeIndices.get(0));
 		Coord last = way.getPoints().get(
 				nodeIndices.get(nodeIndices.size() - 1));
 		int posFirst = -1;
-		for (int i = 0; i < viaPoints.size(); i++) {
-			if (first == viaPoints.get(i)) {
-				posFirst = i;
-				break;
-			}
-		}
 		int posLast = -1;
 		for (int i = 0; i < viaPoints.size(); i++) {
-			if (last == viaPoints.get(i)) {
+			if (first == viaPoints.get(i)) 
+				posFirst = i;
+			if (last== viaPoints.get(i)) 
 				posLast = i;
-				break;
+			if (posFirst >= 0 && posLast >= 0){
+				if (Math.abs(posLast - posFirst) == 1){
+					break;
+				} else {
+//					log.error(messagePrefix, "check self intersection!");
+				}
 			}
 		}
 		if (posFirst < 0  || posLast < 0){
@@ -688,7 +693,11 @@ public class RestrictionRelation extends Relation {
 			valid = false;
 			return;
 		}
-		
+		if (Math.abs(posLast - posFirst) != 1){
+			log.error(messagePrefix, "internal error: via way doesn't contain points in expected position");
+			valid = false;
+			return;
+		}
 		List<Coord> midPoints = new ArrayList<>();
 		for (int i = 1; i + 1 < nodeIndices.size(); i++) {
 			midPoints.add(way.getPoints().get(nodeIndices.get(i)));
@@ -712,11 +721,12 @@ public class RestrictionRelation extends Relation {
 			viaWayIds.add(wayPos+1, way.getId());
 		}
 		if (viaPoints.size() != viaWayIds.size()+1){
-			log.error("internal error: number of via points and via ways no longer fits");
+			log.error(messagePrefix,"internal error: number of via points and via ways no longer fits");
 			valid = false;
 		} else if (viaPoints.size() > 6){
 			log.warn(messagePrefix,"has more than 6 via nodes, this is not supported");
 			valid = false;
-		} 
+		}
+		updatedViaWays.add(way.getId());
 	}
 }
diff --git a/src/uk/me/parabola/mkgmap/reader/polish/PolishMapDataSource.java b/src/uk/me/parabola/mkgmap/reader/polish/PolishMapDataSource.java
index c6f5386..6890e74 100644
--- a/src/uk/me/parabola/mkgmap/reader/polish/PolishMapDataSource.java
+++ b/src/uk/me/parabola/mkgmap/reader/polish/PolishMapDataSource.java
@@ -131,9 +131,10 @@ public class PolishMapDataSource extends MapperBasedMapDataSource implements Loa
 			String line;
 			while ((line = in.readLine()) != null) {
 				++lineNo;
-				if (line.trim().isEmpty() || line.charAt(0) == ';')
+				line = line.trim();
+				if (line.isEmpty() || line.charAt(0) == ';')
 					continue;
-				if (line.startsWith("[END"))
+				if (line.toUpperCase().startsWith("[END"))
 					endSection();
 				else if (line.charAt(0) == '[')
 					sectionStart(line);
@@ -192,30 +193,29 @@ public class PolishMapDataSource extends MapperBasedMapDataSource implements Loa
 	 * @param line The raw line from the input file.
 	 */
 	private void sectionStart(String line) {
-		String name = line.substring(1, line.length() - 1);
+		String name = line.substring(1, line.length() - 1).trim();
 		log.debug("section name", name);
 
 		extraAttributes = null;
 
-		if (name.equals("IMG ID")) {
+		if (name.equalsIgnoreCase("IMG ID")) {
 			section = S_IMG_ID;
-		} else if (name.equals("POI") || name.equals("RGN10") || name.equals("RGN20")) {
+		} else if (name.equalsIgnoreCase("POI") || name.equals("RGN10") || name.equals("RGN20")) {
 			point = new MapPoint();
 			section = S_POINT;
-		} else if (name.equals("POLYLINE") || name.equals("RGN40")) {
+		} else if (name.equalsIgnoreCase("POLYLINE") || name.equals("RGN40")) {
 			polyline = new MapLine();
 			roadHelper.clear();
 			section = S_POLYLINE;
-		} else if (name.equals("POLYGON") || name.equals("RGN80")) {
+		} else if (name.equalsIgnoreCase("POLYGON") || name.equals("RGN80")) {
 			shape = new MapShape();
 			section = S_POLYGON;
-		}
-        else if (name.equals("Restrict")) {
+		} else if (name.equalsIgnoreCase("Restrict")) {
             restriction = new PolishTurnRestriction();
             section = S_RESTRICTION;
         }
 		else
-			log.info("Ignoring " + name + " section");
+			System.out.println("Ignoring unrecognised section: " + name);
 	}
 
 	/**
@@ -310,8 +310,8 @@ public class PolishMapDataSource extends MapperBasedMapDataSource implements Loa
 			log.warn("short line? " + line);
 			return;
 		}
-		String name = nameVal[0];
-		String value = nameVal[1];
+		String name = nameVal[0].trim();
+		String value = nameVal[1].trim();
 
 		log.debug("LINE: ", name, "|", value);
 		

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mkgmap.git



More information about the Pkg-grass-devel mailing list