[OSM-dev] Master class in map style writing

Daniel Koć daniel at xn--ko-wla.pl
Tue Nov 3 21:23:21 UTC 2015


W dniu 03.11.2015 20:21, Andrew Hain napisał(a):
> Following the release of the new map style, would anyone who is 
> familiar
> with writing map style sheets for OSM-based rendering be willing to 
> explain
> the skill of doing so to people who are interested in creating their 
> own
> style but may not know where to start?

I'm one of the contributors to osm-carto style. We use the CartoCSS 
notation, which is more readable than standard XML notation used in some 
other OSM-based styles. Our style is used as a default on OSM.org and 
one of its goals is to be easily customized and it would be good if we 
have more contributors, so I guess this is a good place to start. Some 
essential informations about osm-carto are here:

https://github.com/gravitystorm/openstreetmap-carto/blob/master/README.md
https://github.com/gravitystorm/openstreetmap-carto/blob/master/CARTOGRAPHY.md
https://github.com/gravitystorm/openstreetmap-carto/blob/master/CONTRIBUTING.md

I'm not a programmer nor a HTML/CSS styler, so my code tend to be rather 
basic, but still it's a lot of fun to try to express my ideas. One could 
learn a lot by looking at the code itself and comparing it with the 
rendering output, but I think the best think is just to play with it 
yourself.

We don't have an installer to make it super easy, but we have some 
installation instructions:

https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md
https://github.com/gravitystorm/openstreetmap-carto/issues/657#issuecomment-121279334

Some practical remarks:

1. TileMill editor is no longer in active development and some people 
use Kosmtik instead, but it requires 64-bit platform (I was not able to 
install it on my 32-bit Ubuntu).

2. It's easiest to use Ubuntu Linux 14.04 as a platform, but with some 
additional repo hacking those instructions will work also for newer 
Ubuntu versions.

3. I was also able to partially install it under Windows, but I don't 
know if this setup really works because my friend didn't like Cygwin 
(which is needed for data importing tools).

4. It's better not to start with importing the whole planet dump, 
because it will eat your drive, memory and CPU alive! Most of the time I 
work with my home city and it takes about 10 minutes to load current 
dump. Importing slightly stripped planet dump took me more than 24 
hours. If you're not sure, you can always start with the Luxembourg PBF, 
because it's a whole country, but it has less data than my home city for 
example:

http://download.geofabrik.de/europe/luxembourg.html

5. If you would like to use data from different parts of the world (or 
just different cities), you can switch the database by simple script to 
avoid wasting the time for importing them.

6. It's also possible to manually export data from small selected areas 
from JOSM or directly OSM.org website.

Not a master class, indeed =}, but I hope this will help you start 
playing with OSM data styling. If you have some questions or problems, I 
will try to answer you or at least show where you can learn more.

-- 
"The train is always on time / The trick is to be ready to put your bags 
down" [A. Cohen]



More information about the dev mailing list