[OSM-dev] Converting OSM Mapnik stylesheet to Cascadenik or Carto

AJ Ashton aj.ashton at gmail.com
Wed Jul 27 22:53:58 BST 2011

On Wed, Jul 27, 2011 at 4:30 PM, Graham Jones <grahamjones139 at gmail.com> wrote:
> I think Andy is right about the datasource bits not being very neat - I have
> not worked out how to use variables in the JSON datasource definitions so
> there is a lot of repetition

The general idea throughout development has been that some UI (ie.
TileMill) would be editing that part thus its ok if its not totally
pretty. Cascadenik has the clear advantage in terms of ease of editing
the layer definitions with a text editor. JSON can be fairly readable
but multi-line SQL queries really throw a wrench into that.

Perhaps someone could be persuaded to write Cascadenik-style mml
support (or something with similar features) for Carto.

> If anyone knows how to make the datasource specifications more elegant
> (hartlepool.mml in my repository) - only define the database parameters once
> at the top of the file, for instance, I would be very interested

With the current state of Carto the only way to handle this is by
pre-processing the file. I wrote a very basic script [1] for a
stylesheet I am working on that configures the database parameters for
every layer, as well as the locations of the land shapefiles. It can't
yet handle variables within values (for example, changing a table
prefix within a query).

[1]: https://github.com/mapbox/open-streets-style/blob/master/configure.py

AJ Ashton

More information about the dev mailing list