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 ocean polygons #2066

Merged
merged 5 commits into from
Mar 7, 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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ node_js:
- "0.10"
install:
- npm install [email protected]
- 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
- mkdir -p data/world_boundaries data/simplified-land-polygons-complete-3857 data/simplified-water-polygons-complete-3857 data/ne_110m_admin_0_boundary_lines_land data/ne_10m_populated_places data/water-polygons-split-3857
- touch data/world_boundaries/builtup_area.shp 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/ne_10m_populated_places/ne_10m_populated_places_fixed.shp data/water-polygons-split-3857/water_polygons.shp
script:
- jsonlint project.mml
- ./node_modules/carto/bin/carto project.mml | xmllint - | wc -l
Expand Down
2 changes: 2 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ To download the shapefiles you can run the following script from this directory.
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this line be removed?

* [`simplified-water-polygons.shp`](http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip) (updated daily)
* [`land-polygon.shp`](http://data.openstreetmapdata.com/land-polygons-split-3857.zip) (updated daily)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this line be removed?

* [`water-polygon.shp`](http://data.openstreetmapdata.com/water-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)

Expand Down
48 changes: 24 additions & 24 deletions get-shapefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ UNZIP_OPTS=-qqun
# create and populate data dir
mkdir -p data/
mkdir -p data/world_boundaries
mkdir -p data/simplified-land-polygons-complete-3857
mkdir -p data/simplified-water-polygons-complete-3857
mkdir -p data/ne_110m_admin_0_boundary_lines_land
mkdir -p data/land-polygons-split-3857
mkdir -p data/water-polygons-split-3857

# world_boundaries
echo "downloading world_boundaries..."
curl -z "data/world_boundaries-spherical.tgz" -L -o "data/world_boundaries-spherical.tgz" "http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz"
echo "expanding world_boundaries..."
tar -xzf data/world_boundaries-spherical.tgz -C data/

# simplified-land-polygons-complete-3857
echo "downloading simplified-land-polygons-complete-3857..."
curl -z "data/simplified-land-polygons-complete-3857.zip" -L -o "data/simplified-land-polygons-complete-3857.zip" "http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip"
echo "simplified-land-polygons-complete-3857..."
unzip $UNZIP_OPTS data/simplified-land-polygons-complete-3857.zip \
simplified-land-polygons-complete-3857/simplified_land_polygons.shp \
simplified-land-polygons-complete-3857/simplified_land_polygons.shx \
simplified-land-polygons-complete-3857/simplified_land_polygons.prj \
simplified-land-polygons-complete-3857/simplified_land_polygons.dbf \
simplified-land-polygons-complete-3857/simplified_land_polygons.cpg \
# simplified-water-polygons-complete-3857
echo "downloading simplified-water-polygons-complete-3857..."
curl -z "data/simplified-water-polygons-complete-3857.zip" -L -o "data/simplified-water-polygons-complete-3857.zip" "http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip"
echo "simplified-water-polygons-complete-3857..."
unzip $UNZIP_OPTS data/simplified-water-polygons-complete-3857.zip \
simplified-water-polygons-complete-3857/simplified_water_polygons.shp \
simplified-water-polygons-complete-3857/simplified_water_polygons.shx \
simplified-water-polygons-complete-3857/simplified_water_polygons.prj \
simplified-water-polygons-complete-3857/simplified_water_polygons.dbf \
simplified-water-polygons-complete-3857/simplified_water_polygons.cpg \
-d data/

# ne_110m_admin_0_boundary_lines_land
Expand All @@ -39,16 +39,16 @@ unzip $UNZIP_OPTS data/ne_110m_admin_0_boundary_lines_land.zip \
ne_110m_admin_0_boundary_lines_land.dbf \
-d data/ne_110m_admin_0_boundary_lines_land/

# land-polygons-split-3857
echo "downloading land-polygons-split-3857..."
curl -z "data/land-polygons-split-3857.zip" -L -o "data/land-polygons-split-3857.zip" "http://data.openstreetmapdata.com/land-polygons-split-3857.zip"
echo "expanding land-polygons-split-3857..."
unzip $UNZIP_OPTS data/land-polygons-split-3857.zip \
land-polygons-split-3857/land_polygons.shp \
land-polygons-split-3857/land_polygons.shx \
land-polygons-split-3857/land_polygons.prj \
land-polygons-split-3857/land_polygons.dbf \
land-polygons-split-3857/land_polygons.cpg \
# water-polygons-split-3857
echo "downloading water-polygons-split-3857..."
curl -z "data/water-polygons-split-3857.zip" -L -o "data/water-polygons-split-3857.zip" "http://data.openstreetmapdata.com/water-polygons-split-3857.zip"
echo "expanding water-polygons-split-3857..."
unzip $UNZIP_OPTS data/water-polygons-split-3857.zip \
water-polygons-split-3857/water_polygons.shp \
water-polygons-split-3857/water_polygons.shx \
water-polygons-split-3857/water_polygons.prj \
water-polygons-split-3857/water_polygons.dbf \
water-polygons-split-3857/water_polygons.cpg \
-d data/

# antarctica-icesheet-polygons-3857
Expand Down Expand Up @@ -76,8 +76,8 @@ unzip $UNZIP_OPTS data/antarctica-icesheet-outlines-3857.zip \
#index
echo "indexing shapefiles"
shapeindex --shape_files \
data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp \
data/land-polygons-split-3857/land_polygons.shp \
data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp \
data/water-polygons-split-3857/water_polygons.shp \
data/antarctica-icesheet-polygons-3857/icesheet_polygons.shp \
data/antarctica-icesheet-outlines-3857/icesheet_outlines.shp \
data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp
Expand Down
16 changes: 8 additions & 8 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"interactivity": false,
"Layer": [
{
"name": "world",
"name": "ocean-lz",
"srs-name": "900913",
"geometry": "polygon",
"class": "",
"id": "world",
"class": "ocean",
"id": "ocean-lz",
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"type": "shape",
"file": "data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp"
"file": "data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp"
},
"extent": [
-180,
Expand All @@ -24,15 +24,15 @@
"advanced": {}
},
{
"name": "coast-poly",
"name": "ocean",
"srs-name": "900913",
"geometry": "polygon",
"class": "",
"id": "coast-poly",
"class": "ocean",
"id": "ocean",
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"type": "shape",
"file": "data/land-polygons-split-3857/land_polygons.shp"
"file": "data/water-polygons-split-3857/water_polygons.shp"
},
"extent": [
-180,
Expand Down
16 changes: 8 additions & 8 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ Stylesheet:
- "admin.mss"
- "addressing.mss"
Layer:
- id: "world"
name: "world"
class: ""
- id: "ocean-lz"
name: "ocean-lz"
class: "ocean"
geometry: "polygon"
<<: *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"
advanced: {}
properties:
maxzoom: 9
- id: "coast-poly"
name: "coast-poly"
class: ""
- id: "ocean"
name: "ocean"
class: "ocean"
geometry: "polygon"
<<: *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
12 changes: 0 additions & 12 deletions shapefiles.mss
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@
}
}

#world {
[zoom >= 0][zoom < 10] {
polygon-fill: @land-color;
}
}

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

#icesheet-poly {
[zoom >= 6] {
polygon-fill: @glacier;
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;
}

@book-fonts: "DejaVu Sans Book", "Arundina Sans Regular", "Padauk Regular", "Khmer OS Metal Chrieng Regular",
Expand Down
52 changes: 19 additions & 33 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,28 @@
}
}
}
}

[waterway = 'dock'],
[waterway = 'canal'] {
[zoom >= 9]::waterway {
polygon-fill: @water-color;
[way_pixels >= 4] {
polygon-gamma: 0.75;
}
[way_pixels >= 64] {
polygon-gamma: 0.6;
}
}
}
/*
* Water areas, of all types. Because they are rendered all the same,
* attachments can be used to reduce combinational rules
*/

[landuse = 'basin'][zoom >= 7]::landuse {
polygon-fill: @water-color;
[way_pixels >= 4] {
polygon-gamma: 0.75;
}
[way_pixels >= 64] {
polygon-gamma: 0.6;
}
}
#water-areas[waterway = 'dock'][zoom >= 9]::waterway,
#water-areas[waterway = 'canal'][zoom >= 9]::waterway,
#water-areas[landuse = 'basin'][zoom >= 7]::landuse,
#water-areas[natural = 'water'][zoom >= 6]::natural,
#water-areas[landuse = 'reservoir'][zoom >= 6]::landuse,
#water-areas[waterway = 'riverbank'][zoom >= 6]::waterway,
.ocean {
polygon-fill: @water-color;

[natural = 'water']::natural,
[landuse = 'reservoir']::landuse,
[waterway = 'riverbank']::waterway {
[zoom >= 6] {
polygon-fill: @water-color;
[way_pixels >= 4] {
polygon-gamma: 0.75;
}
[way_pixels >= 64] {
polygon-gamma: 0.6;
}
}
// Only the SQL layers have way_pixels
#water-areas[way_pixels >= 4] {
polygon-gamma: 0.75;
}
#water-areas[way_pixels >= 64] {
polygon-gamma: 0.6;
}
}

Expand Down