Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update from original #1

Merged
merged 119 commits into from
Sep 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
6a4ef6e
render beach from z9
matkoniecz Jul 2, 2014
f04c2b6
Change POIs displayed at z15 and z16 as discussed on #689
matkoniecz Jul 7, 2014
c9ac7a0
follow CartoCSS Style Guidelines
matkoniecz Jul 7, 2014
aa02ce4
render beach from z10
mkoniecz Jul 11, 2014
e98bb12
Create new multi-line shields
pnorman Jul 21, 2014
cd7da91
Split concurrent refs into a multi-line shield
pnorman Jul 21, 2014
0f77fed
Merge branch 'master' into multiline_split_refs
pnorman Jul 23, 2014
5ff7d09
Increase text-dy for default shop style
vholten Jul 26, 2014
2340841
explain workflow in contribution guidelines
polarbearing Jul 27, 2014
364c95b
metatile alignments
polarbearing Jul 27, 2014
4ea5cf0
Delete allotments_3-1.png
polarbearing Jul 28, 2014
9cfa690
rebase allotments.png and remove comment from mss
polarbearing Jul 28, 2014
cba0471
Merge branch 'allotment-metatile' of github.com:polarbearing/openstre…
polarbearing Jul 28, 2014
930c0f5
Drop landuse=grave_yard
matthijsmelissen Jul 28, 2014
e3ae617
Drop polygon-opacity from landcover
matthijsmelissen Jul 28, 2014
14713da
Merge pull request #768 from polarbearing/workflow-contributions
gravitystorm Jul 29, 2014
4c01284
Merge pull request #767 from vholten/shop_names
gravitystorm Jul 29, 2014
5b411de
Merge pull request #793 from math1985/graveyard
gravitystorm Jul 29, 2014
1102359
Move control over road rendering order to SQL
matthijsmelissen Jun 12, 2014
bc730dc
Correct rendering lowzoom and names of links
matthijsmelissen Jul 20, 2014
b9c02d0
Remove no longer needed link references
matthijsmelissen Aug 1, 2014
fc3b3ed
Make colors former transparent landuses darker
matthijsmelissen Aug 1, 2014
d89c6e2
Remove irrelevant subway bridge casing change from PR
matthijsmelissen Aug 1, 2014
543e025
Make bridge values consistent
matthijsmelissen Aug 2, 2014
4f33212
Clean up highway labels
matthijsmelissen Aug 2, 2014
68823cf
Render names of large names at lower zoomlevels
matthijsmelissen Aug 2, 2014
81ce70a
Give service roads the same color as residential roads
matthijsmelissen Aug 4, 2014
a8e8668
Revert accidental change in dasharray of steps
matthijsmelissen Aug 4, 2014
0905f32
Merge branch 'math1985-step-style'
gravitystorm Aug 6, 2014
a1620f1
Merge branch 'service-casing-color' of https://github.com/math1985/op…
gravitystorm Aug 6, 2014
3b7e99c
Merge branch 'math1985-service-casing-color'
gravitystorm Aug 6, 2014
504cbec
Merge pull request #812 from math1985/road-labels
gravitystorm Aug 6, 2014
4a007e5
Merge branch 'bridge-references' of https://github.com/math1985/opens…
gravitystorm Aug 6, 2014
907c27f
Merge branch 'math1985-bridge-references'
gravitystorm Aug 6, 2014
07d9ee5
Merge branch 'opacity' of https://github.com/math1985/openstreetmap-c…
gravitystorm Aug 6, 2014
1da1a37
Merge branch 'math1985-opacity'
gravitystorm Aug 6, 2014
c4fd47a
Merge branch 'lake-names' of https://github.com/math1985/openstreetma…
gravitystorm Aug 6, 2014
f6218ce
Merge branch 'math1985-lake-names'
gravitystorm Aug 6, 2014
6e820cf
Merge branch 'roads-order-2' of https://github.com/math1985/openstree…
gravitystorm Aug 6, 2014
2b68006
Merge branch 'math1985-roads-order-2'
gravitystorm Aug 6, 2014
8fa1e06
Refactor waterway bridges
matthijsmelissen Aug 2, 2014
a1a34dc
Make minimum landuse zoom levels more consistent
matthijsmelissen Aug 1, 2014
d59278f
Render names on junctions
matthijsmelissen Jun 3, 2014
9c6b161
Change junction rendering
matthijsmelissen Aug 2, 2014
4460065
Clean up highway area label
matthijsmelissen Aug 8, 2014
8bbed89
Correct order secondary vs tertiary highway
matthijsmelissen Aug 8, 2014
e282c38
Remove polygon-gamma
pnorman Aug 12, 2014
dc108c3
Clean up and reformat water area SQL
pnorman Aug 12, 2014
ad99638
Don't return way_area for water areas
pnorman Aug 12, 2014
3b3099a
trac requests are migrated to github bugtracker
mkoniecz Aug 12, 2014
d8afe6f
Filter out small areas and use polygon-gamma for large ones
pnorman Aug 14, 2014
4306f12
Turn down polygon-gamma even more for bigger areas
pnorman Aug 14, 2014
40a747d
Re-add highway=platform
matthijsmelissen Aug 15, 2014
fd1df07
Render ways with both highway and railway tag
matthijsmelissen Aug 18, 2014
86ca76a
Add a travis file
pnorman Aug 23, 2014
47bc535
Check the stylesheet is valid carto
pnorman Aug 23, 2014
01e0c9b
Move raceway fill to right layer
matthijsmelissen Aug 23, 2014
1a812ff
Merge pull request #904 from math1985/raceway-order
gravitystorm Aug 27, 2014
74dc238
Merge pull request #903 from pnorman/travis
gravitystorm Aug 27, 2014
8d41ab9
Merge branch 'highway-railway-overlap' of https://github.com/math1985…
gravitystorm Aug 27, 2014
646c94e
Merge branch 'math1985-highway-railway-overlap'
gravitystorm Aug 27, 2014
f53841f
Merge branch 'trac' of https://github.com/mkoniecz/openstreetmap-cart…
gravitystorm Aug 27, 2014
c967011
Merge branch 'mkoniecz-trac'
gravitystorm Aug 27, 2014
7646ba8
Merge pull request #878 from pnorman/polygon-gamma
gravitystorm Aug 27, 2014
6c000e7
Merge pull request #865 from math1985/way-area-dependent-rendering
gravitystorm Aug 27, 2014
aa10cfd
Restore rendering of construction link rendering
matthijsmelissen Aug 28, 2014
52db195
Re-add special rendering of construction links
matthijsmelissen Aug 28, 2014
fe1d623
Order POI by way_area
matthijsmelissen Aug 4, 2014
88ee671
Prevent combinatorial explosion
matthijsmelissen Aug 7, 2014
b355768
Various corrections to 'Order POI by way_area' PR
matthijsmelissen Aug 27, 2014
ca80283
Solve combinatorial explosion caused by shop != ''
matthijsmelissen Aug 28, 2014
bf29d27
Do a linecount on the output XML
pnorman Aug 28, 2014
c3a1665
Merge pull request #910 from math1985/construction-links
gravitystorm Aug 28, 2014
bb1f102
Merge branch 'poi-rendering-order' of https://github.com/math1985/ope…
gravitystorm Aug 28, 2014
aa6bcd0
Merge branch 'math1985-poi-rendering-order'
gravitystorm Aug 28, 2014
89fae79
Merge pull request #911 from pnorman/travis_linecount
gravitystorm Aug 28, 2014
be4700c
Merge pull request #814 from math1985/waterway-bridges
gravitystorm Aug 28, 2014
b8d20b8
Merge pull request #687 from mkoniecz/beach
gravitystorm Aug 28, 2014
47b13c4
Merge branch 'change_POIs_appearing_on_z15_and_z16' of https://github…
gravitystorm Aug 28, 2014
f641677
Merge branch 'mkoniecz-change_POIs_appearing_on_z15_and_z16'
gravitystorm Aug 28, 2014
ae63fab
Merge pull request #770 from polarbearing/allotment-metatile
gravitystorm Aug 28, 2014
4d02591
Merge pull request #809 from math1985/landcover-minzoom
gravitystorm Aug 28, 2014
c967068
switch extract link from metro.teczno to mapzen
erictheise Sep 4, 2014
033379c
fix path: "opentreetmap" -> "openstreetmap"
erictheise Sep 4, 2014
bdde517
Merge pull request #924 from erictheise/patch-2
gravitystorm Sep 5, 2014
cc3352a
Merge pull request #923 from erictheise/patch-1
gravitystorm Sep 5, 2014
882f63d
Add missing `text-placement: interior` attributes
gravitystorm Sep 5, 2014
738a46b
Merge pull request #813 from math1985/crossroad-names
gravitystorm Sep 5, 2014
9d59496
Merge branch 'multiline_split_refs' of https://github.com/pnorman/ope…
gravitystorm Sep 5, 2014
1adb532
Merge branch 'pnorman-multiline_split_refs'
gravitystorm Sep 5, 2014
3189f25
Restore aeroway line rendering
matthijsmelissen Sep 7, 2014
f3d4207
Merge pull request #928 from math1985/aeroway-lines
gravitystorm Sep 8, 2014
8552de0
Use a specific version of carto for travis
pnorman Sep 8, 2014
886adbb
Add a preview image.
gravitystorm Sep 9, 2014
f9737d7
Update some of the text to reflect current status.
gravitystorm Sep 9, 2014
0a79f16
Add the maintainers.
gravitystorm Sep 9, 2014
2e56c08
Move installation instructions to a separate file, since the README h…
gravitystorm Sep 9, 2014
6673e15
Add a description of the versioning system.
gravitystorm Sep 9, 2014
c2ef817
I always like seeing alternatives when I view other projects.
gravitystorm Sep 9, 2014
9d9a06d
Add missing periods
pnorman Sep 9, 2014
2670a1b
More Markdownification
pnorman Sep 9, 2014
fdc32e1
Explain about the shapefiles a bit more
pnorman Sep 9, 2014
1be5578
Add a script that takes a yaml file and converts it to a JSON file
pnorman Sep 9, 2014
9918536
Convert the MML file from JSON to YAML
pnorman Sep 10, 2014
45dbf13
Use alias to avoid duplicating SQL connection information
pnorman Sep 10, 2014
ba95ac9
Conver SQL from in-line escaped scalars to block scalars
pnorman Sep 10, 2014
cfdc110
Merge pull request #933 from pnorman/docs-grammar
gravitystorm Sep 10, 2014
82a8a76
Merge pull request #932 from pnorman/travis_carto_mapnik
gravitystorm Sep 10, 2014
95a56f0
Clean up SQL in the YAML file
pnorman Sep 13, 2014
d31bd93
Add documentation on YAML and SQL to CONTRIBUTING.md
pnorman Sep 13, 2014
72d5baa
Add PyYAML to dependencies, but only if editing the MML file
pnorman Sep 14, 2014
08d3fb8
Fix typo and missed caps/quotes
pnorman Sep 14, 2014
dcbdae6
Whitespace fixes
pnorman Sep 14, 2014
56cd8e0
More caps fixes
pnorman Sep 14, 2014
8317220
Merge branch 'yaml' of https://github.com/pnorman/openstreetmap-carto…
gravitystorm Sep 16, 2014
53aa718
Resync with yaml.
gravitystorm Sep 16, 2014
d97b051
Merge branch 'pnorman-yaml'
gravitystorm Sep 16, 2014
c3663f3
Rephrase some yaml-related information.
gravitystorm Sep 16, 2014
d778979
Use single backticks for inline code unless the code itself contains …
gravitystorm Sep 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: node_js
cache: apt
node_js:
- "0.10"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y -q python-demjson
install:
- npm install [email protected]
- mkdir -p data/world_boundaries
- mkdir -p data/simplified-land-polygons-complete-3857
- mkdir -p data/ne_110m_admin_0_boundary_lines_land
- mkdir -p data/ne_10m_populated_places
- mkdir -p data/land-polygons-split-3857
- touch data/world_boundaries/builtup_area.shp
- touch data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp
- touch data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp
- touch data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp
- touch data/land-polygons-split-3857/land_polygons.shp
script:
- jsonlint project.mml
- ./node_modules/carto/bin/carto project.mml | xmllint - | wc -l
37 changes: 35 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# OpenStreetMap Carto contribution guidelines

