[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] A proposal to solve the translation problem

From: Jeroen van Rijn
Subject: Re: [Maposmatic-dev] A proposal to solve the translation problem
Date: Thu, 5 Apr 2012 20:38:09 +0200

On Thu, Apr 5, 2012 at 19:13, David Decotigny <address@hidden> wrote:
> (Catching up). Do people deploy ocitysmap/maposmatic with their
> private/own stylesheet? Or do they use what we are providing in
> ocitysmap? If we assume that stylesheets are nicely integrated with
> ocitysmap and that most people will be happy with them, I believe we
> should 1/ ship them all with ocitysmap, 2/ go away from using
> configuration files to declare them and register them in a more pythonic
> way.

I don't presently run my own stylesheet, but I do have a set of tasks
on my todo list to:
- See if I can make Garmin GMAPSUPP files from the same DB I run my
development copy of MapOSMatic off of
- Develop a suitable stylesheet (topo) for the above for Geocaching use
- Cobble together a similarly looking stylesheet for Mapnik, possibly
using TileMill (
- If all that hasn't put me off, try to put together a utility that
will translate mapnik stylesheets into garmin .typ files (I doubt this
to be a trivial thing).

Having said all of that, I'm certain I'll have no trouble copying the
default OCitySMap style's support files and editing them. I'll happily
even write up the wiki entry on how to add a custom stylesheet.

> For example, if we assume we ship them all in ocitysmap2/stylesheet,
> then IMHO it's enough to add a file in the stylesheet
> subdirs (eg. maposmatic-printable/) with something like:
>   import os
>   import ocitysmap2
>   class MaposmaticPrintableStyleSheet(ocitysmap2.Stylesheet):
>     def __init__(self):
>        ocitysmap2.Stylesheet.__init__(self)
> = _('maposmatic printable stulesheet')
>        self.path = os.path.join(os.path.dirname(__file__), 'osm.xml')
>        self.description = _('blah')
>        ....etc...
> And then, in ocitysmap2/stylesheet/
>   import ocitysmap2
>   import ocitysmap2.stylesheet.maposmatic_printable as MP
>   import ocitysmap2.stylesheet.pierre_orange as PO
>   # default stylesheet comes first
>   ocitysmap2.register_stylesheet(MP.MaposmaticPrintableStylesheet())
>   ocitysmap2.register_stylesheet(PO.PierreOrangeStylesheet())
>   ....etc...
> And people who want to have their own stylesheet can easily add the glue
> code in ocitysmap2/stylesheet. They also can send us the patch so that
> we integrate them.
> Of course, it means we should add the default stylesheet there (and
> rename the dirs with underscores instead of hyphens).

I think that's a pretty elegant and pythonic solution.

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]