Standard tile layer

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Standard tile layer
· Afrikaans · Alemannisch · aragonés · asturianu · azərbaycanca · Bahasa Indonesia · Bahasa Melayu · Bân-lâm-gú · Basa Jawa · Basa Sunda · Baso Minangkabau · bosanski · brezhoneg · català · čeština · corsu · dansk · Deutsch · eesti · English · español · Esperanto · estremeñu · euskara · français · Frysk · Gaeilge · Gàidhlig · galego · Hausa · hrvatski · Igbo · interlingua · Interlingue · isiXhosa · isiZulu · íslenska · italiano · Kiswahili · Kreyòl ayisyen · kréyòl gwadloupéyen · Kurdî · latviešu · Lëtzebuergesch · lietuvių · magyar · Malagasy · Malti · Nederlands · Nedersaksies · norsk bokmål · norsk nynorsk · occitan · Oromoo · oʻzbekcha/ўзбекча · Plattdüütsch · polski · português · română · shqip · slovenčina · slovenščina · Soomaaliga · suomi · svenska · Tagalog · Tiếng Việt · Türkçe · Vahcuengh · vèneto · Wolof · Yorùbá · Zazaki · српски / srpski · беларуская · български · қазақша · македонски · монгол · русский · тоҷикӣ · українська · Ελληνικά · Հայերեն · ქართული · नेपाली · मराठी · हिन्दी · भोजपुरी · অসমীয়া · বাংলা · ਪੰਜਾਬੀ · ગુજરાતી · ଓଡ଼ିଆ · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · සිංහල · བོད་ཡིག · ไทย · မြန်မာဘာသာ · ລາວ · ភាសាខ្មែរ · ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ‎ · አማርኛ · 한국어 · 日本語 · 中文(简体)‎ · 中文(繁體)‎ · 吴语 · 粵語 · ייִדיש · עברית · اردو · العربية · پښتو · سنڌي · فارسی · ދިވެހިބަސް
Standard style layer
or OpenStreetMap Carto
Screenshot of Standard style layer.
Author Andy Allan and other contributors
Tiles License CC-BY-SA 2.0
Tiles Website www.openstreetmap.org
Style License CC0 1.0
Style Website github.com/gravitystorm/openstreetmap-carto

The Standard tile layer is the default tile layer stylesheet on the OpenStreetMap homepage, specifically called OpenStreetMap Carto (or osm-carto for short).

The stylesheet is maintained at https://github.com/gravitystorm/openstreetmap-carto. Bug reports (e.g. rendering problems of specific object classes) can be raised there (needs a login with a GitHub account).

OSM servers deployment

OSM homepage with standard tile layer

OSM tileservers have used the openstreetmap-carto style since August 2013. OSM tileserver generation statistics are available, you can read also about tiles rendering process.

Low and medium zoom tiles (z0-z12) are usually re-rendered only when new osm-carto version is being deployed. Database schema change should not be requested more often than 1-2 times a year (probably combined with major PostgreSQL release).

If using the Standard tiles from openstreetmap.org tile servers in other applications, you must follow the Tile usage policy.

Map key

See Standard tile layer/Key.

Technical details

Design

The style is designed as a general purpose map of the world, so for example:

  • special objects (like seamarks or railway details) will not be rendered
  • labels are rendered with a name=* value (whatever it contains for a given object), so it's not displaying English names all over the world
  • there are no country specific symbols (like for example road shields or subway/metro signs), they all have a uniform look

While osm-carto tries to show many different objects, it's not possible to render everything stored in a database, so opt-in selection is made.

Mapnik and CartoCSS

openstreetmap-carto tiles are rendered using the Mapnik toolkit. That being said, openstreetmap-carto and Mapnik are not the same thing! Mapnik is a map rendering library used for many map stylesheets (including openstreetmap-carto).

CartoCSS is used to pre-process the stylesheet into Mapnik XML format (since August 2013).

Rendering order

In this case upper residential area is larger than forest area and lower residential area is smaller than forest area

This style has multiple layers. For example names of waterways are rendered over waterways, shops are rendered over buildings, tunnels are rendered over buildings, roads are rendered over landcover etc.

The remaining question is how objects are rendered within layer. For some cases collisions are not allowed and objects that would cover already rendered object from given layer is not rendered. It is done for example for cities, where labels for smaller that would collide with label for larger one are not rendered.

Landcover areas are ordered by area, with smaller ones later and collisions are allowed. It means that for a given layer smaller areas will cover larger.

For example small leisure=park area will be rendered over larger landuse=residential area.

There is also a separate overlay layer containing for example tree symbols for forest landcover, that is rendered over landcover fill.

  • area covered by small landuse=forest and large landuse=residential
    • forest fill will be rendered over residential fill and cover it, later forest overlay will be rendered over that
  • area covered by large landuse=forest and small landuse=residential
    • residential fill will be rendered over forest fill and cover it, later forest overlay will be rendered over that

Database

The database for osm-carto uses hstore and is pre-processed with a lua script, so only the rendering-related elements are available.

Code structure

General project configuration is included in project.mml (YAML). There are defined so called "layers", which include mainly SQL statements selecting the objects, while actual styling is done in multiple *.mss files. All the icons are pixel-aligned vector images (SVG). Some patterns are also done this way, but if they are still raster images (PNG), they are derived from vector elements and the process is documented, so it should be easy to migrate to a vector format when possible.

Roads code is very complex and is partially generated by the helper scripts.

Fonts

Noto font is used if possible, with DejaVu Sans, Hanazono and Unifont used as fallbacks.

External sources

The style relies partly on some external data files coming from Natural Earth and preprocessed OSM data repository OpenStreetMapData. They can be updated with a Python script (scripts/get-shapefiles.py) or by hand.

Rendering coastline on openstreetmap.org is described here: Coastline#Rendering_in_Standard_tile_layer_on_openstreetmap.org.

Contributing and installing

You can set up a copy of the openstreetmap-carto rendering stylesheets for yourself. For more technical information, including setup instructions, see https://github.com/gravitystorm/openstreetmap-carto on GitHub. Contribution guidelines are documented here. One can set a simple Docker-based environment for testing. Some easy tasks has been selected for getting started with the process.

Forks

Standard osm-carto style is used as a base for some forks, especially:

External links