## Workflow

We operate the "Fork & Pull" model explained at

https://help.github.com/articles/using-pull-requests

You should fork the project into your own repo, create a topic branch
there and then make one or more pull requests back to the gravitystorm repository.
Your pull requests will then be reviewed and discussed.

## Editing Layers

OpenStreetMap Carto uses a YAML file for defining layers. Some of the rationale is outlined in [a GitHub issue](https://github.com/gravitystorm/openstreetmap-carto/issues/711). Editing multi-line SQL statements in a YAML file is much friendlier than editing escaped SQL in a JSON file.

This requires a preprocessing step to convert the YAML to JSON. A script is provided at `scripts/yaml2mml.py`, which depends on PyYAML, available through `pip install pyyaml` or packaged on Ubuntu as `python-yaml`.

After editing the YAML file, run `./scripts/yaml2mml.py < project.yaml > project.mml && touch project.mml` to update the file and force TileMill to reload it.

When committing changes, add both the `project.yaml` and `project.mml` files to the commit. One of the big advantages of this system is that to resolve any layer merge conflicts, they only need to be resolved in the YAML file where they are easier to handle, then the JSON file can be regenerated, while at the same time the styles work with Tilemill out-of-the-box without needing to run the `yaml2mml` script.

## CartoCSS Style Guidelines

* Always specify zoom levels as either >= or < . Don't use = or =< or >
Expand All @@ -8,7 +28,6 @@
* Two space indents. No tabs.
* space after : but not before
* Dashes, not underscores, in layer names
* Name SQL subqueries after the layer name (but use underscores)
* Avoid restating defaults, e.g. don't add `point-allow-overlap = false`
* Avoid repeating the layer name for layers with mutiple attachments, i.e., prefer

Expand Down Expand Up @@ -38,8 +57,22 @@ instead of
```
* Order the selectors in a style-sheet in rough order of importance (i.e., highway=primary, then highway=secondary) and beyond that, add layers that are rendered later (i.e., higher) lower in the file.

## SQL Style Guidelines
Because SQL within JSON or YAML will not generally be syntax highlighted, indentation and caps are particularly important.

* SQL keywords in caps, as in PostgreSQL documentation
* Two space indents. No tabs.
* Start with `(SELECT` and start the columns on the next line.
* Two indents for columns, to bring them to the same indent level as later clause contents
* Add indentation after `SELECT`s until the end of the sub-select.
* Add indentation for contents of `FROM`, `WHERE`, `ORDER BY` and other clauses
* Put content with WHERE, etc if it's short
* Add indentation if necessary for complex function calls, WHERE parenthesis, and CASE statements
* One space before and after = etc
* Name SQL subqueries after the layer name (but use underscores)

## Previews

Some changes benefit from a review from a wider audience. In most cases some static images are sufficient, but sometimes a demo layer is necessary. pnorman has a private server which can host layers and has some data from parts of the world loaded. Before requesting this in a pull request, make sure that you don't anticipate any more changes to it.

This does not replace reviewing your changes in Tilemill
This does not replace reviewing your changes in Tilemill
95 changes: 95 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Installation

You need OpenStreetMap data loaded into a PostGIS database (see below for [dependencies](https://github.com/gravitystorm/openstreetmap-carto#dependencies)). These stylesheets currently work only with the osm2pgsql defaults (i.e. database name is `gis`, table names are `planet_osm_point`, etc).

It's probably easiest to grab an PBF of OSM data from [Mapzen](https://mapzen.com/metro-extracts/) or [geofabrik](http://download.geofabrik.de/). Once you've set up your PostGIS database, import with osm2pgsql:

```
osm2pgsql -d gis ~/path/to/data.osm.pbf --style openstreetmap-carto.style
```

You can find a more detailed guide to setting up a database and loading data with osm2pgsql at [switch2osm.org](http://switch2osm.org/loading-osm-data/).

Additionally you need some shapefiles.

## Scripted download

To download the shapefiles you can run the following script from this directory. No further steps should be needed as the data has been processed and placed in the requisite directories.

```
./get-shapefiles.sh
```

## Manual download

You can also download them manually at the following paths:

* [`simplified-land-polygons.shp`](http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip) (updated daily)
* [`land-polygon.shp`](http://data.openstreetmapdata.com/land-polygons-split-3857.zip) (updated daily)
* [`builtup_area.shp`](http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz)
* [`ne_110m_admin_0_boundary_lines_land.shp`](http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip)
* [`ne_10m_populated_places_fixed.shp`](http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip) (and see [below](#populated-places-shapefile))

The repeated www.naturalearthdata.com in the Natural Earth shapefiles is correct.

Put these shapefiles at `path/to/openstreetmap-carto/data`.

### Populated places shapefile

The Natural Earth 2.0 populated places shapefile contains data that triggers a bug in mapnik. As
a workaround we run the shapefile through ogr2ogr to clean up the data.

```
ogr2ogr ne_10m_populated_places_fixed.shp ne_10m_populated_places.shp
```

See https://github.com/mapnik/mapnik/issues/1605 for more details.

## Fonts
The stylesheet depends on a number of openly licensed fonts for support of all the languages found on the map. The package which supplies these fonts on Ubuntu is indicated.

If a font is missing, it will skip to the next available font which contains those characters. If you are not concerned with a particular language, you do not need its fonts. DejaVu Sans and Unifont are the two required fonts, and included on most systems.

### Global
* DejaVu Sans, for most languages (`ttf-dejavu`)
* Droid Sans Fallback, as a reasonable fallback (`fonts-droid`)
* Unifont, as a last resort fallback (`ttf-unifont`)

### Southeast Asia
* Arundina Sans, for Thai (`fonts-sipa-arundina`)
* Padauk, for Burmese (`fonts-sil-padauk`)
* Khmer OS Metal Chrieng Regular, for Khmer (`fonts-khmeros`)

### South Asia

* Mukti Narrow, for Bangali (`ttf-indic-fonts-core`)
* Gargi Medium, for Devanagari (`ttf-indic-fonts-core`)
* TSCu_Paranar, for Tamil (`ttf-tamil-fonts`)
* Mallige, for Kannada (`ttf-indic-fonts-core` for normal and bold and `ttf-kannada-fonts` for oblique) *The filename uses "Malige" but the font name uses "Mallige"*

On Ubuntu you can install all the fonts with

```
sudo apt-get install ttf-dejavu fonts-droid ttf-unifont fonts-sipa-arundina fonts-sil-padauk fonts-khmeros \
ttf-indic-fonts-core ttf-tamil-fonts ttf-kannada-fonts
```

## Dependencies

* [TileMill](http://mapbox.com/tilemill) - This is a TileMill project you can copy (or symlink) directly into your Mapbox/project directory

If you aren't using TileMill, you can compile the CartoCSS stylesheets into Mapnik XML using the command-line `carto` command.

* [carto](https://github.com/mapbox/carto) >= 0.9.3 (we're using instances with cascading rules)
* [mapnik](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) >= 2.1.0

---

* [osm2pgsql](http://wiki.openstreetmap.org/wiki/Osm2pgsql) to import your data into a PostGIS database
* [PostgreSQL](http://www.postgresql.org/)
* [PostGIS](http://postgis.org/)
* [ogr2ogr](http://www.gdal.org/) command line GDAL utility for processing vector data. here we use it to work around a encoding bug in the Nautral Earth data.
* curl, unzip for downloading and decompressing files
* shapeindex (a companion utility to Mapnik found in the mapnik-utils package) for indexing downloaded shapefiles

* [PyYAML](http://pyyaml.org/wiki/PyYAML) if editing the MML (layer definition) file (packaged as `python-yaml` on Ubuntu, or installed with `pip install pyyaml`)
147 changes: 50 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,40 @@
# OpenStreetMap Carto

The standard stylesheet on [OpenStreetMap.org](http://www.openstreetmap.org) An implemention of the standard OpenStreetMap mapnik style, in CartoCSS.
![screenshot](https://raw.github.com/gravitystorm/openstreetmap-carto/master/preview.png)

These are the CartoCSS map stylesheets for the Standard map layer on [OpenStreetMap.org](http://www.openstreetmap.org).

These stylesheets can be used in your own cartography projects, and are designed to be easily
customised. They work with [TileMill](http://www.mapbox.com/tilemill/) and also with the command-line [CartoCSS](https://github.com/mapbox/carto) processor.

Since August 2013 these stylesheets are used on the OSMF tileservers (tile.openstreetmap.org), and
are updated from each point release. They supersede the previous [XML-based stylesheets](https://trac.openstreetmap.org/browser/subversion/applications/rendering/mapnik)

# Setup

You need OpenStreetMap data loaded into a PostGIS database (see below for [dependencies](https://github.com/gravitystorm/openstreetmap-carto#dependencies)). These stylesheets currently work only with the osm2pgsql defaults (i.e. database name is ``gis``, table names are ``planet_osm_point``, etc).

It's probably easiest to grab an PBF of OSM data from [metro.teczno.com](http://metro.teczno.com/) or [geofabrik](http://download.geofabrik.de/). Once you've set up your PostGIS database, import with osm2pgsql:

```
osm2pgsql -d gis ~/path/to/data.osm.pbf --style openstreetmap-carto.style
```

You can find a more detailed guide to setting up a database and loading data with osm2pgsql at [switch2osm.org](http://switch2osm.org/loading-osm-data/)

Additionally you need some shapefiles.

## Scripted download

To download the shapefiles you can run the following script from this directory. No further steps should be needed as the data has been processed and placed in the requisite directories.

```
./get-shapefiles.sh
```

## Manual download

You can also download them manually at the following paths:

* `simplified-land-polygons.shp` [download](http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip)
* `land-polygon.shp` [download](http://data.openstreetmapdata.com/land-polygons-split-3857.zip)
* `builtup_area.shp` [download](http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz)
* `ne_110m_admin_0_boundary_lines_land.shp` [download](http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip)
* `ne_10m_populated_places_fixed.shp` [download](http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip) (and see below)

Put these shapefiles at path/to/opentreetmap-carto/data

### Populated places shapefile
Since August 2013 these stylesheets have been used on the OSMF tileservers (tile.openstreetmap.org), and
are updated from each point release. They supersede the previous [XML-based stylesheets](https://trac.openstreetmap.org/browser/subversion/applications/rendering/mapnik).

The Natural Earth 2.0 populated places shapefile contains data that triggers a bug in mapnik. As
a workaround we run the shapefile through ogr2ogr to clean up the data.
# Installation

```
ogr2ogr ne_10m_populated_places_fixed.shp ne_10m_populated_places.shp
```
You need a PostGIS database populated with OpenStreetMap data in the standard
osm2pgsql database layout, along with auxillary shapefiles. See [INSTALL.md](INSTALL.md).

See https://github.com/mapnik/mapnik/issues/1605 for more details.
# Contributing

## Fonts
The stylesheet depends on a number of openly licensed fonts for support of all the languages found on the map. The package which supplies these fonts on Ubuntu is indicated.
Contributions to this project are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md)
for full details.

If a font is missing, it will skip to the next available font which contains those characters. If you are not concerned with a particular language, you do not need its fonts. DejaVu Sans and Unifont are the two required fonts, and included on most systems.
# Versioning

### Global
* DejaVu Sans, for most languages (``ttf-dejavu``)
* Droid Sans Fallback, as a reasonable fallback (``fonts-droid``)
* Unifont, as a last resort fallback (``ttf-unifont``)
This project follows a MAJOR.MINOR.PATCH versioning system. In the context of a
cartographic project you can expect the following:

### Southeast Asia
* Arundina Sans, for Thai (``fonts-sipa-arundina``)
* Padauk, for Burmese (``fonts-sil-padauk``)
* Khmer OS Metal Chrieng Regular, for Khmer (``fonts-khmeros``)

### South Asia

* Mukti Narrow, for Bangali (``ttf-indic-fonts-core``)
* Gargi Medium, for Devanagari (``ttf-indic-fonts-core``)
* TSCu_Paranar, for Tamil (``ttf-tamil-fonts``)
* Mallige, for Kannada (``ttf-indic-fonts-core`` for normal and bold and ``ttf-kannada-fonts`` for oblique) *The filename uses "Malige" but the font name uses "Mallige"*

On Ubuntu you can install all the fonts with

```
sudo apt-get install ttf-dejavu fonts-droid ttf-unifont fonts-sipa-arundina fonts-sil-padauk fonts-khmeros \
ttf-indic-fonts-core ttf-tamil-fonts ttf-kannada-fonts
```

## Dependencies

* [TileMill](http://mapbox.com/tilemill) - This is a TileMill project you can copy (or symlink) directly into your Mapbox/project directory

If you aren't using TileMill, you can compile the CartoCSS stylesheets into Mapnik XML using the command-line `carto` command.

* [carto](https://github.com/mapbox/carto) >= 0.9.3 (we're using instances with cascading rules)
* [mapnik](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) >= 2.1.0

---

* [osm2pgsql](http://wiki.openstreetmap.org/wiki/Osm2pgsql) to import your data into a PostGIS database
* [PostgreSQL](http://www.postgresql.org/)
* [PostGIS](http://postgis.org/)
* [ogr2ogr](http://www.gdal.org/) command line GDAL utility for processing vector data. here we use it to work around a encoding bug in the Nautral Earth data.
* curl, unzip for downloading and decompressing files
* shapeindex (a companion utility to Mapnik found in the mapnik-utils package) for indexing downloaded shapefiles
* PATCH: When a patch version is released, there would be no reason not to
upgrade. PATCH versions contain only bugfixes e.g. stylesheets won't compile,
features are missing by mistake, etc.
* MINOR: These are routine releases and happen every 1-3 weeks. They will
contain changes to what's shown on the map, how they appear, new features
added and old features removed. They may rarely contain changes to assets i.e.
shapefiles and fonts but will not contain changes that require software or
database upgrades.
* MAJOR: Any change the requires reloading a database, or upgrading software
dependecies will trigger a major version change.

# Roadmap

Expand All @@ -107,25 +43,42 @@ If you aren't using TileMill, you can compile the CartoCSS stylesheets into Mapn
This was a full re-implementation of the original OSM style, with only a few bugs discovered later. There's been
no interest in creating further point releases in the v1.x series.

## Easier to wrangle (v2.x)
## Current work (v2.x)

There are a number of refactorings that can be made to the style, either to fix glitches
with the current style, or to leverage new features in carto / mapnik to simplify the stylesheets
with only small changes to the output. It's also appropriate to pull out some of the 'old-skool'
The v2.x series focuses on refactoring the style, both to to fix glitches and to
leverage new features in CartoCSS / mapnik to simplify the stylesheets with only
small changes to the output. It's also appropriate to pull out the 'old-skool'
tagging methods that are now rarely used.

Care is being taken to not get too clever with variables and expressions. While these often make
it easier to customise, experience has shown that over-cleverness (e.g. [interpolated entities][cleverness])
can discourage contributions.

The end goal will be a style that hews close to the current look of the standard style, but is
much more suitable for further development, and/or forking for third-parties to customise.
The end goal will be a style that remains familiar but is much more suitable for
further development, and/or forking for third-parties to customise.

## Tackle the backlog (v3.x)
## Future (v3.x)

There are over [400 open requests][trac] on trac, some that have been open for years. These need
There are over [300 open requests][issues], some that have been open for years. These need
reviewing and dividing into obvious fixes, or additional new features that need some cartographic
judgement. The work done already in v1.0 and v2.0 will make it much easier to process these.

[trac]: https://trac.openstreetmap.org/query?component=mapnik&status=!closed&order=changetime&desc=1&max=500
[issues]: https://github.com/gravitystorm/openstreetmap-carto/issues
[cleverness]: https://github.com/openstreetmap/mapnik-stylesheets/blob/master/inc/settings.xml.inc.template#L16

# Alternatives

There are many open-source stylesheets written for creating OpenStreetMap-based
maps using mapnik, many based on this project. Some alternatives are:

* [OSM-Bright](https://github.com/mapbox/osm-bright)
* [XML-based stylesheets](https://trac.openstreetmap.org/browser/subversion/applications/rendering/mapnik)
* [osmfr-cartocss](https://github.com/cquest/osmfr-cartocss)
* [openstreetmap-carto-german](https://github.com/woodpeck/openstreetmap-carto-german)

# Maintainers

* Andy Allan [@gravitystorm](https://github.com/gravitystorm/)
* Matthijs Melissen [@math1985](https://github.com/math1985/)
* Paul Norman [@pnorman](https://github.com/pnorman/)
* Mateusz Konieczny [@mkoniecz](https://github.com/mkoniecz/)
Loading