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

Require Mapnik 3 and CartoCSS 0.16.0 #2473

Merged
merged 3 commits into from
Dec 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ addons:
node_js:
- "0.10"
install:
- npm install carto@0.12.1
- npm install carto@0.16.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should really use 0.16.3 as the versions before contain some regressions. For linting this does not make a difference but maybe is the wrong signal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in sync with with INSTALL.md. I want to test with the minimum carto version and the latest, but that's a bigger change that I want to keep to a different PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

- mkdir -p data/world_boundaries data/simplified-land-polygons-complete-3857 data/ne_110m_admin_0_boundary_lines_land data/ne_10m_populated_places data/land-polygons-split-3857
- touch data/world_boundaries/builtup_area.shp data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp data/land-polygons-split-3857/land_polygons.shp
script:
- jsonlint project.mml
- set -o pipefail && ./node_modules/carto/bin/carto project.mml | xmllint - | wc -l
- ./scripts/travis_check_project_files
- find symbols/ -name '*.svg' | xargs xmllint --noout
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## [Unreleased](https://github.com/gravitystorm/openstreetmap-carto/compare/v2.45.1...master)
### Major Changes
- Mapnik 3 is now required
- CartoCSS 0.16.x is now required
- Official Tilemill support is dropped

## [v2.45.1](https://github.com/gravitystorm/openstreetmap-carto/compare/v2.45.0...v2.45.1) - 2016-12-03
### Changes
Expand Down
38 changes: 8 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,14 @@ that are particularly suitable for new contributors to get familiar with the pro

## 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.

The `./scripts/yaml2mml.py` script is provided to convert YAML to JSON, and
depends on PyYAML, available through `pip install pyyaml` or packaged on Ubuntu
as `python-yaml`.

[Kosmtik](https://github.com/kosmtik/kosmtik) can directly load the project from
the YAML file with `node index.js serve path/to/openstreetmap-carto/project.yaml`,
and the JSON file just needs updating before committing.

[TileMill](https://github.com/mapbox/tilemill) and Mapbox `carto` [do not directly support YAML](https://github.com/mapbox/carto/issues/401),
so make edits to the YAML file then run the preprocessing step of
`./scripts/yaml2mml.py && touch project.mml` to
update the file and force TileMill to reload it. You shouldn't use the text editor
built-in to TileMill, it doesn't work with the number of .mss files in the style.
Instead, hide the right pane and use an external text editor.

Before committing changes, run `./scripts/yaml2mml.py`
to update the JSON MML file and `git add project.mml`

When committing changes, add both the `project.yaml` and `project.mml` files to
the commit with `./scripts/yaml2mml.py && git add project.mml`.
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 and carto out-of-the-box without needing to run the
`yaml2mml` script.
OpenStreetMap Carto uses a YAML file for defining layers, because it [works much
better for big projects](https://github.com/gravitystorm/openstreetmap-carto/issues/711).
This requires CartoCSS 0.16.0 or later. If you need JSON MML, you can generate it
with `python -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout)' < project.mml > project.json`
or the equivalent in a different language.

[Kosmtik](https://github.com/kosmtik/kosmtik) and CartoCSS can directly load the project from
the YAML file with `node index.js serve path/to/openstreetmap-carto/project.mml`

## CartoCSS Style Guidelines

Expand Down
12 changes: 5 additions & 7 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,21 @@ DejaVu is packaged as `fonts-dejavu-core`.

For proper rendering of non-latin scripts, particularly those with complicated diacritics and tone marks the requirements are

* Mapnik 3

* FreeType 2.6.2 or later for CJK characters

* A recent enough version of Noto with coverage for the scripts needed.

## Dependencies

For development, a style design studio is needed.
* [Kosmtik](https://github.com/kosmtik/kosmtik) - Kosmtik can be launched with `node index.js serve path/to/openstreetmap-carto/project.yaml`
* [TileMill](http://mapbox.com/tilemill) - This is a TileMill project you can copy (or symlink) directly into your Mapbox/project directory
* [Kosmtik](https://github.com/kosmtik/kosmtik) - Kosmtik can be launched with `node index.js serve path/to/openstreetmap-carto/project.mml`

[TileMill](http://mapbox.com/tilemill) is not officially supported, but you may be able to use a recent TileMill version by copying or simlinking the project directly into your Mapbox/project directory.

For deployment, `carto` and Mapnik are required.

* [carto](https://github.com/mapbox/carto) >= 0.9.5 (we're using instances with cascading rules and min/max zoom properties)
* [mapnik](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) >= 2.1.0. Mapnik 3.0 is supported, but not required.
* [Carto](https://github.com/mapbox/carto) >= 0.16.0 (we're using YAML)
* [Mapnik](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) 3.0

---

Expand All @@ -97,5 +96,4 @@ For both development and deployment, a database and some utilities are required
Some colours, SVGs and other files are generated with helper scripts. Not all users will need these dependencies

* Python and Ruby to run helper scripts
* [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`)
* [Color Math](https://github.com/gtaylor/python-colormath) and [numpy](http://www.numpy.org/) if running generate_road_colors.py helper script (may be obtained with `pip install colormath numpy`)
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
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 [Kosmtik](https://github.com/kosmtik/kosmtik),
[TileMill](http://www.mapbox.com/tilemill/) and also with the command-line
[CartoCSS](https://github.com/mapbox/carto) processor.
to be easily customised. They work with [Kosmtik](https://github.com/kosmtik/kosmtik)
and also with the command-line [CartoCSS](https://github.com/mapbox/carto) processor.

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://github.com/openstreetmap/mapnik-stylesheets).
Expand Down Expand Up @@ -45,12 +44,17 @@ cartographic project you can expect the following:
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.

## Current work (v2.x)
## Mapnik 2 work (v2.x)

The v2.x series initially focused 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, as well as removing 'old-skool'
tagging methods that are now rarely used.
tagging methods that are now rarely used. It then started adding new features.


## Current work (v3.x)
The v3.x series was triggered by an update to the required Mapnik and CartoCSS
versions.

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
Expand All @@ -63,19 +67,19 @@ that need some cartographic judgement.
[issues]: https://github.com/gravitystorm/openstreetmap-carto/issues
[cleverness]: https://github.com/openstreetmap/mapnik-stylesheets/blob/master/inc/settings.xml.inc.template#L16

## Database schema change (v3.x)
## Database schema change (4.x)

The v3.x series will include [osm2pgsql lua transforms](https://github.com/openstreetmap/osm2pgsql/blob/master/docs/lua.md)
The v4.x series will include [osm2pgsql lua transforms](https://github.com/openstreetmap/osm2pgsql/blob/master/docs/lua.md)
and a hstore column with all other tags, allowing use of more OpenStreetMap data.
Work is being done in the [lua branch](https://github.com/gravitystorm/openstreetmap-carto/tree/lua)
and issues have their own [tag](https://github.com/gravitystorm/openstreetmap-carto/issues?q=is%3Aopen+is%3Aissue+label%3Alua).

Initial releases will not make use of the new features, maintaining compatibility
with v2.x and v2.x releases will continue with backports, allowing the style to be
with v3.x and v3.x releases will continue with backports, allowing the style to be
rendered from either a new database or an old one.

When sufficient time has passed for users to reload their databases, new features
can be used and 2.x compatibility will not be maintained.
can be used and 3.x compatibility will not be maintained.

# Alternatives

Expand Down
Loading