Skip to content

Commit

Permalink
Merge branch 'pnorman-multiline_split_refs'
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitystorm committed Sep 5, 2014
2 parents 738a46b + 9d59496 commit 1adb532
Show file tree
Hide file tree
Showing 168 changed files with 884 additions and 59 deletions.
4 changes: 2 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@
],
"Datasource": {
"type": "postgis",
"table": " (select way,highway,ref,char_length(ref) as length\n from planet_osm_roads\n where highway in ('motorway','trunk','primary','secondary')\n and ref is not null\n and char_length(ref) between 1 and 11\n ) as roads_text_ref_low_zoom",
"table": "(SELECT way, highway, height, width, refs FROM\n (SELECT \n way, highway, \n array_length(refs,1) AS height, \n (SELECT MAX(char_length(ref)) FROM unnest(refs) AS u(ref)) AS width, \n array_to_string(refs,E'\\n') AS refs\n FROM (\n SELECT \n way, \n highway, \n string_to_array(ref,';') AS refs\n FROM planet_osm_roads\n WHERE highway IN ('motorway','trunk','primary','secondary')\n AND ref IS NOT NULL\n ) AS p) AS q\n WHERE height <= 4 AND width <= 11) AS roads_text_ref_low_zoom",
"extent": "-20037508,-20037508,20037508,20037508",
"key_field": "",
"geometry_field": "way",
Expand Down Expand Up @@ -1413,7 +1413,7 @@
],
"Datasource": {
"type": "postgis",
"table": " (select way,coalesce(highway,aeroway) as highway,ref,char_length(ref) as length,\n case when bridge in ('yes','aqueduct') then 'yes'::text else 'no'::text end as bridge\n from planet_osm_line\n where (highway is not null or aeroway is not null)\n and ref is not null\n and char_length(ref) between 1 and 11\n ) as roads_text_ref",
"table": "(SELECT way, highway, height, width, refs FROM\n (SELECT \n way, highway, \n array_length(refs,1) AS height, \n (SELECT MAX(char_length(ref)) FROM unnest(refs) AS u(ref)) AS width, \n array_to_string(refs,E'\\n') AS refs\n FROM (\n SELECT \n way, \n COALESCE(highway, aeroway) AS highway, \n string_to_array(ref,';') AS refs\n FROM planet_osm_line\n WHERE (highway IN ('motorway','trunk','primary','secondary','tertiary','unclassified','residential') OR aeroway IN ('runway','taxiway'))\n AND ref IS NOT NULL\n ) AS p) AS q\n WHERE height <= 4 AND width <= 11) AS roads_text_ref",
"extent": "-20037508,-20037508,20037508,20037508",
"key_field": "",
"geometry_field": "way",
Expand Down
84 changes: 40 additions & 44 deletions roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1947,50 +1947,48 @@
}

#roads-text-ref-low-zoom {
[highway = 'motorway'][length < 12] {
[zoom >= 10][zoom < 13] {
shield-name: "[ref]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/motorway_[length]x1.svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}
[highway = 'motorway'][zoom >= 10][zoom < 13] {
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/motorway_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'trunk'][zoom >= 11][zoom < 13] {
shield-name: "[ref]";
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/trunk_[length]x1.svg");
shield-file: url("symbols/shields/trunk_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'primary'][zoom >= 11][zoom < 13] {
shield-name: "[ref]";
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/primary_[length]x1.svg");
shield-file: url("symbols/shields/primary_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'secondary'][zoom >= 12][zoom < 13] {
shield-name: "[ref]";
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/secondary_[length]x1.svg");
shield-file: url("symbols/shields/secondary_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
Expand All @@ -1999,62 +1997,60 @@
}

#roads-text-ref {
[highway = 'motorway'][length < 12] {
[zoom >= 13] {
shield-name: "[ref]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/motorway_[length]x1.svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}
[highway = 'motorway'][zoom >= 13] {
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/motorway_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'trunk'][zoom >= 13] {
shield-name: "[ref]";
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/trunk_[length]x1.svg");
shield-file: url("symbols/shields/trunk_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'primary'][zoom >= 13] {
shield-name: "[ref]";
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/primary_[length]x1.svg");
shield-file: url("symbols/shields/primary_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'secondary'][bridge = 'no'][zoom >= 13] {
shield-name: "[ref]";
[highway = 'secondary'][zoom >= 13] {
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/secondary_[length]x1.svg");
shield-file: url("symbols/shields/secondary_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
shield-clip: false;
}

[highway = 'tertiary'][bridge = 'no'][zoom >= 13] {
shield-name: "[ref]";
[highway = 'tertiary'][zoom >= 13] {
shield-name: "[refs]";
shield-size: 10;
shield-fill: #fff;
shield-placement: line;
shield-file: url("symbols/shields/tertiary_[length]x1.svg");
shield-file: url("symbols/shields/tertiary_[width]x[height].svg");
shield-spacing: 750;
shield-min-distance: 30;
shield-face-name: @bold-fonts;
Expand All @@ -2063,8 +2059,8 @@

[highway = 'unclassified'],
[highway = 'residential'] {
[zoom >= 15][bridge = 'no'] {
text-name: "[ref]";
[zoom >= 15] {
text-name: "[refs]";
text-size: 10;
text-fill: #000;
text-face-name: @bold-fonts;
Expand All @@ -2077,8 +2073,8 @@

[highway = 'runway'],
[highway = 'taxiway'] {
[zoom >= 15][bridge = 'no'] {
text-name: "[ref]";
[zoom >= 15] {
text-name: "[refs]";
text-size: 10;
text-fill: #333;
text-spacing: 750;
Expand Down
30 changes: 17 additions & 13 deletions scripts/create_standard_shields
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,22 @@ tertiary:#c4c68f'
xoffset=1.25
yoffset=1.75

h='1:18'

for w in $widths; do
xchars=$(echo $w | awk -F ":" '{print $1}')
xpixels=$(echo $w | awk -F ":" '{print $2}')
ychars=$(echo $h | awk -F ":" '{print $1}')
ypixels=$(echo $h | awk -F ":" '{print $2}')

for shield in $colours; do
class=$(echo $shield | awk -F ":" '{print $1}')
colour=$(echo $shield | awk -F ":" '{print $2}')

./create_shield $colour $xpixels $ypixels $xoffset $yoffset > "${class}_${xchars}x${ychars}.svg"
heights='
1:18
2:30
3:44
4:54'

for h in $heights; do
for w in $widths; do
xchars=$(echo $w | awk -F ":" '{print $1}')
xpixels=$(echo $w | awk -F ":" '{print $2}')
ychars=$(echo $h | awk -F ":" '{print $1}')
ypixels=$(echo $h | awk -F ":" '{print $2}')
for shield in $colours; do
class=$(echo $shield | awk -F ":" '{print $1}')
colour=$(echo $shield | awk -F ":" '{print $2}')
./create_shield $colour $xpixels $ypixels $xoffset $yoffset > "${class}_${xchars}x${ychars}.svg"
done;
done;
done;
5 changes: 5 additions & 0 deletions symbols/shields/motorway_10x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_10x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_10x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_11x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_11x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_11x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_1x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_1x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_1x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_2x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_2x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_2x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_3x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_3x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_3x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_4x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_4x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_4x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_5x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_5x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_5x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_6x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_6x3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_6x4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_7x2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions symbols/shields/motorway_7x3.svg
5 changes: 5 additions & 0 deletions symbols/shields/motorway_7x4.svg
5 changes: 5 additions & 0 deletions symbols/shields/motorway_8x2.svg
5 changes: 5 additions & 0 deletions symbols/shields/motorway_8x3.svg
Loading

0 comments on commit 1adb532

Please sign in to comment.