Skip to content

Commit

Permalink
Remove some styling (about way_pixels) to get carto performance sen…
Browse files Browse the repository at this point in the history
…sible

Previously, this style had attempted to replicate the upstream osm-carto
exactly. This meant the using the `way_pixels` and zoom trick to get the
same results. But that results in a combinatorial explosion for
amenity-points, which means carto can go from 30 seconds to parse the
file, to 3½minutes. By removing this inner selectors, the carto
performance will be back to about 30 seconds.

This affects the start up time of tessera/tilelive.

cf.:

 * mapbox/carto#470
 * mapbox/carto#20
  • Loading branch information
Rory McCann committed Mar 27, 2017
1 parent 85217f5 commit 60a253c
Showing 1 changed file with 56 additions and 30 deletions.
86 changes: 56 additions & 30 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1204,8 +1204,10 @@
text-name: "[name]";
text-fill: #000;
text-size: @standard-text-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] { text-size: 12; }
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] { text-size: 15; }
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] { text-size: 12; }
[way_pixels > 12000] { text-size: 12; }
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] { text-size: 15; }
[way_pixels > 48000] { text-size: 15; }
text-face-name: @oblique-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
Expand Down Expand Up @@ -1289,7 +1291,8 @@
[feature = 'amenity_bicycle_parking'],
[feature = 'amenity_motorcycle_parking']
{
[zoom >= 10][way_pixels > 900], [zoom=14][way_pixels > 900], [zoom=15][way_pixels > 225], [zoom=16][way_pixels > 56], [zoom=17][way_pixels > 14], [zoom=18][way_pixels > 3], [zoom>=19] {
//[zoom >= 10][way_pixels > 900], [zoom=14][way_pixels > 900], [zoom=15][way_pixels > 225], [zoom=16][way_pixels > 56], [zoom=17][way_pixels > 14], [zoom=18][way_pixels > 3], [zoom>=19] {
[zoom >= 10][way_pixels > 900] {
text-name: "[name]";
text-size: @standard-text-size;
text-fill: @transportation-text;
Expand Down Expand Up @@ -1437,11 +1440,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand Down Expand Up @@ -1484,11 +1489,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand Down Expand Up @@ -1517,11 +1524,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand All @@ -1540,11 +1549,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand Down Expand Up @@ -1606,21 +1617,24 @@
[feature = 'leisure_stadium'],
[feature = 'leisure_track'],
[feature = 'leisure_pitch'] {
[zoom >= 10][way_pixels > 3000][is_building = 'no'], [is_building = 'no'][zoom=14][way_pixels > 3000], [is_building = 'no'][zoom=15][way_pixels > 750], [is_building = 'no'][zoom=16][way_pixels > 187],
// [zoom >= 10][way_pixels > 3000][is_building = 'no'], [is_building = 'no'][zoom=14][way_pixels > 3000], [is_building = 'no'][zoom=15][way_pixels > 750], [is_building = 'no'][zoom=16][way_pixels > 187],
[zoom >= 10][way_pixels > 3000][is_building = 'no'],
[zoom >= 17][is_building = 'no'],
[zoom >= 10][way_pixels > 3000][feature = 'shop_mall'], [feature = 'shop_mall'][zoom=14][way_pixels > 3000], [feature = 'shop_mall'][zoom=15][way_pixels > 750], [feature = 'shop_mall'][zoom=16][way_pixels > 187],
[zoom >= 10][way_pixels > 3000][feature = 'shop_mall'],
//[zoom >= 10][way_pixels > 3000][feature = 'shop_mall'], [feature = 'shop_mall'][zoom=14][way_pixels > 3000], [feature = 'shop_mall'][zoom=15][way_pixels > 750], [feature = 'shop_mall'][zoom=16][way_pixels > 187],
[zoom >= 17][feature = 'shop_mall'] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000],
[zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11]
//[zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11]
[way_pixels > 12000]
{
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000],
[zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46]
// This has been disabled for the same reason as above
//[zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46]
[way_pixels > 48000]
{
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
Expand Down Expand Up @@ -1843,16 +1857,18 @@

[feature = 'leisure_marina'][zoom >= 15] {
[zoom >= 10][way_pixels > 3000],
[zoom=14][way_pixels > 3000], [zoom=15][way_pixels > 750], [zoom=16][way_pixels > 187],
//[zoom=14][way_pixels > 3000], [zoom=15][way_pixels > 750], [zoom=16][way_pixels > 187],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand Down Expand Up @@ -2066,11 +2082,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand All @@ -2092,11 +2110,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand All @@ -2122,11 +2142,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand All @@ -2146,11 +2168,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand All @@ -2170,11 +2194,13 @@
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
//[way_pixels > 12000], [zoom=14][way_pixels > 12000], [zoom=15][way_pixels > 3000], [zoom=16][way_pixels > 750], [zoom=17][way_pixels > 187], [zoom=18][way_pixels > 46], [zoom>=19][way_pixels > 11] {
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
//[way_pixels > 48000], [zoom=14][way_pixels > 48000], [zoom=15][way_pixels > 12000], [zoom=16][way_pixels > 3000], [zoom=17][way_pixels > 750], [zoom=18][way_pixels > 187], [zoom>=19][way_pixels > 46] {
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
Expand Down

0 comments on commit 60a253c

Please sign in to comment.