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-02 Thread Marko Mäkelä
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.

I did not test combining multiple map families (layers) to a single
gmapsupp.img yet.

Marko
tested with the following command:
 bzip2 -dc ../finland.osm.bz2|
 java -Xmx1024m -jar ../mkgmap.jar --style=routes --latin1 --gmapsupp \
 --remove-short-arcs --country-abbr=FIN --country-name=Finland \
 --mapname=73174273 --description=routes --tdbfile --input-file=/dev/fd/0
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 { 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.
+}
___
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ä
Clinton,

Thank you for confirming my thinking.  I would like to see this functionality
committed to mkgmap.

> - 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).

Do you think that it could work without a TYP file?  I suppose that you are
defining custom symbols for bus/tram/rail stops and custom line styles for
the routes, by operator or network or vehicle type.

Could routing make sense?  Not all way attributes are accessible in every
unit, but a subset could be.  The Edge 705 can be told to avoid unpaved,
toll roads or highways.  For example, we could define long distance routes
as toll=yes, and subway routes as unpaved.  But this might only be practical
if the layer contained all walkable ways, which would blow up the size.
Good routing would also have to know about schedules.  This is something that
could be implemented in a GPS-enabled smartphone or netbook within GpsMid
or the like.  (There are web-based solutions already, though.)

> - 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.)

Could you please try out if it works with mkgmap now?

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


[mkgmap-dev] Translating route=bus relations

2010-01-01 Thread Marko Mäkelä
Hi all,

The attached patch is a quick and dirty attempt at adding bus route
information to the map, by appending to the street name.  Some street
names are not being appended to, but the patch is already generating
impractically long street names near bus stations.  In other words,
the route information should instead be generated on layer(s) separate
from the "base" map.

It seems to me that the optimal translation rules for bus routes could
be place-specific.  For example in the Helsinki metropolitan area,
${ref} is really enough for identifying local bus routes.  The attached patch
displays ${network} too, but end users could infer that from ${ref}.

Long-distance bus routes might need ${operator}, but they could already
be identified by ${name} (a dash-separated list of place names).

It would seem to make sense to have long-distance routes and local routes
on separate layers.  One common layer could be enough for all local routes,
for ease of use too (need to disable/enable one "local bus" layer instead
of selecting "local bus Helsinki", "local bus Turku" etc.)

Then again, some control freaks could like to have one layer per ${network}
or ${operator}.  Then the labels on the lines could omit ${network} or
${operator}, only mention the ${ref}.

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.

Best regards,

Marko
Index: resources/styles/default/relations
===
--- resources/styles/default/relations	(revision 1451)
+++ resources/styles/default/relations	(working copy)
@@ -20,3 +20,9 @@
 set mkgmap:boundary_name='$(mkgmap:boundary_name)/${name}' | '${name}';
   }
 }
+type=route & route=bus { add name='${network|def:}${ref}' }
+type=route & route=bus { apply
+  {
+set mkgmap:route_name='$(mkgmap:route_name)/${name}' | '${name}';
+  }
+}
Index: resources/styles/default/lines
===
--- resources/styles/default/lines	(revision 1451)
+++ resources/styles/default/lines	(working copy)
@@ -25,6 +25,7 @@ contour=elevation | contour_ext=elevatio
 	[0x21 resolution 20]
 
 # Set highway names to include the reference if there is one
+highway=* {set name='${name} (${mkgmap:route_name})'}
 highway=motorway {name '${ref|highway-symbol:hbox} ${name}' | '${ref|highway-symbol:hbox}' | '${name}' }
 highway=trunk {name '${ref|highway-symbol:hbox} ${name}' | '${ref|highway-symbol:hbox}' | '${name}' }
 highway=primary {name '${ref|highway-symbol:box} ${name}' | '${ref|highway-symbol:box}' | '${name}' }
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev