Skip to content

Commit

Permalink
Change from land polygons to ocean polygons (#3694)
Browse files Browse the repository at this point in the history
* Change from land polygons to ocean polygons

Remove outline from low-zoom coastlines

* Remove zoom level filter from ocean in shapefiles.mss
  • Loading branch information
jeisenbe authored and imagico committed Mar 25, 2019
1 parent cfe7cf4 commit b5938d6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ env:
- CARTO=0.18.0 MAPNIK='3.0.0 3.0.12'
install:
- npm install carto@$CARTO
- mkdir -p data/world_boundaries data/simplified-land-polygons-complete-3857 data/ne_110m_admin_0_boundary_lines_land data/land-polygons-split-3857
- touch 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/land-polygons-split-3857/land_polygons.shp
- mkdir -p data/world_boundaries data/simplified-water-polygons-complete-3857 data/ne_110m_admin_0_boundary_lines_land data/water-polygons-split-3857
- touch data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp data/water-polygons-split-3857/water_polygons.shp
- createdb -w -E utf8 -U postgres gis && psql -Xq -d gis -U postgres -w -c "CREATE EXTENSION postgis; CREATE EXTENSION hstore;"
script:
# We're using pipes in the checks, so fail if any part fails
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ This script downloads necessary files, generates and populates the *data* direct
You can also download them manually at the following paths:

* [`world_bnd_m.shp`, `places.shp`, `world_boundaries_m.shp`](https://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz)
* [`simplified_land_polygons.shp`](http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip) (updated daily)
* [`simplified_water_polygons.shp`](http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip) (updated daily)
* [`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)
* [`land_polygons.shp`](http://data.openstreetmapdata.com/land-polygons-split-3857.zip) (updated daily)
* [`water_polygons.shp`](http://data.openstreetmapdata.com/water-polygons-split-3857.zip) (updated daily)
* [`icesheet_polygons.shp`](http://data.openstreetmapdata.com/antarctica-icesheet-polygons-3857.zip)
* [`icesheet_outlines.shp`](http://data.openstreetmapdata.com/antarctica-icesheet-outlines-3857.zip)

Expand Down
10 changes: 6 additions & 4 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,21 @@ Stylesheet:
- admin.mss
- addressing.mss
Layer:
- id: world
- id: ocean-lz
geometry: polygon
class: ocean
<<: *extents
Datasource:
file: data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp
file: data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp
type: shape
properties:
maxzoom: 9
- id: coast-poly
- id: ocean
geometry: polygon
class: ocean
<<: *extents
Datasource:
file: data/land-polygons-split-3857/land_polygons.shp
file: data/water-polygons-split-3857/water_polygons.shp
type: shape
properties:
minzoom: 10
Expand Down
16 changes: 8 additions & 8 deletions scripts/get-shapefiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
},

2: {
'directory': 'simplified-land-polygons-complete-3857',
'url': 'http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip', # noqa
'directory': 'simplified-water-polygons-complete-3857',
'url': 'http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip', # noqa
'type': 'zip',
'shp_basename': ['simplified_land_polygons'],
'long_opt': '--simplified-land'
'shp_basename': ['simplified_water_polygons'],
'long_opt': '--simplified-water'
},

3: {
Expand All @@ -63,11 +63,11 @@
},

4: {
'directory': 'land-polygons-split-3857',
'url': 'http://data.openstreetmapdata.com/land-polygons-split-3857.zip', # noqa
'directory': 'water-polygons-split-3857',
'url': 'http://data.openstreetmapdata.com/water-polygons-split-3857.zip', # noqa
'type': 'zip',
'shp_basename': ['land_polygons'],
'long_opt': '--land-polygons'
'shp_basename': ['water_polygons'],
'long_opt': '--water-polygons'
},

5: {
Expand Down
19 changes: 2 additions & 17 deletions shapefiles.mss
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,8 @@
}
}

#world {
[zoom >= 0][zoom < 10] {
polygon-fill: @land-color;
polygon-simplify: 0.4;
[zoom < 8] {
line-color: darken(@water-color,20%);
line-simplify: 0.4;
line-width: 0.5;
line-offset: 0.5;
}
}
}

#coast-poly {
[zoom >= 10] {
polygon-fill: @land-color;
}
.ocean {
polygon-fill: @water-color;
}

#icesheet-poly {
Expand Down
2 changes: 1 addition & 1 deletion style.mss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Map {
background-color: @water-color;
background-color: @land-color;
}

@water-color: #aad3df;
Expand Down

2 comments on commit b5938d6

@dktue
Copy link

@dktue dktue commented on b5938d6 May 19, 2019

Choose a reason for hiding this comment

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

Out of curiosity: What's the advantage of rendering oceans insteand of landmass?

@matkoniecz
Copy link
Contributor

Choose a reason for hiding this comment

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

See #3694 (comment) for details (linked in Change from land polygons to ocean polygons (#3694) at top that describes this commit)

Please sign in to comment.