logo separator

[mkgmap-dev] patches

From Brian Egge brianegge at gmail.com on Thu Nov 6 02:13:57 GMT 2014

Thanks Ben for the hints with the boundary files. It looks like they are published weekly on the site you linked to. I modify my build script to download them when they change:

wget -N --user-agent="www.theeggeadventure.com" http://osm2.pleiades.uni-wuppertal.de/sea/latest/sea.zip
wget -N --user-agent="www.theeggeadventure.com" http://osm2.pleiades.uni-wuppertal.de/bounds/latest/bounds.zip <http://osm2.pleiades.uni-wuppertal.de/bounds/latest/bounds.zip>

The NYC addresses are working well. I have a minor correction as follows:

Index: resources/styles/default/inc/address
===================================================================
--- resources/styles/default/inc/address	(revision 3342)
+++ resources/styles/default/inc/address	(working copy)
@@ -66,8 +66,11 @@
 # New York City has different admin levels than the rest of the US.
 # https://wiki.openstreetmap.org/wiki/United_States_admin_level
 mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='New York County' { set mkgmap:city='New York' }
-mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='Bronx County' { set mkgmap:city='The Bronx' }
+mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='Bronx County' { set mkgmap:city='Bronx' }
 mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='Kings County' { set mkgmap:city='Brooklyn' }
+# Queens uses neighborhoods for city in postal addresses
+# http://en.wikipedia.org/wiki/List_of_Queens_neighborhoods
+mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='Queens County' & mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8}' }
 mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='Queens County' { set mkgmap:city='Queens' }
 mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level5='New York City' & mkgmap:admin_level6='Richmond County' { set mkgmap:city='Staten Island' }
 mkgmap:country=USA & mkgmap:city!=* & mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8|subst:City of }’ }

One always says ‘The Bronx’, but in addresses is it’s simply Bronx. For Queens, the neighborhood is used in mailing addresses, though sometimes people will use ‘Queens’ instead. If you look up "40-01 43 AVENUE” www.usps.com <http://www.usps.com/>, it says the standardized address is:
4001 43RD AVE
SUNNYSIDE NY 11104-3205

But, the school board <http://schools.nyc.gov/SchoolPortals/30/Q150/default.htm> lists it’s address as:
40-01 43 AVENUE
QUEENS, NY11104

While the school itself <https://sites.google.com/site/ps150queens/> says it’s address is:
40-01 43 Avenue  Sunnyside, NY 11104

If I’m given an address, most likely it will have the neighborhood in it, and not ‘Queens’. 

Here’s an alternative patch to pick up place_name:
Index: src/uk/me/parabola/mkgmap/build/LocatorUtil.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/LocatorUtil.java	(revision 3342)
+++ src/uk/me/parabola/mkgmap/build/LocatorUtil.java	(working copy)
@@ -28,7 +28,7 @@
 			.compile("[,\\s]+");
 	
 	public static List<String> getNameTags(Properties props) {
-		String nameTagProp = props.getProperty("name-tag-list", "name");
+		String nameTagProp = props.getProperty("name-tag-list", "name,place_name");
 		return Arrays.asList(COMMA_OR_SPACE_PATTERN.split(nameTagProp));
 	}
 
Can we reduce the logging from the RuleFileReader by default? It produces a huge amount of output which probably isn’t useful unless you are debugging the rule reader.
Index: src/uk/me/parabola/mkgmap/osmstyle/RuleFileReader.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/RuleFileReader.java	(revision 3342)
+++ src/uk/me/parabola/mkgmap/osmstyle/RuleFileReader.java	(working copy)
@@ -243,7 +243,7 @@
 	 * from the expression.
 	 */
 	private void saveRule(TokenScanner scanner, Op op, ActionList actions, GType gt) {
-		log.info("EXP", op, ", type=", gt);
+		log.debug("EXP", op, ", type=", gt);
 
 		// check if the type definition is allowed
 		if (inFinalizeSection && gt != null)

Here’s a bit friendlier documentation:
Index: src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java
===================================================================
--- src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(revision 3342)
+++ src/uk/me/parabola/mkgmap/osmstyle/StyledConverter.java	(working copy)
@@ -926,7 +926,10 @@
 			}
 			else {
 				mp = new MapPoint();
-				log.warn("Motorway exit", node.getName(), "(" + node.getLocation().toOSMURL() + ") has no motorway! (either make the exit share a node with the motorway or specify the motorway ref with a", Exit.TAG_ROAD_REF, "tag)");
+				// This may be caused by a motorway node connecting to two motorway links and no motorway
+				log.warn("Motorway exit", node.getName(), "(" , node.toBrowseURL(), 
+						") has no motorway! (either make the exit share a node with the motorway or specify the motorway ref with a", 
+						Exit.TAG_ROAD_REF, "tag)");
 			}
 		}
 		else {

Note - it an enhancement would be to see if the motorway_link is connected to another motorway_link, and attempt to follow the links back the motorway. 

Standardize the URL:
Index: src/uk/me/parabola/mkgmap/reader/osm/Element.java
===================================================================
--- src/uk/me/parabola/mkgmap/reader/osm/Element.java	(revision 3342)
+++ src/uk/me/parabola/mkgmap/reader/osm/Element.java	(working copy)
@@ -251,7 +251,7 @@
 	}
 
 	public String toBrowseURL() {
-		return "http://www.openstreetmap.org/browse/" + kind() + "/" + id;
+		return "http://www.openstreetmap.org/" + kind() + "/" + id;
 	}
 
 	public Element copy() {



Brian


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20141105/51b80c3d/attachment-0001.html>


More information about the mkgmap-dev mailing list