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

Switch to Lua transforms and change database schema #2533

Merged
merged 101 commits into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
d48106e
Database reload
matthijsmelissen May 16, 2016
e0aa01d
Add highway=rest_area to list of tags treated as polygon
matthijsmelissen May 17, 2016
1ec1cfc
Merge duplicate code to determine if object is polygon
matthijsmelissen May 17, 2016
02edb0a
Explicitly make variables in .lua script local
matthijsmelissen May 17, 2016
e5660e6
Whitespace in .lua file
matthijsmelissen May 17, 2016
d524487
Move filtering out objects with 0 tags to beginning of function in .l…
matthijsmelissen May 17, 2016
d276c90
Code simplification
matthijsmelissen May 17, 2016
1b82cb6
Typo
matthijsmelissen May 22, 2016
343d1c9
Small performance optimization
matthijsmelissen May 22, 2016
8d0489e
Small code optimization
matthijsmelissen May 30, 2016
d34bebc
Small code optimization
matthijsmelissen May 30, 2016
21d9b80
Combine boundary relation checks
pnorman May 30, 2016
118c5cf
Move columns that are not used in WHERE statements to osm2pgsql
matthijsmelissen May 30, 2016
6798824
Merge remote-tracking branch 'pnorman/combine_boundary_checks' into l…
matthijsmelissen May 30, 2016
ae3f38e
Convet layer to integer and user layer instead of z_order
matthijsmelissen May 30, 2016
04956b4
Clean up and speed up filter_tags_generic
pnorman Jun 2, 2016
d0b1f53
Use luadoc strings
pnorman Jun 2, 2016
73496d8
Only handle area=yes
pnorman Jun 2, 2016
a43cb7a
Refactor polygon special case lists for simpler code
pnorman Jun 2, 2016
659840c
Name polygon function isarea
pnorman Jun 2, 2016
10bff06
Use local vars for polygon stuff
pnorman Jun 2, 2016
5175195
Search through possible polygon tags
pnorman Jun 15, 2016
be2eb57
Refactor lua z_order and roads code
pnorman Jun 16, 2016
4499350
Add testing framework
pnorman Jun 16, 2016
3621bd7
Merge branch 'isarea' of https://github.com/pnorman/openstreetmap-car…
matthijsmelissen Jun 18, 2016
dc36874
Merge branch 'lua_z_order' of https://github.com/pnorman/openstreetma…
matthijsmelissen Jun 18, 2016
f2030f2
Use spaces, not tabs
matthijsmelissen Jun 18, 2016
2ec88f3
Regenerate .mml
matthijsmelissen Jun 26, 2016
b5e4dbd
Merge remote-tracking branch 'math1985/lua_changes' into lua
pnorman Jul 1, 2016
7216ac7
Use 4sp for Lua indents
pnorman Jul 7, 2016
d28339a
Merge pull request #2217 from pnorman/lua_spacing
matthijsmelissen Jul 8, 2016
3ae8ca8
Merge tag 'v2.41.0' into lua
pnorman Jul 13, 2016
73a2cb8
Fix usage of ele
pnorman Jul 19, 2016
3dda54d
Merge tag 'v2.42.0' into lua
matthijsmelissen Aug 3, 2016
3652b34
Drop sport from polygon_keys
matthijsmelissen Aug 8, 2016
cbf2653
Merge pull request #2274 from math1985/lua-sport
pnorman Aug 8, 2016
0fb174b
Merge tag 'v2.43.0' into lua
pnorman Sep 6, 2016
cf690e5
Merge tag 'v2.44.0' into lua
pnorman Sep 26, 2016
9eb43a5
Merge tag 'v2.44.1' into lua
pnorman Oct 12, 2016
8435825
Use correct location for Lua script
pnorman Nov 14, 2016
aea093e
Use correct location for Lua script
pnorman Nov 14, 2016
9e6e0d7
Fix a missed population conversion in the last merges
pnorman Nov 14, 2016
2282dc6
Add missing project.mml
pnorman Nov 14, 2016
afcafb2
Remove area column, because it's not used at all
pnorman Nov 14, 2016
2d424b4
Don't add columns for transportation-type access tags on nodes
pnorman Nov 14, 2016
60544b9
Don't add bridge/tunnel columns to points
pnorman Nov 14, 2016
1b6c1f0
Merge pull request #2438 from pnorman/lua_location
matthijsmelissen Nov 14, 2016
f56dc94
Only have a surface col for ways
pnorman Nov 15, 2016
6397f86
Remove osmcarto_z_order
pnorman Nov 15, 2016
db2d105
Only have route col for ways
pnorman Nov 15, 2016
4c437f1
Only add service column to ways
pnorman Nov 15, 2016
bcdf12f
Remove remaining highway type tags from points
pnorman Nov 15, 2016
2aec867
Remove capital column
pnorman Nov 15, 2016
ac5976a
Merge remote-tracking branch 'pnorman/lua_cols' into lua
matthijsmelissen Nov 15, 2016
f6ba2a7
Treat leisure=slipway, natural=ridge,arete as linestring by default
matthijsmelissen Nov 21, 2016
c55384e
Merge pull request #2455 from math1985/linestring-tags
pnorman Nov 21, 2016
fea4ff2
fix svg regressions (fixes #2479, #2481)
nebulon42 Dec 1, 2016
0ae8b27
Preparing Changelog for release v2.45.1
kocio-pl Dec 2, 2016
42cf572
Merge tag 'v2.45.0' into lua
pnorman Dec 4, 2016
d7a4d4f
Merge tag 'v2.45.1' into lua
pnorman Dec 4, 2016
2502625
Merge master Mapnik 3.0 changes
pnorman Dec 4, 2016
1c7a001
Add documentation about needing hstore
pnorman Dec 4, 2016
4986fbf
Only add low-zoom rails to roads table
pnorman Dec 4, 2016
d8f8223
Exclude SSY rail
pnorman Dec 4, 2016
de4c547
Merge pull request #2486 from pnorman/lua_loading_docs
pnorman Dec 5, 2016
ab03d93
Merge pull request #2487 from pnorman/lua_rail_roads
pnorman Dec 5, 2016
a7e7be8
Consider building:part a polygon tag
pnorman Dec 7, 2016
214a673
Merge pull request #2499 from pnorman/lua/building_part
pnorman Dec 9, 2016
2714ced
Merge branch 'lua_location' into lua/master
pnorman Dec 20, 2016
5161010
Test lua isarea()
pnorman Dec 20, 2016
3f24b7d
Merge tag 'v3.0.0' into lua/master
pnorman Dec 22, 2016
6e6b6f8
Rewrite relation handling code
pnorman Dec 24, 2016
a1fda3d
Merge pull request #2527 from pnorman/lua/multipolygons
pnorman Dec 27, 2016
e29b281
Merge tag 'v3.0.1' into lua
pnorman Jan 2, 2017
7c0bd30
Run transform tests in Travis
pnorman Jan 19, 2017
0f4d11f
Add usage notes to openstreetmap-carto.style
pnorman Jan 19, 2017
8c524ce
Add SQL style notes on hstore
pnorman Jan 19, 2017
3c8fc0f
Luadoc fixes
pnorman Jan 19, 2017
8aee71b
Remove unused filter_tags_generic parameter
pnorman Jan 19, 2017
e4a4645
Luadoc for filter_tags_generic
pnorman Jan 19, 2017
cf7e614
Remove old parameter for filter_tags_generic calls
pnorman Jan 19, 2017
884134d
Add first tests for filter_tags_generic
pnorman Jan 19, 2017
be75078
Finish off tests of existing filter_tags_generic
pnorman Jan 19, 2017
a9170aa
Simplify deleting tags
pnorman Jan 19, 2017
19a1894
Remove wildcard from non-wildcard delete tag list
pnorman Jan 19, 2017
55bc1cc
Test non-ssy rail service for roads
pnorman Jan 19, 2017
75cf488
Fix spelling of superseeded
pnorman Jan 19, 2017
31ef4fe
Merge pull request #2552 from pnorman/lua/hstore_style
nebulon42 Jan 19, 2017
03f3ad9
Fix equaltables doc
pnorman Jan 24, 2017
96f9a3f
Use consistent syntax for z_order column
pnorman Jan 24, 2017
1fa3b0e
Remove unused variable
pnorman Jan 24, 2017
76d239b
Match only prefexes for delete tags
pnorman Jan 24, 2017
1f8413d
Comment formatting
pnorman Jan 24, 2017
d274b62
Merge tag 'v3.1.0' into lua/master
pnorman Jan 29, 2017
1b87f4a
Fix new use of layer from merge
pnorman Jan 29, 2017
10e1cd1
Restore wilderness_hut that got removed with 3.0.0 merges
pnorman Jan 29, 2017
cb23299
Remove support for old-style multipolygons
pnorman Apr 16, 2017
799aebf
Merge pull request #2610 from pnorman/lua/no_old_style_mps
pnorman Apr 17, 2017
77cc9c4
Document length of committment for 3.x and 4.x compatibility
pnorman Apr 17, 2017
b6b155b
Document what happens with PRs and 3.x
pnorman Apr 17, 2017
a002f47
Merge tag 'v3.2.0' into lua/master
pnorman Apr 18, 2017
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
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ language: node_js
sudo: false
node_js:
- "0.10"
addons:
apt:
packages:
- lua5.1
env:
- CARTO=0.16.0 MAPNIK='3.0.0 3.0.12'
- CARTO=0.16.3 MAPNIK='3.0.0 3.0.12'
Expand All @@ -16,3 +20,5 @@ script:
- for m in $MAPNIK; do ./node_modules/carto/bin/carto -a $m project.mml | xmllint - | wc -l; done
# Validate that the SVGs are valid XML
- find symbols/ -name '*.svg' | xargs xmllint --noout
# Check the Lua transforms
- lua scripts/lua/test.lua
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ contain a cropped screenshot of the problem, and a link to the area. Don't assum
that we will see exactly what you see. If a particular OSM object is an issue,
the issue should contain the tagging of the object.

## 3.x compatibility

OpenStreetMap Carto is currently maintaining compatibility in the output of 3.x
and 4.x to allow users to smoothly transition and reload their databases. Pull
requests which cannot be backported to 3.x are not being accepted at this time
and will be closed.

Whenever a pull request is merged into master, it also needs to be backported to
the 3.x branch at the same time by the person merging.

## Easy pickings

Some [easy issues](https://github.com/gravitystorm/openstreetmap-carto/issues?q=is%3Aopen+is%3Aissue+label%3Aeasy) have been selected
Expand Down Expand Up @@ -115,6 +125,8 @@ Because SQL within JSON or YAML will not generally be syntax highlighted, indent
* 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)
* When extracting tags from hstore, use `tags->'foo'`, not `tags -> 'foo'`, and only add parenthesis if needed for order of operations
* To check if a tag is in the tags hstore, use `tags @> 'foo=>bar'`, relying on automatic conversion from `text` to `hstore`.

## Map Icon Guidelines

Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## OpenStreetMap data
You need OpenStreetMap data loaded into a PostGIS database (see below for [dependencies](#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:
Start by setting up your database to have PostGIS and hstore with ``psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;'``, then grab some OSM data. 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 done that, import with osm2pgsql:

```
osm2pgsql -d gis ~/path/to/data.osm.pbf --style openstreetmap-carto.style
osm2pgsql -G --hstore --style openstreetmap-carto.style --tag-transform-script openstreetmap-carto.lua -d gis ~/path/to/data.osm.pbf
```

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/).
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ and issues have their own [tag](https://github.com/gravitystorm/openstreetmap-ca

Initial releases will not make use of the new features, maintaining compatibility
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 3.x compatibility will not be maintained.
rendered from either a new database or an old one. In order to allow time for users
to reload their databases, this will be maintained until at least two MINOR
releases have occurred. After that compatibility will not be maintained.

# Alternatives

Expand Down
Loading