Re: [mkgmap-dev] Translating route=bus relations

2010-01-03 Thread Marko Mäkelä
On Sat, Jan 02, 2010 at 11:36:28PM +0200, Marko Mäkelä wrote:
 TO DO 1: filter duplicates.

Done, with the apply_once keyword (see my previous message).

 TO DO 2: add a 'points' file that appends the route names to
 the names of bus/train/tram/subway stops, to translate role=*stop members.

Done, revised patch attached.

Next step: Combine the mkgmap --style=routes output with the
mkgmap --style=default output to a gmapsupp.img.  I would really
appreciate help with that, in the form of a simple list of commands.

Best regards,

Marko
Index: resources/styles/routes/relations
===
--- resources/styles/routes/relations	(revision 0)
+++ resources/styles/routes/relations	(revision 0)
@@ -0,0 +1,12 @@
+# Public transportation routes
+type=route  (route=bus|route=ferry|route=subway|route=train|route=tram) {
+  set name='${name} (${ref})' | '${name}' | '${ref}';
+  apply_once { set mkgmap:route='$(mkgmap:route),${name}' | '${name}' }
+}
+
+# Other routes
+
+#type=route  (route=foot|route=hiking)
+#type=route  route=bicycle
+#type=route  route=road
+#type=route  route=ski
Index: resources/styles/routes/version
===
--- resources/styles/routes/version	(revision 0)
+++ resources/styles/routes/version	(revision 0)
@@ -0,0 +1 @@
+0
Index: resources/styles/routes/lines
===
--- resources/styles/routes/lines	(revision 0)
+++ resources/styles/routes/lines	(revision 0)
@@ -0,0 +1,3 @@
+railway=*  mkgmap:route=* { name '${mkgmap:route}' } [0x14 resolution 16]
+route=ferry  mkgmap:route=* { name '${mkgmap:route}' } [0x1b resolution 16]
+highway=*  mkgmap:route=* { name '${mkgmap:route}' } [0x02 resolution 16]
Index: resources/styles/routes/info
===
--- resources/styles/routes/info	(revision 0)
+++ resources/styles/routes/info	(revision 0)
@@ -0,0 +1,18 @@
+#
+# This file contains information about the style.
+# It is completely optional.
+#
+
+
+# A short one line description of the style
+#
+summary: A style for public transportation routes
+
+# Version of the style itself
+#
+version=1.0
+
+description {
+A style for public transportation routes.  This is useful for
+highlighting bus, train, tram, subway etc. routes on a separate map layer.
+}
Index: resources/styles/routes/points
===
--- resources/styles/routes/points	(revision 0)
+++ resources/styles/routes/points	(revision 0)
@@ -0,0 +1,7 @@
+(highway=bus_stop | railway=tram_stop | railway=halt | railway=station)
+ mkgmap:route=* { name '${name|def:} ${ref|def:} (${mkgmap:route})' }
+
+mkgmap:route=*  highway=bus_stop [0x2f17 resolution 18]
+mkgmap:route=*  railway=halt [0x2f08 resolution 19]
+mkgmap:route=*  railway=station [0x2f08 resolution 18]
+mkgmap:route=*  railway=tram_stop [0x2f17 resolution 19]
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] Translating route=bus relations

2010-01-02 Thread Marko Mäkelä
On Sat, Jan 02, 2010 at 10:17:23PM +0200, Marko Mäkelä wrote:
 For what it is worth, here is what I tested so far.  It results in a 1 MB
 gmapsupp.img in 1 tile, while the normal Finland is over 40MB in 3 tiles.
 Some local bus and train routes have been mapped, but no long-distance
 services.

TO DO 1: filter duplicates. There can legitimately be duplicate way members
in route relations, because routes are best drawn as round-trip loops, if you
consider roundabouts (highway routes) or switch points (railways).  For
rail routes, if there are multiple departure and arrival tracks on the end
stations, the most logical option would seem to include each set of tracks
in one roundtrip, something like this:

A1-...-B1-...-A2-...-B2-...-A3-...-B1-...A1

(notation: A,B=stations, A{1,2,3}, B{1,2} are tracks on the stations)

This would of course mean a lot of duplicates (e.g., T,T,T,T,T on the railway
line if the route=train carries ref=T).  I think that this can best be solved
with a filter in the name rule.

TO DO 2: add a 'points' file that appends the route names to
the names of bus/train/tram/subway stops, to translate role=*stop members.

Best regards,

Marko
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Translating route=bus relations

2010-01-01 Thread Clinton Gladstone
On Jan 1, 2010, at 22:34, Marko Mäkelä wrote:

 Could someone give me a hand with map layers (families in Garmin speak,
 if I understand correctly)?  Would I have to invoke mkgmap multiple times,
 once for each map layer (family) and finally to combine the families to
 a single gmapsupp.img?  Or can I ask mkgmap to generate multiple map
 families from the set of map tiles?  What would be the best way to package
 translation rules for bus routes?  If the route=bus layer is to be compiled
 separately from the base layer, then it would need a different style
 altogether, right?  And I guess it could be compiled with fewer and bigger
 map tiles as well?  Currently, my base layer of Finland is 3 tiles.
 I believe that one tile of bus routes would easily cover the entire country,
 at least until all bus routes have been mapped.

I created a public transit layer for Toronto, Canada. Most of your suppositions 
are correct, at least the way I did it:

- I had to invoke mkgmap once for each layer. Each layer had a different draw 
priority, TYP file, and mkgmap options (the public transit layer was 
transparent and not routable).

- I did not use mkgmap to create the final gmapsupp.img file though. Instead I 
used Garmin tools (Roadtrip, MapSource) for this. (Some of the more recent 
changes to mkgmap's gmapsupp code may better support this now.)

- I also created a completely new set of style files for the public transit 
layer. The style files were very basic, containing only items relevant to the 
public transit items (bus, tram, and subway stops, and the transit lines).

- Since the information in the transit layer was so sparse, I also did not need 
to split the map into sub-tiles (I generated the layer from an entire map of 
Ontario, which otherwise needs to be split for the normal layer.) This should 
also most likely be the case for Finland.

Does this help you?

Cheers.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev