diff --git a/imposm-mapping.py b/imposm-mapping.py index 4221093..0099f34 100644 --- a/imposm-mapping.py +++ b/imposm-mapping.py @@ -226,7 +226,7 @@ class Highway(LineStrings): 'barrier': ( 'ditch', ), - 'waterway': ( + 'waterway': ( 'stream', 'river', 'canal', @@ -269,7 +269,7 @@ class Highway(LineStrings): 'yes', 'wire_fence', 'toll_booth', - 'stile ', + 'stile', )} ) barrierways = LineStrings( @@ -277,7 +277,6 @@ class Highway(LineStrings): mapping = { 'barrier': ( 'city_wall', - 'ditch', 'fence', 'hedge', 'retaining_wall', diff --git a/osm-bright/base.mss b/osm-bright/base.mss index cbcf578..02b4fdd 100644 --- a/osm-bright/base.mss +++ b/osm-bright/base.mss @@ -67,11 +67,16 @@ } } /* At the highest zoom levels, render buildings in fancy pseudo-3D */ -#buildings[zoom>=17] { +#buildings[zoom>=17][type != 'hedge'] { building-fill:@building; building-height:1.25; } +#buildings[zoom>=17][type = 'hedge'] { + building-fill:@wooded; + building-height:1.25; +} + /* ================================================================== */ /* WATER AREAS /* ================================================================== */ @@ -139,7 +144,15 @@ Map { background-color: @water; } [zoom>17]{ line-width: 30; } } -/* == 7. ADMINISTRATIVE BOUNDARIES ================================== */ +#waterway[type='ditch'][zoom>=7] { + line-color: @water; + line-width: 32; +} + +/* ================================================================== */ +/* ADMINISTRATIVE BOUNDARIES +/* ================================================================== */ + #admin[admin_level=2][zoom>1] { line-color:@admin_2; @@ -149,4 +162,36 @@ Map { background-color: @water; } [zoom=4] { line-opacity: 0.4; } } -/* ****************************************************************** */ +/* ================================================================== */ +/* BARRIER POINTS +/* ================================================================== */ + + +#barrier_points[zoom>=17][stylegroup = 'divider'] { + marker-height: 2; + marker-fill: #c7c7c7; + marker-line-opacity:0; + marker-allow-overlap:true; +} + +/* ================================================================== */ +/* BARRIER LINES +/* ================================================================== */ + +#barrier_lines[zoom>=17][stylegroup = 'gate'] { + line-width:2.5; + line-color:#aab; + line-dasharray:3,2; +} + +#barrier_lines[zoom>=17][stylegroup = 'fence'] { + line-width:1.75; + line-color:#aab; + line-dasharray:1,1; +} + +#barrier_lines[zoom>=17][stylegroup = 'hedge'] { + line-width:3; + line-color:darken(@park,5); + +} \ No newline at end of file diff --git a/osm-bright/labels.mss b/osm-bright/labels.mss index b1a2265..902c2d9 100644 --- a/osm-bright/labels.mss +++ b/osm-bright/labels.mss @@ -552,7 +552,7 @@ text-name:"[name]"; text-face-name:@sans_bold; text-placement:line; - text-fill:#777; + text-fill:@road_text; text-halo-fill:@road_halo; text-halo-radius:1; text-min-distance:60; @@ -568,7 +568,7 @@ text-name:'[name]'; text-face-name:@sans; text-placement:line; - text-fill:#777; + text-fill:@road_text; text-halo-fill:@road_halo; text-halo-radius:1; text-min-distance:60; @@ -580,11 +580,34 @@ text-face-name:@sans; text-placement:line; text-size:9; - text-fill:#777; + text-fill:@road_text; text-halo-fill:@road_halo; text-halo-radius:1; text-min-distance:60; text-size:11; } +#motorway_label[oneway!=0][zoom>=16]{ + marker-placement:line; + marker-width:3; + marker-fill: #555; + marker-line-opacity:0; + marker-spacing: 250; +} + +#mainroad_label[oneway!=0][zoom>=16]{ + marker-placement:line; + marker-height:3; + marker-fill: #888; + marker-line-opacity:0; + marker-spacing: 250; +} + +#minorroad_label[oneway!=0][zoom>=16]{ + marker-placement:line; + marker-height:1; + marker-fill: #bbb; + marker-line-opacity:0; + marker-spacing: 250; +} /* ****************************************************************** */ diff --git a/osm-bright/osm-bright.imposm.mml b/osm-bright/osm-bright.imposm.mml index 76ebde7..f0b58b6 100644 --- a/osm-bright/osm-bright.imposm.mml +++ b/osm-bright/osm-bright.imposm.mml @@ -275,7 +275,10 @@ "dbname": "osm", "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34", "geometry_field": "", + "id": "roads_high", "key_field": "", + "project": "osm-bright", + "srs": null, "table": "( SELECT geometry, type, tunnel, bridge, access, 'fill' AS render,\n CASE\n WHEN type IN ('motorway', 'trunk') THEN 'motorway'\n WHEN type IN ('primary', 'secondary') THEN 'mainroad'\n WHEN type IN ('motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary', 'tertiary_link', 'residential', 'unclassified', 'road', 'living_street') THEN 'minorroad'\n WHEN type IN ('service', 'track') THEN 'service'\n WHEN type IN ('path', 'cycleway', 'footway', 'pedestrian', 'steps', 'bridleway') THEN 'noauto'\n WHEN type IN ('light_rail', 'subway', 'narrow_guage', 'rail', 'tram') THEN 'railway'\n ELSE 'other' END AS stylegroup\n FROM osm_roads\n WHERE bridge = 0\n AND tunnel = 0\n ORDER BY z_order\n) AS data", "type": "postgis" }, @@ -355,6 +358,41 @@ "srs-name": "900913", "status": "on" }, + { + "Datasource": { + "dbname": "osm", + "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34", + "geometry_field": "geometry", + "key_field": "", + "table": "(select geometry, type,\n\tCASE\n\t\tWHEN type IN ('toll_booth', 'stile', 'gate', 'horse_stile','lift_gate', 'kissing_gate','cattle_grid','entrance') THEN 'gate'\n\t\tWHEN type IN ('block', 'bollard', 'chain', 'cycle_barrier', 'spikes', 'fence', 'wire_fence','yes') THEN 'divider'\n\tEND AS stylegroup\nFROM osm_barrierpoints\n) AS data", + "type": "postgis" + }, + "class": "", + "geometry": "point", + "id": "barrier_points", + "name": "barrier_points", + "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", + "srs-name": "900913" + }, + { + "Datasource": { + "dbname": "osm", + "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34", + "geometry_field": "geometry", + "id": "barrier_lines", + "key_field": "", + "project": "osm-bright", + "srs": null, + "table": "(SELECT geometry, type,\n\tCASE \n\t\tWHEN type IN ('city_wall', 'fence', 'retaining_wall', 'wall', 'wire_fence', 'yes') THEN 'fence'\n\t\tWHEN type IN ('gate', 'spikes', 'bollard', 'lift_gate', 'kissing_gate') THEN 'gate'\n\t\tWHEN type IN ('hedge') THEN 'hedge'\n\tEND AS stylegroup\nFROM osm_barrierways\n) AS data", + "type": "postgis" + }, + "class": "", + "geometry": "linestring", + "id": "barrier_lines", + "name": "barrier_lines", + "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", + "srs-name": "900913" + }, { "Datasource": { "dbname": "osm", @@ -402,9 +440,9 @@ "geometry_field": "geometry", "id": "motorway_label", "key_field": "", - "project": "foss4g-2011", - "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", - "table": "( SELECT geometry, type, name, ref, CHAR_LENGTH(ref) AS reflen\n FROM osm_motorways\n WHERE type IN ('motorway', 'trunk')\n AND (name <> '' OR ref <> '')\n) AS data", + "project": "osm-bright", + "srs": null, + "table": "( SELECT geometry, type, name, ref, oneway, CHAR_LENGTH(ref) AS reflen\n FROM osm_motorways\n WHERE type IN ('motorway', 'trunk')\n AND (name <> '' OR ref <> '')\n) AS data", "type": "postgis" }, "class": "", @@ -422,9 +460,9 @@ "geometry_field": "geometry", "id": "mainroad_label", "key_field": "", - "project": "foss4g-2011", - "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", - "table": "(select geometry, type, name, oneway\nfrom osm_mainroads\nwhere name is not null or oneway = 1\n) as label", + "project": "osm-bright", + "srs": null, + "table": "(select geometry, type, name, oneway\nfrom osm_mainroads\nwhere name is not null or oneway <> 0\n) as label", "type": "postgis" }, "class": "", @@ -432,6 +470,7 @@ "id": "mainroad_label", "name": "mainroad_label", "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", + "srs-name": "900913", "status": "on" }, { @@ -443,7 +482,7 @@ "key_field": "", "project": "foss4g-2011", "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", - "table": "(select geometry, type, name, oneway\nfrom osm_minorroads\nwhere name is not null or oneway = 1\n) as label", + "table": "(select geometry, type, name, oneway\nfrom osm_minorroads\nwhere name is not null or oneway <> 0\n) as label", "type": "postgis" }, "class": "", @@ -451,6 +490,7 @@ "id": "minorroad_label", "name": "minorroad_label", "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", + "srs-name": "900913", "status": "on" }, { diff --git a/osm-bright/palette.mss b/osm-bright/palette.mss index c93d8f2..982e11c 100644 --- a/osm-bright/palette.mss +++ b/osm-bright/palette.mss @@ -130,6 +130,7 @@ Map { font-directory: url(./fonts); } @poi_text: @poi_text; +@road_text: #777; @road_halo: #fff; @other_text: #888; @@ -143,3 +144,6 @@ Map { font-directory: url(./fonts); } @village_halo: @place_halo; /* ****************************************************************** */ + + + diff --git a/osm-bright/roads.mss b/osm-bright/roads.mss index 3f6a96b..4152701 100644 --- a/osm-bright/roads.mss +++ b/osm-bright/roads.mss @@ -372,4 +372,4 @@ come in as well. } } -/* ****************************************************************** */ +/******************************************************************* */