Using osm2pgsql, I imported an OSM extract into a Postgres database. Then I made a layer in in TileMill that contains the data from Postgres. The map was exported to a MBTiles file. At this point, all my transportation features (lines) are on a single layer and my map is terribly unpleasant to look at.

How do I apply the openstreetmap-carto cartocss to my map? I discovered I can create a style for each layer but that seems like a painfully slow way to style my map and I'd need to import each feature onto its own layer resulting in a separate query for each feature line. There's gotta be a better way.

What is the recommended workflow for building a map in TileMill from OSM data in a postgres db?

2 Answers 2


OSM Bright from the MapBox people is also a useful starting point for custom OSM map tiles, unless you're trying to duplicate OSM carto exactly. OSM Bright is a little more lightweight (only 4 .mss style files, fewer layers defined), and easy to customize.

Otherwise, as @math1985 said, just copy the .mml and .mss files from the openstreetmap-carto repo. You could probably just add the OSM-carto repo to your TileMill projects directory, just make sure your postgres database name is the same as theirs, and you'd have to point the layers that reference shapefiles at the appropriate .shp files, or just delete them.


Just checkout openstreetmap-carto in the Tilemill projects directory. The project.mml file, part of openstreetmap-carto, defines the queries and layers, so you won't need to do anything with that yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.