├── .gitignore ├── fonts ├── OpenSans-Bold.ttf ├── OpenSans-Light.ttf ├── OpenSans-Italic.ttf ├── OpenSans-Regular.ttf ├── OpenSans-BoldItalic.ttf ├── OpenSans-ExtraBold.ttf ├── OpenSans-Semibold.ttf ├── OpenSans-LightItalic.ttf ├── OpenSans-ExtraBoldItalic.ttf ├── OpenSans-SemiboldItalic.ttf └── OpenSans-LICENSE.txt ├── carto ├── ferries.mss ├── labels_poi.mss ├── base.mss ├── boundaries.mss ├── markers.mss ├── railways.mss ├── buildings.mss ├── labels_waterways.mss ├── routes.mss ├── stations.mss ├── waterways.mss ├── labels_areas.mss ├── cobblestones.mss ├── settings.mss ├── areas.mss ├── labels_roads.mss ├── labels_places.mss └── roads.mss ├── LICENSE ├── markers ├── square.svg ├── cycle_barrier.svg ├── metro.svg ├── signal.svg ├── oneway_reverse.svg ├── oneway.svg ├── s-tog.svg └── metro_s-tog.svg ├── Makefile ├── tools ├── create_indexes.sql ├── osm2pgsql.style └── import.lua ├── README ├── background.xml ├── project.mml └── img └── shields.svg /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | imposm*.cache 3 | layers 4 | .thumb.png 5 | data -------------------------------------------------------------------------------- /fonts/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-Light.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-Italic.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-BoldItalic.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-ExtraBold.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-LightItalic.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /fonts/OpenSans-SemiboldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ubahnverleih/ibikecph-carto/master/fonts/OpenSans-SemiboldItalic.ttf -------------------------------------------------------------------------------- /carto/ferries.mss: -------------------------------------------------------------------------------- 1 | // ferries 2 | 3 | #ferries[zoom>=12] { 4 | line-width: 1; 5 | line-color: @cferry; 6 | line-dasharray: 10,5; 7 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | LICENSE 2 | This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -------------------------------------------------------------------------------- /carto/labels_poi.mss: -------------------------------------------------------------------------------- 1 | 2 | #poi[place='university'][zoom>=15], 3 | #poi[place='hospital'][zoom>=16], 4 | #poi[place='school'][zoom>=17], 5 | #poi[place='library'][zoom>=17] { 6 | text-name:"[name]"; 7 | text-face-name:@sans; 8 | text-size: @label_scale * 10; 9 | text-wrap-width: 30; 10 | text-fill: @label; 11 | } 12 | -------------------------------------------------------------------------------- /carto/base.mss: -------------------------------------------------------------------------------- 1 | //base 2 | 3 | //first draw water everywhere 4 | Map { 5 | background-color: @water; 6 | 7 | // increase to avoid anomalities at the edges 8 | buffer-size: 256; 9 | } 10 | 11 | //then draw land 12 | #land[zoom>=0][zoom<6], 13 | #shoreline[zoom>=6][zoom<10], 14 | #coastline[zoom>=10] { 15 | polygon-gamma: 0.75; 16 | polygon-fill: @land; 17 | } 18 | -------------------------------------------------------------------------------- /carto/boundaries.mss: -------------------------------------------------------------------------------- 1 | // boundaries 2 | /* 3 | #admin[admin_level=2][zoom>1] { 4 | line-color:@admin_2; 5 | line-width:0.5; 6 | [zoom=2] { line-opacity: 0.25; } 7 | [zoom=3] { line-opacity: 0.3; } 8 | [zoom=4] { line-opacity: 0.4; } 9 | } 10 | 11 | #barrier_points[zoom>=17][stylegroup = 'divider'] { 12 | marker-height: 2; 13 | marker-fill: #c7c7c7; 14 | marker-line-opacity:0; 15 | marker-allow-overlap:true; 16 | } 17 | */ -------------------------------------------------------------------------------- /carto/markers.mss: -------------------------------------------------------------------------------- 1 | // markers 2 | 3 | // barriers 4 | #poi[zoom>=16] 5 | { 6 | [barrier='cycle_barrier'], 7 | [barrier='kissing_gate'] 8 | { 9 | marker-file: url("markers/cycle_barrier.svg"); 10 | [zoom=16] { marker-height: 4; } 11 | [zoom>=17] { marker-height: 6; } 12 | } 13 | } 14 | 15 | 16 | // traffic signals 17 | #poi[highway='traffic_signals'][zoom>=17] 18 | { 19 | marker-file: url("markers/signal.svg"); 20 | [zoom=17] { marker-height: 14; } 21 | [zoom>=18] { marker-height: 16; } 22 | marker-opacity: 0.8; 23 | } 24 | -------------------------------------------------------------------------------- /carto/railways.mss: -------------------------------------------------------------------------------- 1 | // railways 2 | 3 | //HIGH ZOOM 4 | 5 | #railway_tunnel { 6 | ::line[zoom>=11] { 7 | line-width: 1; 8 | line-color: @crailway_tunnel; 9 | line-dasharray: 6,6; 10 | } 11 | } 12 | 13 | #railway_ground { 14 | ::line[zoom>=11] { 15 | line-width: 1; 16 | line-color: @crailway; 17 | } 18 | } 19 | 20 | #railway_ground { 21 | ::hatch[zoom>=11][zoom<=12] { 22 | line-width: 2; 23 | line-color: @crailway_hatch; 24 | line-dasharray: 1, 15; 25 | } 26 | ::hatch[zoom>=13] { 27 | line-width: 4; 28 | line-color: @crailway_hatch; 29 | line-dasharray: 1, 31; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /markers/square.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /carto/buildings.mss: -------------------------------------------------------------------------------- 1 | // buildings 2 | #buildings[zoom>=15] { 3 | line-width:0; 4 | 5 | //[zoom>=15] { polygon-fill: mix( @residential, @building, 40% ); } 6 | [zoom=16] { polygon-fill: mix( @land, @building,30% ); } 7 | [zoom>=17] { polygon-fill: @building; } 8 | 9 | [railway='station'], 10 | [aeroway='terminal'], 11 | [amenity='theatre'], 12 | [amenity='hospital'], 13 | [amenity='public_building'], 14 | [amenity='place_of_worship'], 15 | [amenity='church'], 16 | [amenity='townhall'], 17 | [amenity='library'], 18 | [amenity='mall'] { 19 | [zoom=15][way_area>=3200] { polygon-fill: @big_building; } 20 | [zoom=16][way_area>=800] { polygon-fill: @big_building; } 21 | [zoom=17][way_area>=200] { polygon-fill: @big_building; } 22 | [zoom>=18] { polygon-fill: @big_building; } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /markers/cycle_barrier.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # download and unzip data files 2 | fetch_data: data/10m-land.shp data/coastline-good.shp data/shoreline_300.shp 3 | 4 | 5 | # unzip 6 | data/10m-land.shp: data/10m-land.zip 7 | unzip -n data/10m-land.zip -d data 8 | touch data/10m-land.shp 9 | 10 | data/coastline-good.shp: data/coastline-good.zip 11 | unzip -n data/coastline-good.zip -d data 12 | touch data/coastline-good.shp 13 | 14 | data/shoreline_300.shp: data/shoreline_300.zip 15 | unzip -n data/shoreline_300.zip -d data 16 | touch data/shoreline_300.shp 17 | 18 | # download 19 | data/10m-land.zip: data 20 | curl http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/physical/10m-land.zip -o data/10m-land.zip 21 | touch data/10m-land.zip 22 | 23 | 24 | data/coastline-good.zip: data 25 | curl tilemill-data.s3.amazonaws.com/osm/coastline-good.zip -o data/coastline-good.zip 26 | touch data/10m-land.zip 27 | 28 | data/shoreline_300.zip: data 29 | curl http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip -o data/shoreline_300.zip 30 | touch data/10m-land.zip 31 | 32 | data: 33 | mkdir -p data -------------------------------------------------------------------------------- /markers/metro.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /carto/labels_waterways.mss: -------------------------------------------------------------------------------- 1 | //waterway labels 2 | 3 | #waterway_label[waterway='river'][zoom>=13], 4 | #waterway_label[waterway='canal'][zoom>=15], 5 | #waterway_label[waterway='stream'][zoom>=17] { 6 | text-name: "[name]"; 7 | text-face-name: @sans_italic; 8 | text-fill: @water * 0.75; 9 | text-halo-fill: @label_halo_place_fill; 10 | text-halo-radius: @label_halo_radius; 11 | text-placement: line; 12 | text-size: @ps0; 13 | text-dy: @ps0; 14 | //text-spacing: 400; 15 | //text-min-path-length: 200; 16 | //text-label-position-tolerance: 200; 17 | //text-min-distance: 400; 18 | 19 | text-max-char-angle-delta: 18; 20 | 21 | [waterway='river'][zoom=14], 22 | [waterway='canal'][zoom=16], 23 | [waterway='stream'][zoom>=18] { 24 | text-name: "[name].replace('([\S\ ])','$1 ')"; 25 | } 26 | [waterway='river'][zoom=15], 27 | [waterway='canal'][zoom=17] { 28 | text-size: @ps1; 29 | text-dy: @ps1; 30 | text-name: "[name].replace('([\S\ ])','$1 ')"; 31 | } 32 | [waterway='river'][zoom>=16], 33 | [waterway='canal'][zoom>=18] { 34 | text-size: @ps2; 35 | text-dy: @ps2; 36 | text-name: "[name].replace('([\S\ ])','$1 ')"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /carto/routes.mss: -------------------------------------------------------------------------------- 1 | // routes 2 | 3 | @route_width_2: 0.8; 4 | @route_width_1: 1.0; 5 | @route_width_0: 1.5; 6 | 7 | @route_casing_width: 1.2; 8 | 9 | #bike_routes { 10 | /* 11 | ::national[network='ncn'][zoom>=8] { 12 | line-color: hsl( 0, 100%, 85% ); 13 | line-width: 2; 14 | comp-op: multiply; 15 | } 16 | */ 17 | 18 | ::local_casing[network='lcn'][zoom>=12], 19 | ::regional_casing[network='rcn'][zoom>=10] 20 | { 21 | line-color: hsl(0,0%,60%); 22 | line-join: round; 23 | [zoom>=10][zoom<12] { line-width: @route_width_2 + 2*@route_casing_width; } 24 | [zoom>=12][zoom<14] { line-width: @route_width_1 + 2*@route_casing_width; } 25 | [zoom>=14] { line-width: @route_width_0 + 2*@route_casing_width; } 26 | comp-op: screen; 27 | } 28 | 29 | ::local[network='lcn'][zoom>=12] { 30 | line-color: hsl( 80, 100%, 45% ); 31 | } 32 | 33 | ::regional[network='rcn'][zoom>=10] { 34 | line-color: hsl( 40, 100%, 70% ); 35 | } 36 | 37 | ::local[network='lcn'][zoom>=12], 38 | ::regional[network='rcn'][zoom>=10] { 39 | [zoom>=10][zoom<12] { line-width: @route_width_2; } 40 | [zoom>=12][zoom<14] { line-width: @route_width_1; } 41 | [zoom>=14] { line-width: @route_width_0; } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /markers/signal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 9 | 11 | 13 | 15 | 16 | -------------------------------------------------------------------------------- /markers/oneway_reverse.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 12 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /markers/oneway.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tools/create_indexes.sql: -------------------------------------------------------------------------------- 1 | create index polygon_modegroup on planet_osm_polygon (highway); 2 | create index polygon_area on planet_osm_polygon (way_area); 3 | create index polygon_is_landuse on planet_osm_polygon (is_landuse); 4 | create index polygon_is_waterarea on planet_osm_polygon (is_waterarea); 5 | create index polygon_name on planet_osm_polygon (name); 6 | create index polygon_geometry on planet_osm_polygon USING GIST(way); 7 | 8 | create index line_modegroup on planet_osm_line (highway); 9 | create index line_modegroup on planet_osm_line (modegroup); 10 | create index line_building on planet_osm_line (building); 11 | create index line_tunnel on planet_osm_line (tunnel); 12 | create index line_bridge on planet_osm_line (bridge); 13 | create index line_route on planet_osm_line (route); 14 | create index line_ref on planet_osm_line (ref); 15 | create index line_length on planet_osm_line (ST_Length(way)); 16 | create index line_geometry on planet_osm_line USING GIST(way); 17 | 18 | create index road_modegroup on planet_osm_roads (highway); 19 | create index road_geometry on planet_osm_roads USING GIST(way); 20 | create index road_modegroup on planet_osm_roads (modegroup); 21 | create index road_sizegroup on planet_osm_roads (sizegroup); 22 | 23 | create index point_placegroup on planet_osm_point (placegroup); 24 | create index point_name on planet_osm_point (name); 25 | create index point_railway on planet_osm_point (railway); 26 | create index point_barrier on planet_osm_point (barrier); 27 | create index point_highway on planet_osm_point (LOWER(network)); 28 | -------------------------------------------------------------------------------- /markers/s-tog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /carto/stations.mss: -------------------------------------------------------------------------------- 1 | //stations 2 | 3 | #station_nodes, 4 | #station_polygons { 5 | ::icon_13[zoom=13] { 6 | marker-file: url("markers/square.svg"); 7 | marker-height: 3; 8 | marker-placement: interior; 9 | } 10 | 11 | ::icon_14[zoom=14] { 12 | marker-file: url("markers/square.svg"); 13 | marker-height: 4; 14 | marker-placement: interior; 15 | } 16 | 17 | ::icon_15[zoom>=15] 18 | { 19 | [metro=true][stog=true] { marker-file: url("markers/metro_s-tog.svg"); } 20 | [metro=true][stog=false] { marker-file: url("markers/metro.svg"); } 21 | [metro=false][stog=true] { marker-file: url("markers/s-tog.svg"); } 22 | [metro=false][stog=false] { marker-file: url("markers/square.svg"); } 23 | 24 | [stog=true], 25 | [metro=true] { 26 | [zoom=15] { marker-height: 14; } 27 | [zoom=16], 28 | [zoom=17] { marker-height: 18; } 29 | [zoom>=18] { marker-height: 24; } 30 | } 31 | 32 | [metro=false][stog=false] { 33 | [zoom=15] { marker-height: 6; } 34 | [zoom>=16] { marker-height: 7; } 35 | } 36 | 37 | marker-placement: interior; 38 | } 39 | 40 | ::label[zoom>=14] 41 | { 42 | text-placement: interior; 43 | //text-min-distance: 5; 44 | text-line-spacing: 0; 45 | text-wrap-width: @wrap_width; 46 | text-name: [name]; 47 | text-face-name: @sans_lt; 48 | text-fill: @label; 49 | text-halo-fill: @label_halo_place_fill; 50 | text-halo-radius: @label_halo_radius; 51 | text-character-spacing: @char_spacing; 52 | 53 | text-placement-type: simple; 54 | text-placements: "E,W,S,N,SE,NE,SW,NW"; 55 | [zoom=14] { text-dx: 6; text-dy: 6; text-size: 10; } 56 | [zoom=15] { text-dx: 14; text-dy: 12; text-size: 11; } 57 | [zoom=16], 58 | [zoom=17] { text-dx: 18; text-dy: 16; text-size: 12; } 59 | [zoom>=18] { text-dx: 24; text-dy: 22; text-size: 14; } 60 | } 61 | } -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | I Bike CPH map design 2 | 3 | 4 | ABOUT 5 | This the CartoCSS map style used to render the bicycle map on http://www.ibikecph.dk website and associated apps. The design was originally comissioned by the City of Copenhagen from Stamen Design, SF, and has since evolved. 6 | 7 | The map is designed specifically for bicycles. Ways are rendered in three distinct layers: Where you can ride, where you can push a bike, and where you cannot bring a bike. Bikeable ways are shown on top, to make the bicycle network clear. Motorways and other ways where you cannot bring a bike is shown below other ways. 8 | 9 | The map also shows: 10 | - Bicycle barriers - where a cargobike typically cannot pass 11 | - Cobblestones 12 | - Bicycle routes 13 | - Oneway directions as they apply to cyclists 14 | - Danish Metro and S-train stations. 15 | 16 | Big public buildings like hospitals, stations, libraries, churches, etc are highlighted, as a green areas like parks, gardens etc. 17 | 18 | The map is designed for use in Denmark, but probably work elsewhere too. 19 | 20 | 21 | SETUP 22 | Run 'make' in the root folder to download and unpack coastline and land polygon files. 23 | 24 | Import OSM data to PostGIS with oms2pgsql, using import.lua and osm2pgsql.style for preprocessing and filtering tags: 25 | osm2pgsql -d osm -S tool/osm2pgsql.style --tag-transform-script tools/import.lua /path/to/map.osm.pbf 26 | 27 | The PostGIS database is expected to be named 'osm', and login will be done with the user 'osm'. 28 | 29 | 30 | RENDERING 31 | The map is intended for rendering with Mapnik. The map uses only SVG for markers etc, so it can be rendering in different resolution just be changing the Mapnik scale factor. 32 | 33 | The file compiled.xml is the compiled version of the normal map. 34 | The file background.xml shows only sea and land, and can be used to render areas with no data. 35 | 36 | 37 | CONTACT 38 | Emil Tin 39 | City of Copenhagen 40 | emil.tin@tmf.kk.dk 41 | -------------------------------------------------------------------------------- /carto/waterways.mss: -------------------------------------------------------------------------------- 1 | // waterways 2 | 3 | @waterway_width: 1; 4 | 5 | #waterway::low[zoom>=8][zoom<=12] { 6 | [waterway='river'], 7 | [waterway='canal'] { 8 | line-color: @water; 9 | [zoom=8] { line-width: 0.1 * @waterway_width; } 10 | [zoom=9] { line-width: 0.2 * @waterway_width; } 11 | [zoom=10]{ line-width: 0.4 * @waterway_width; } 12 | [zoom=11]{ line-width: 0.6 * @waterway_width; } 13 | [zoom=12]{ line-width: 0.8 * @waterway_width; } 14 | } 15 | } 16 | 17 | #waterway::med[zoom>=13][zoom<=14] { 18 | [waterway='river'], 19 | [waterway='canal'] { 20 | line-color: @water; 21 | line-cap: round; 22 | line-join: round; 23 | [zoom=13]{ line-width: 1.0 * @waterway_width; } 24 | [zoom=14]{ line-width: 1.5 * @waterway_width; } 25 | } 26 | [waterway='stream'] { 27 | line-color: @water; 28 | [zoom=13]{ line-width: 0.3 * @waterway_width; } 29 | [zoom=14]{ line-width: 0.5 * @waterway_width; } 30 | } 31 | } 32 | 33 | #waterway::high[zoom>=15] { 34 | line-color: @water; 35 | [waterway='river'], 36 | [waterway='canal'] { 37 | line-cap: round; 38 | line-join: round; 39 | [zoom=15]{ line-width: 2.0 * @waterway_width; } 40 | [zoom=16]{ line-width: 3.0 * @waterway_width; } 41 | [zoom=17]{ line-width: 4.0 * @waterway_width; } 42 | [zoom=18]{ line-width: 5.0 * @waterway_width; } 43 | [zoom=19]{ line-width: 6.0 * @waterway_width; } 44 | [zoom>19]{ line-width: 7.0 * @waterway_width; } 45 | } 46 | [waterway='stream'] { 47 | [zoom=15]{ line-width: 0.6 * @waterway_width; } 48 | [zoom=16]{ line-width: 0.8 * @waterway_width; } 49 | [zoom=17]{ line-width: 1.0 * @waterway_width; } 50 | [zoom=18]{ line-width: 1.5 * @waterway_width; } 51 | [zoom>18]{ line-width: 2.0 * @waterway_width; } 52 | } 53 | [waterway='ditch'], 54 | [waterway='drain'] { 55 | [zoom=15]{ line-width: 0.2 * @waterway_width; } 56 | [zoom=16]{ line-width: 0.3 * @waterway_width; } 57 | [zoom=17]{ line-width: 0.5 * @waterway_width; } 58 | [zoom=18]{ line-width: 0.7 * @waterway_width; } 59 | [zoom=19]{ line-width: 1.0 * @waterway_width; } 60 | [zoom>19]{ line-width: 1.5 * @waterway_width; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /markers/metro_s-tog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 16 | 19 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /carto/labels_areas.mss: -------------------------------------------------------------------------------- 1 | //area labels 2 | 3 | #area_label { 4 | ::label_a_10[zoom=10][way_area>=204800000][way_area<409600000], 5 | ::label_a_11[zoom=11][way_area>=102400000][way_area<204800000], 6 | ::label_a_12[zoom=12][way_area>=51200000][way_area<102400000], 7 | ::label_a_13[zoom=13][way_area>=1280000][way_area<51200000], 8 | ::label_a_14[zoom=14][way_area>=320000][way_area<1280000], 9 | ::label_a_15[zoom=15][way_area>=80000][way_area<320000], 10 | ::label_a_16[zoom=16][way_area>=20000][way_area<80000], 11 | ::label_a_17[zoom=17][way_area>=5000][way_area<20000], 12 | ::label_a_18[zoom>=18][way_area>=0][way_area<5000] { 13 | text-name: "[name]"; 14 | text-halo-radius: @label_halo_radius; 15 | text-halo-fill: @label_halo_place_fill; 16 | text-face-name: @sans_lt_italic; 17 | text-size: @ps0; 18 | text-wrap-width: 50; 19 | text-fill: @label; 20 | text-placement: interior; 21 | text-min-distance: @text_distance; 22 | 23 | 24 | text-fill: @label; 25 | } 26 | 27 | ::label_b_11[zoom=11][way_area>=204800000][way_area<409600000], 28 | ::label_b_12[zoom=12][way_area>=102400000][way_area<204800000], 29 | ::label_b_13[zoom=13][way_area>=51200000][way_area<102400000], 30 | ::label_b_14[zoom=14][way_area>=1280000][way_area<51200000], 31 | ::label_b_15[zoom=15][way_area>=320000][way_area<1280000], 32 | ::label_b_16[zoom=16][way_area>=80000][way_area<320000], 33 | ::label_b_17[zoom=17][way_area>=20000][way_area<80000], 34 | ::label_b_18[zoom>=18][way_area>=5000][way_area<20000] { 35 | text-name: "[name]"; 36 | text-halo-radius: @label_halo_radius; 37 | text-halo-fill: @label_halo_place_fill; 38 | text-face-name: @sans_lt_italic; 39 | text-fill: @label; 40 | text-placement: interior; 41 | text-min-distance: @text_distance; 42 | text-size: @ps1; 43 | text-wrap-width: 60; 44 | } 45 | 46 | ::label_c_13[zoom=13][way_area>=102400000][way_area<409600000], 47 | ::label_c_14[zoom=14][way_area>=51200000][way_area<204800000], 48 | ::label_c_15[zoom=15][way_area>=1280000][way_area<102400000], 49 | ::label_c_16[zoom=16][way_area>=320000][way_area<51200000], 50 | ::label_c_17[zoom=17][way_area>=80000][way_area<1280000], 51 | ::label_c_18[zoom>=18][way_area>=20000][way_area<320000] { 52 | text-name: "[name]"; 53 | text-halo-radius: @label_halo_radius; 54 | text-halo-fill: @label_halo_place_fill; 55 | text-face-name: @sans_lt_italic; 56 | text-fill: @label; 57 | text-placement: interior; 58 | text-min-distance: @text_distance; 59 | text-size: @ps2; 60 | text-wrap-width: 70; 61 | } 62 | } -------------------------------------------------------------------------------- /background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -180,-85.0511,180,85.0511 7 | 12.5,55.67,13 8 | png 9 | 0 10 | 19 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 25 | land 26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 40 | coastline 41 | 42 | 43 | 44 | 45 | 46 | 47 | 54 | 56 | shoreline 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /carto/cobblestones.mss: -------------------------------------------------------------------------------- 1 | // cobblestones 2 | #cobblestones 3 | { 4 | ::left_16[zoom=16], 5 | ::left_17[zoom=17], 6 | ::left_18[zoom>=18], 7 | ::right_16[zoom=16], 8 | ::right_17[zoom=17], 9 | ::right_18[zoom>=18] 10 | { 11 | line-color: @cobblestone; 12 | line-width: 1.5*@cob_scale; 13 | comp-op: multiply; 14 | } 15 | 16 | ::left_16[zoom=16], 17 | ::left_17[zoom=17], 18 | ::left_18[zoom>=18] 19 | { 20 | line-dasharray: 1.5*@cob_scale, 4.7*@cob_scale, 1.5*@cob_scale, 2.6*@cob_scale, 1.5*@cob_scale, 5.1*@cob_scale; 21 | } 22 | ::right_16[zoom=16], 23 | ::right_17[zoom=17], 24 | ::right_18[zoom>=18] 25 | { 26 | line-dasharray: 1.5*@cob_scale, 3.1*@cob_scale, 1.5*@cob_scale, 5.3*@cob_scale, 1.5*@cob_scale, 4.2*@cob_scale; 27 | } 28 | 29 | ::left_16[zoom=16] { 30 | [sizegroup<=3] { line-offset: @w9 * @cob_placement; } 31 | [sizegroup=4] { line-offset: @w8 * @cob_placement; } 32 | [sizegroup=5] { line-offset: @w6 * @cob_placement; } 33 | [sizegroup>=6] { line-offset: @w5 * @cob_placement; } 34 | } 35 | ::left_17[zoom=17] { 36 | [sizegroup<=3] { line-offset: @w10 * @cob_placement; } 37 | [sizegroup=4] { line-offset: @w9 * @cob_placement; } 38 | [sizegroup=5] { line-offset: @w8 * @cob_placement; } 39 | [sizegroup>=6][sizegroup<=7] { line-offset: @w6 * @cob_placement; } 40 | [sizegroup>=8] { line-offset: @w5 * @cob_placement; } 41 | } 42 | ::left_18[zoom>=18] { 43 | [sizegroup<=3] { line-offset: @w10 * @cob_placement; } 44 | [sizegroup=4] { line-offset: @w9 * @cob_placement; } 45 | [sizegroup=5] { line-offset: @w8 * @cob_placement; } 46 | [sizegroup>=6][sizegroup<=7] { line-offset: @w7 * @cob_placement; } 47 | [sizegroup>=8] { line-offset: @w5 * @cob_placement; } 48 | } 49 | 50 | ::right_16[zoom=16] { 51 | [sizegroup<=3] { line-offset: @w9 * @cob_placement * -1; } 52 | [sizegroup=4] { line-offset: @w8 * @cob_placement * -1; } 53 | [sizegroup=5] { line-offset: @w6 * @cob_placement * -1; } 54 | [sizegroup>=6] { line-offset: @w5 * @cob_placement * -1; } 55 | } 56 | ::right_17[zoom=17] { 57 | [sizegroup<=3] { line-offset: @w10 * @cob_placement * -1; } 58 | [sizegroup=4] { line-offset: @w9 * @cob_placement * -1; } 59 | [sizegroup=5] { line-offset: @w8 * @cob_placement * -1; } 60 | [sizegroup>=6][sizegroup<=7] { line-offset: @w6 * @cob_placement * -1; } 61 | [sizegroup>=8] { line-offset: @w5 * @cob_placement * -1; } 62 | } 63 | ::right_18[zoom>=18] { 64 | [sizegroup<=3] { line-offset: @w10 * @cob_placement * -1; } 65 | [sizegroup=4] { line-offset: @w9 * @cob_placement * -1; } 66 | [sizegroup=5] { line-offset: @w8 * @cob_placement * -1; } 67 | [sizegroup>=6][sizegroup<=7] { line-offset: @w7 * @cob_placement * -1; } 68 | [sizegroup>=8] { line-offset: @w5 * @cob_placement * -1; } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /carto/settings.mss: -------------------------------------------------------------------------------- 1 | //label settings 2 | @label_scale: 1.0; 3 | @label_halo_radius: 1.0; 4 | @char_spacing: 0.3; 5 | @line_spacing: 0.5; 6 | @text_distance: 15; 7 | @place_scale: 1.2; 8 | @wrap_width: 50; 9 | @text_step: 1.2; 10 | 11 | @ps0: 8.0 * @place_scale; 12 | @ps1: @ps0 * @text_step; 13 | @ps2: @ps1 * @text_step; 14 | @ps3: @ps2 * @text_step; 15 | @ps4: @ps3 * @text_step; 16 | @ps5: @ps4 * @text_step; 17 | @ps6: @ps5 * @text_step; 18 | 19 | @ls_2a: @ps0; 20 | @ls_3a: @ps0; 21 | @ls_3a: @ps0; 22 | @ls_4a: @ps1; @ls_4b: @ps0; 23 | @ls_5a: @ps2; @ls_5b: @ps1; @ls_5c: @ps0; 24 | @ls_6a: @ps3; @ls_6b: @ps1; @ls_6c: @ps1; @ls_6d: @ps0; 25 | @ls_7a: @ps4; @ls_7b: @ps2; @ls_7c: @ps2; @ls_7d: @ps1; @ls_7e: @ps0; 26 | @ls_8a: @ps4; @ls_8b: @ps2; @ls_8c: @ps2; @ls_8d: @ps1; @ls_8e: @ps0; @ls_8f: @ps0; 27 | @ls_9a: @ps4; @ls_9b: @ps3; @ls_9c: @ps2; @ls_9d: @ps2; @ls_9e: @ps1; @ls_9f: @ps0; @ls_9g: @ps0; 28 | @ls_10a: @ps5; @ls_10b: @ps3; @ls_10c: @ps2; @ls_10d: @ps2; @ls_10e: @ps1; @ls_10f: @ps0; @ls_10g: @ps0; @ls_10h: @ps0; 29 | @ls_11a: @ps5; @ls_11b: @ps4; @ls_11c: @ps3; @ls_11d: @ps2; @ls_11e: @ps1; @ls_11f: @ps0; @ls_11g: @ps0; @ls_11h: @ps0; 30 | @ls_12a: @ps5; @ls_12b: @ps4; @ls_12c: @ps3; @ls_12d: @ps3; @ls_12e: @ps1; @ls_12f: @ps0; @ls_12g: @ps0; @ls_12h: @ps0; 31 | @ls_13a: @ps6; @ls_13b: @ps4; @ls_13c: @ps3; @ls_13d: @ps3; @ls_13e: @ps2; @ls_13f: @ps1; @ls_13g: @ps0; @ls_13h: @ps0; @ls_13i: @ps0; 32 | @ls_14a: @ps6; @ls_14b: @ps5; @ls_14c: @ps4; @ls_14d: @ps3; @ls_14e: @ps2; @ls_14f: @ps1; @ls_14g: @ps0; @ls_14h: @ps0; @ls_14i: @ps0; 33 | @ls_15a: @ps6; @ls_15b: @ps5; @ls_15c: @ps4; @ls_15d: @ps3; @ls_15e: @ps2; @ls_15f: @ps1; @ls_15g: @ps1; @ls_15h: @ps0; @ls_15i: @ps0; 34 | 35 | 36 | // fonts and colors 37 | Map { font-directory: url("fonts"); } 38 | 39 | @sans_lt: "Open Sans Regular"; 40 | @sans_lt_italic: "Open Sans Italic"; 41 | @sans: "Open Sans Semibold"; 42 | @sans_italic: "Open Sans Semibold Italic"; 43 | @sans_bold: "Open Sans Bold"; 44 | @sans_bold_italic: "Open Sans Bold Italic"; 45 | 46 | 47 | 48 | // landuses 49 | @overlay_mix: 50%; 50 | 51 | @land: hsl(42.9, 33.3%, 91.8%); 52 | @water: hsl(197.9, 100%, 77.6%); 53 | @brown: hsl(35, 80%, 70% ); 54 | @green: hsl(69.8, 100%, 47.8%); 55 | @park: @green; 56 | @meadow: @green; 57 | @wood: darken(@green,1%); 58 | @grass: lighten(@green,1%); 59 | @orchard: @green; 60 | 61 | @agriculture: mix( @green, @land, 50% ); 62 | 63 | @beach: hsl( 50, 80%, 90% ); 64 | @sand: darken( @beach, 10% ); 65 | @cemetery: @park; 66 | 67 | @school: darken( @land, 3% ); 68 | @sports: @park; 69 | @playground: @land; //yellow; 70 | @zoo: @sand; 71 | @garden: @park; 72 | 73 | @residential: darken( @land, 1.5% ); 74 | @commercial: @residential * 0.97; 75 | @industrial: @residential * 0.96; 76 | @parking: @residential * 0.95; 77 | @aeroway: hsl( 300, 15%, 90% ); 78 | @construction: hsl(255, 30%, 93%); 79 | @construction_barrier: darken( @construction, 5% ); 80 | 81 | @building: desaturate( darken( @land, 4% ), 100% ); 82 | @big_building: darken( @building, 6% ); 83 | 84 | @hospital: hsl( 200, 40%, 95% ); 85 | 86 | 87 | // road colors 88 | @casing_shift: 15%; 89 | 90 | @debug: 0%; 91 | @case_darken: 20%; 92 | @tunnel_dash: 4,4; 93 | 94 | @cbike: white; 95 | @cbike_case: darken( darken( @cbike, @case_darken ), @debug ); 96 | @cbike_small: mix( @cbike, @land, 75% ); 97 | @cbike_tunnel: mix( @cbike, @land, 60% ); 98 | @cbike_line: darken( @land, 8% ); 99 | @cbike_line_dark: darken( @land, 10% ); 100 | @cbike_line_tunnel: lighten( @cbike, 5% ); 101 | @cbike_line_case: mix( @cbike_case, @cbike, 70% ); 102 | 103 | @caero: hsl( 300, 30%, 90% ); 104 | @caero_case: darken( @caero, 4% ); 105 | @caero_line: mix( @caero_case, @aeroway, 60% ); 106 | 107 | @ccar: hsl(0, 100%, 94%); 108 | @ccar_tunnel: mix( @ccar, @land, 60% ); 109 | @ccar_line_tunnel: #ddd; 110 | @ccar_case: darken( @ccar, 5% ); 111 | @ccar_line: mix( @ccar_case, @land, 30% ); 112 | 113 | @cfoot: hsl(55, 100%, 70%); 114 | @cfoot_case: darken( @cfoot, 25% ); 115 | @cfoot_line: hsl(52, 100%, 50% ); 116 | @cfoot_line_dark: hsl(52, 100%, 50% ); 117 | @pedestrian_fill: hsl(55, 100%, 60%); 118 | @cfoot_area_case: darken( @pedestrian_fill, 15% ); 119 | 120 | @cobblestone: darken( @land, 3% ); 121 | @cob_scale: 1.5; 122 | @cob_placement: 0.2; 123 | 124 | @csteps: darken( @land, 25% ); 125 | 126 | @crailway: hsl( 0, 0%, 80% ); 127 | @crailway_tunnel: hsl( 0, 0%, 80% ); 128 | @crailway_hatch: hsl( 0, 0%, 80% ); 129 | 130 | @cferry: darken( @water, 15% ); 131 | 132 | // label colors 133 | @road_text: black; 134 | @road_text_dim: lighten( @road_text, 30% ); 135 | @road_text_car: mix( @road_text, @ccar, 30% ); 136 | @road_halo: white; 137 | 138 | @label: black; 139 | @label_light: mix( @label, @land, 80% ); 140 | @label_dim: mix( @label, @land, 90% ); 141 | @label_halo_place_fill: lighten( @land, 5% ); 142 | -------------------------------------------------------------------------------- /carto/areas.mss: -------------------------------------------------------------------------------- 1 | //land use 2 | 3 | @fade_factor: 1; 4 | @fade_18: 100 %; 5 | @fade_17: @fade_18*@fade_factor; 6 | @fade_16: @fade_17*@fade_factor; 7 | @fade_15: @fade_16*@fade_factor; 8 | @fade_14: @fade_15*@fade_factor; 9 | @fade_13: @fade_14*@fade_factor; 10 | @fade_12: @fade_13*@fade_factor; 11 | @fade_11: @fade_12*@fade_factor; 12 | @fade_10: @fade_11*@fade_factor; 13 | @fade_9: @fade_10*@fade_factor; 14 | 15 | @area18: 64; 16 | @area17: @area18 * 4; 17 | @area16: @area17 * 4; 18 | @area15: @area16 * 4; 19 | @area14: @area15 * 4; 20 | @area13: @area14 * 4; 21 | @area12: @area13 * 4; 22 | @area11: @area12 * 4; 23 | @area10: @area11 * 4; 24 | @area9: @area10 * 4; 25 | @area8: @area9 * 4; 26 | @area7: @area8 * 4; 27 | @area6: @area7 * 4; 28 | @area5: @area6 * 4; 29 | @area4: @area5 * 4; 30 | @area3: @area4 * 4; 31 | @area2: @area3 * 4; 32 | @area1: @area2 * 4; 33 | @area0: @area1 * 4; 34 | 35 | 36 | @water_scale: 0.25; 37 | 38 | @water_area18: @area18*@water_scale; 39 | @water_area17: @area17*@water_scale; 40 | @water_area16: @area16*@water_scale; 41 | @water_area15: @area15*@water_scale; 42 | @water_area14: @area14*@water_scale; 43 | @water_area13: @area13*@water_scale; 44 | @water_area12: @area12*@water_scale; 45 | @water_area11: @area11*@water_scale; 46 | @water_area10: @area10*@water_scale; 47 | @water_area9: @area9*@water_scale; 48 | @water_area8: @area8*@water_scale; 49 | @water_area7: @area7*@water_scale; 50 | @water_area6: @area6*@water_scale; 51 | @water_area5: @area5*@water_scale; 52 | @water_area4: @area4*@water_scale; 53 | @water_area3: @area3*@water_scale; 54 | @water_area2: @area2*@water_scale; 55 | @water_area1: @area1*@water_scale; 56 | @water_area0: @area0*@water_scale; 57 | 58 | //#landuse_gen0[zoom>3][zoom<=9], 59 | //#landuse_gen1[zoom>9][zoom<=12], 60 | //#landuse[zoom>12] { 61 | #landuse { 62 | ::landuse_0[zoom=0][way_area>=439804651], 63 | ::landuse_1[zoom=1][way_area>=109951162], 64 | ::landuse_2[zoom=2][way_area>=274877904], 65 | ::landuse_3[zoom=3][way_area>=687194767], 66 | ::landuse_4[zoom=4][way_area>=171869184], 67 | ::landuse_5[zoom=5][way_area>=429496729], 68 | ::landuse_6[zoom=6][way_area>=107374184], 69 | ::landuse_7[zoom=7][way_area>=268435456], 70 | ::landuse_8[zoom=8][way_area>=67108864], 71 | ::landuse_9[zoom=9][way_area>=16777216], 72 | ::landuse_10[zoom=10][way_area>=4194304], 73 | ::landuse_11[zoom=11][way_area>=1048576], 74 | ::landuse_12[zoom=12][way_area>=262144], 75 | ::landuse_13[zoom=13][way_area>=65536], 76 | ::landuse_14[zoom=14][way_area>=16384], 77 | ::landuse_15[zoom=15][way_area>=4096], 78 | ::landuse_16[zoom=16][way_area>=1024], 79 | ::landuse_17[zoom=17][way_area>=256], 80 | ::landuse_18[zoom>=18][way_area>=64] 81 | { 82 | [landuse='forest'], 83 | [natural='wood'] { 84 | polygon-fill: @wood; 85 | } 86 | 87 | [landuse='meadow'], 88 | [natural='scrub'] { 89 | polygon-fill: @meadow; 90 | } 91 | 92 | [landuse='orchard'], 93 | [landuse='vineyard'] { 94 | polygon-fill: @orchard; 95 | } 96 | 97 | [landuse='field'], 98 | [landuse='pasture'], 99 | [natural='heath'], 100 | [landuse='grass'], 101 | [natural='grassland'] { 102 | polygon-fill: @grass; 103 | } 104 | 105 | [landuse='village_green'], 106 | [leisure='common'], 107 | [landuse='recreation_ground'], 108 | [leisure='park'] { 109 | polygon-fill: @park; 110 | } 111 | 112 | [leisure='garden'] { 113 | polygon-fill: @garden; 114 | } 115 | 116 | [leisure='golf_course'], 117 | [leisure='pitch'], 118 | [leisure='sports_center'], 119 | [leisure='stadium'] { 120 | polygon-fill: @sports; 121 | } 122 | 123 | //rocky 124 | [natural='beach'] { 125 | polygon-fill: @beach; 126 | } 127 | [natural='bare_rock'], 128 | [natural='fell'], 129 | [natural='scree'], 130 | [natural='sand'] { 131 | polygon-fill: @sand; 132 | } 133 | //farms 134 | [landuse='farmyard'], 135 | [landuse='farm'], 136 | [landuse='farmland'], 137 | [landuse='farmyard'] { 138 | polygon-fill: @agriculture; 139 | } 140 | //urban 141 | [leisure='playground'] { 142 | polygon-fill: @playground; 143 | } 144 | [tourism='zoo'] { 145 | polygon-fill: @zoo; 146 | } 147 | [landuse='cemetery'], 148 | [amenity='grave_yard'] { 149 | polygon-fill: @cemetery; 150 | } 151 | [highway='pedestrian'], 152 | [highway='footway'] { 153 | polygon-fill: @pedestrian_fill; 154 | } 155 | 156 | [landuse='construction'] { 157 | polygon-fill: @construction; 158 | [barrier='fence'], 159 | [barrier='wall'] 160 | { 161 | line-color: @construction_barrier; 162 | line-width: 2; 163 | } 164 | } 165 | 166 | [landuse='residential'] { 167 | polygon-fill: @residential; 168 | } 169 | 170 | [aeroway='aerodrome'], 171 | [aeroway='helipad'], 172 | [aeroway='apron'], 173 | [aeroway='runway'] { 174 | polygon-fill: @aeroway; 175 | } 176 | } 177 | } 178 | /* 179 | #landuse_overlays[landuse='nature_reserve'][zoom>6] { 180 | line-color: darken(@wood,25%); 181 | line-opacity: 0.3; 182 | line-dasharray: 1,1; 183 | polygon-fill: darken(@wood,25%); 184 | polygon-opacity: 0.1; 185 | [zoom=7] { line-width: 0.4; } 186 | [zoom=8] { line-width: 0.6; } 187 | [zoom=9] { line-width: 0.8; } 188 | [zoom=10] { line-width: 1.0; } 189 | [zoom=11] { line-width: 1.5; } 190 | [zoom>=12] { line-width: 2.0; } 191 | } 192 | */ 193 | // wetlands 194 | #landuse_overlays[natural='wetland'][zoom>11] { 195 | [zoom>11][zoom<=14] { polygon-pattern-file:url(img/marsh-16.png); } 196 | [zoom>14] { polygon-pattern-file:url(img/marsh-32.png);} 197 | } 198 | 199 | // water areas 200 | //#water_gen0[zoom>3][zoom<=9], 201 | //#water_gen1[zoom>9][zoom<=12], 202 | //#water[zoom>12] { 203 | #water { 204 | ::water_0[zoom=0][way_area>=439804651], 205 | ::water_1[zoom=1][way_area>=109951162], 206 | ::water_2[zoom=2][way_area>=274877904], 207 | ::water_3[zoom=3][way_area>=687194767], 208 | ::water_4[zoom=4][way_area>=171869184], 209 | ::water_5[zoom=5][way_area>=429496729], 210 | ::water_6[zoom=6][way_area>=107374184], 211 | ::water_7[zoom=7][way_area>=268435456], 212 | ::water_8[zoom=8][way_area>=67108864], 213 | ::water_9[zoom=9][way_area>=16777216], 214 | ::water_10[zoom=10][way_area>=4194304], 215 | ::water_11[zoom=11][way_area>=1048576], 216 | ::water_12[zoom=12][way_area>=262144], 217 | ::water_13[zoom=13][way_area>=65536], 218 | ::water_14[zoom=14][way_area>=16384], 219 | ::water_15[zoom=15][way_area>=4096], 220 | ::water_16[zoom=16][way_area>=1024], 221 | ::water_17[zoom=17][way_area>=256], 222 | ::water_18[zoom>=18][way_area>=64] 223 | /* 224 | ::water_0[zoom=0][way_area>=@water_area0], 225 | ::water_1[zoom=1][way_area>=@water_area1], 226 | ::water_2[zoom=2][way_area>=@water_area2], 227 | ::water_3[zoom=3][way_area>=@water_area3], 228 | ::water_4[zoom=4][way_area>=@water_area4], 229 | ::water_5[zoom=5][way_area>=@water_area5], 230 | ::water_6[zoom=6][way_area>=@water_area6], 231 | ::water_7[zoom=7][way_area>=@water_area7], 232 | ::water_8[zoom=8][way_area>=@water_area8], 233 | ::water_9[zoom=9][way_area>=@water_area9], 234 | ::water_10[zoom=10][way_area>=@water_area10], 235 | ::water_11[zoom=11][way_area>=@water_area11], 236 | ::water_12[zoom=12][way_area>=@water_area12], 237 | ::water_13[zoom=13][way_area>=@water_area13], 238 | ::water_14[zoom=14][way_area>=@water_area14], 239 | ::water_15[zoom=15][way_area>=@water_area15], 240 | ::water_16[zoom=16][way_area>=@water_area16], 241 | ::water_17[zoom=17][way_area>=@water_area17], 242 | ::water_18[zoom>=18][way_area>=@water_area18] 243 | */ 244 | { 245 | polygon-fill: @water; 246 | } 247 | 248 | } 249 | 250 | -------------------------------------------------------------------------------- /carto/labels_roads.mss: -------------------------------------------------------------------------------- 1 | //road labels 2 | 3 | @rl0: 15; 4 | @rl1: 14; 5 | @rl2: 13; 6 | @rl3: 12; 7 | @rl4: 11; 8 | @rl5: 10; 9 | 10 | /* 11 | #ref_bike[zoom>=11][zoom<=18][reflen<=8] { 12 | shield-name: "[ref]"; 13 | shield-size: 9; 14 | shield-face-name: @sans_bold; 15 | shield-fill: white; 16 | shield-file: url(img/shield-motorway-1.png); 17 | shield-placement: line; 18 | shield-avoid-edges: true; 19 | shield-allow-overlap: false; 20 | shield-spacing: 400; 21 | shield-min-distance: 300; 22 | 23 | 24 | [reflen=1] { shield-file: url(img/shield-trunk-1.png); } 25 | [reflen=2] { shield-file: url(img/shield-trunk-2.png); } 26 | [reflen=3] { shield-file: url(img/shield-trunk-3.png); } 27 | [reflen=4] { shield-file: url(img/shield-trunk-4.png); } 28 | [reflen=5] { shield-file: url(img/shield-trunk-5.png); } 29 | [reflen=6] { shield-file: url(img/shield-trunk-6.png); } 30 | [reflen=7] { shield-file: url(img/shield-trunk-7.png); } 31 | [reflen=8] { shield-file: url(img/shield-trunk-8.png); } 32 | 33 | // [type='motorway'] { 34 | // [reflen=1] { shield-file: url(img/shield-motorway-1.png); } 35 | // [reflen=2] { shield-file: url(img/shield-motorway-2.png); } 36 | // [reflen=3] { shield-file: url(img/shield-motorway-3.png); } 37 | // [reflen=4] { shield-file: url(img/shield-motorway-4.png); } 38 | // [reflen=5] { shield-file: url(img/shield-motorway-5.png); } 39 | // [reflen=6] { shield-file: url(img/shield-motorway-6.png); } 40 | // [reflen=7] { shield-file: url(img/shield-motorway-7.png); } 41 | // [reflen=8] { shield-file: url(img/shield-motorway-8.png); } 42 | // } 43 | // [type='trunk'] { 44 | // [reflen=1] { shield-file: url(img/shield-trunk-1.png); } 45 | // [reflen=2] { shield-file: url(img/shield-trunk-2.png); } 46 | // [reflen=3] { shield-file: url(img/shield-trunk-3.png); } 47 | // [reflen=4] { shield-file: url(img/shield-trunk-4.png); } 48 | // [reflen=5] { shield-file: url(img/shield-trunk-5.png); } 49 | // [reflen=6] { shield-file: url(img/shield-trunk-6.png); } 50 | // [reflen=7] { shield-file: url(img/shield-trunk-7.png); } 51 | // [reflen=8] { shield-file: url(img/shield-trunk-8.png); } 52 | // } 53 | // [zoom=11] { shield-min-distance: 60; } //50 54 | // [zoom=12] { shield-min-distance: 80; } //60 55 | // [zoom=13] { shield-min-distance: 120; } //120 56 | // [zoom=14] { shield-min-distance: 180; } 57 | //} 58 | */ 59 | /* 60 | [zoom=11] { text-min-distance:70; } 61 | [zoom=12] { text-min-distance:80; } 62 | [zoom=13] { text-min-distance:100; } 63 | */ 64 | 65 | 66 | 67 | //#bike_routes[network='ncn'][zoom>=6], 68 | #route_labels { 69 | // ::national[network='ncn'][zoom>=6], 70 | ::regional[network='rcn'][zoom>=10], 71 | ::local[network='lcn'][zoom>=12] { 72 | text-name: '[name]'; 73 | text-placement: line; 74 | text-face-name: @sans_lt; 75 | text-halo-fill: @road_halo; 76 | text-halo-radius: @label_halo_radius; 77 | text-min-distance: 100; 78 | text-avoid-edges: true; 79 | text-allow-overlap: false; 80 | text-min-padding: 100; 81 | text-max-char-angle-delta: 18; 82 | text-character-spacing: 0.5; 83 | text-spacing: 300; 84 | 85 | [zoom<14] { text-dy: @route_width_1 + @route_casing_width + 4; } 86 | [zoom>=14] { text-dy: @route_width_0 + @route_casing_width + 4; } 87 | 88 | [zoom<17] { text-size: @rl5 * @label_scale; } 89 | [zoom>=17] { text-size: @rl3 * @label_scale; } 90 | } 91 | // ::national[network='ncn'][zoom>=6] { text-fill: hsl( 0, 100%, 80% ); } 92 | ::regional[network='rcn'][zoom>=10] { text-fill: hsl( 40, 100%, 40% ); } 93 | ::local[network='lcn'][zoom>=12] { text-fill: hsl( 80, 100%, 35% ); } 94 | 95 | } 96 | 97 | // ferry route labels 98 | #ferries { 99 | [zoom>=12] { 100 | text-name: '[name]'; 101 | text-placement: line; 102 | text-face-name: @sans_lt; 103 | text-halo-fill: @water; 104 | text-halo-radius: @label_halo_radius; 105 | text-min-distance: 100; 106 | text-avoid-edges: true; 107 | text-max-char-angle-delta: 18; 108 | text-character-spacing: 0.5; 109 | text-spacing: 300; 110 | text-size: @rl5 * @label_scale; 111 | text-fill: darken( @water, 40% ); 112 | } 113 | } 114 | 115 | #way_label_bike { 116 | ::text_11[zoom=11][sizegroup<=3], 117 | ::text_12[zoom=12][sizegroup<=4], 118 | ::text_13[zoom=13][sizegroup<=5], 119 | ::text_14[zoom=14][sizegroup<=5], 120 | ::text_15[zoom=15][sizegroup<=7], 121 | ::text_16[zoom=16][sizegroup<=7], 122 | ::text_17[zoom=17], 123 | ::text_18[zoom>=18] { 124 | text-name: '[name]'; 125 | text-placement: line; 126 | text-face-name: @sans_lt; 127 | text-halo-fill: @road_halo; 128 | text-halo-radius: @label_halo_radius; 129 | text-min-distance: 60; 130 | text-avoid-edges: true; 131 | text-max-char-angle-delta: 18; 132 | } 133 | 134 | ::text_11[zoom=11][sizegroup<=2], 135 | ::text_12[zoom=12][sizegroup<=3], 136 | ::text_13[zoom=13][sizegroup<=3], 137 | ::text_14[zoom=14][sizegroup<=4], 138 | ::text_15[zoom=15][sizegroup<=6], 139 | ::text_16[zoom=16][sizegroup<=7], 140 | ::text_17[zoom=17], 141 | ::text_18[zoom>=18] { 142 | text-fill: @road_text; 143 | } 144 | 145 | ::text_11[zoom=11][sizegroup=3], 146 | ::text_12[zoom=12][sizegroup=4], 147 | ::text_13[zoom=13][sizegroup>=4][sizegroup<=5], 148 | ::text_14[zoom=14][sizegroup=5], 149 | ::text_15[zoom=15][sizegroup>=6][sizegroup<=7] { 150 | text-fill: @road_text_dim; 151 | } 152 | 153 | ::text_11[zoom=11] { 154 | [sizegroup<=2] { text-size: @rl5 * @label_scale; } 155 | [sizegroup=3] { text-size: @rl5 * @label_scale; } 156 | } 157 | ::text_12[zoom=12] { 158 | [sizegroup<=2] { text-size: @rl4 * @label_scale; } 159 | [sizegroup=3] { text-size: @rl5 * @label_scale; } 160 | [sizegroup=4] { text-size: @rl5 * @label_scale; } 161 | } 162 | ::text_13[zoom=13] { 163 | [sizegroup<=3] { text-size: @rl4 * @label_scale; } 164 | [sizegroup=4] { text-size: @rl4 * @label_scale; } 165 | [sizegroup=5] { text-size: @rl5 * @label_scale; } 166 | } 167 | ::text_14[zoom=14] { 168 | [sizegroup<=2] { text-size: @rl3 * @label_scale; } 169 | [sizegroup=3] { text-size: @rl3 * @label_scale; } 170 | [sizegroup=4] { text-size: @rl4 * @label_scale; } 171 | [sizegroup=5] { text-size: @rl4 * @label_scale; } 172 | } 173 | ::text_15[zoom=15] { 174 | [sizegroup<=3] { text-size: @rl2 * @label_scale; } 175 | [sizegroup=4] { text-size: @rl2 * @label_scale; } 176 | [sizegroup=5] { text-size: @rl3 * @label_scale; } 177 | [sizegroup=6] { text-size: @rl4 * @label_scale; } 178 | [sizegroup=7] { text-size: @rl4 * @label_scale; } 179 | } 180 | ::text_16[zoom=16] { 181 | [sizegroup<=3] { text-size: @rl1 * @label_scale; text-face-name: @sans; } 182 | [sizegroup=4] { text-size: @rl1 * @label_scale; } 183 | [sizegroup=5] { text-size: @rl2 * @label_scale; } 184 | [sizegroup=6] { text-size: @rl3 * @label_scale; } 185 | [sizegroup=7] { text-size: @rl4 * @label_scale; } 186 | } 187 | ::text_17[zoom=17] { 188 | [sizegroup<=3] { text-size: @rl0 * @label_scale; text-face-name: @sans; } 189 | [sizegroup=4] { text-size: @rl0 * @label_scale; } 190 | [sizegroup=5] { text-size: @rl0 * @label_scale; } 191 | [sizegroup>=6][sizegroup<=7] { text-size: @rl1 * @label_scale; } 192 | [sizegroup>=8] { text-size: @rl2 * @label_scale; } 193 | } 194 | ::text_18[zoom>=18] { 195 | [sizegroup<=3] { text-size: @rl0 * @label_scale; text-face-name: @sans; } 196 | [sizegroup=4] { text-size: @rl0 * @label_scale; } 197 | [sizegroup=5] { text-size: @rl0 * @label_scale; } 198 | [sizegroup>=6][sizegroup<=7] { text-size: @rl1 * @label_scale; } 199 | [sizegroup>=8] { text-size: @rl2 * @label_scale; } 200 | } 201 | } 202 | 203 | //oneway arrows 204 | #way_label_bike[oneway!=0][modegroup='yes'] { 205 | ::oneway_16[zoom=16][sizegroup<=7], 206 | ::oneway_17[zoom=17], 207 | ::oneway_18[zoom>=18] { 208 | marker-placement: line; 209 | marker-max-error: 0.5; 210 | marker-spacing: 200; 211 | marker-file: url(markers/oneway.svg); 212 | [oneway=-1] { marker-file: url(markers/oneway_reverse.svg); } 213 | [zoom=16] { marker-transform: "scale(1)"; } 214 | [zoom>=17] { marker-transform: "scale(1.25)"; } 215 | } 216 | } 217 | 218 | 219 | 220 | -------------------------------------------------------------------------------- /fonts/OpenSans-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 16 | 17 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 18 | 19 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 20 | 21 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 22 | 23 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 24 | 25 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 26 | 27 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 28 | 29 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 30 | 31 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 32 | 33 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 34 | 35 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 36 | 37 | You must give any other recipients of the Work or Derivative Works a copy of this License; and 38 | 39 | You must cause any modified files to carry prominent notices stating that You changed the files; and 40 | 41 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 42 | 43 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 44 | 45 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 46 | 47 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 48 | 49 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 50 | 51 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 52 | 53 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. -------------------------------------------------------------------------------- /tools/osm2pgsql.style: -------------------------------------------------------------------------------- 1 | # This is the default osm2pgsql .style file that comes with osm2pgsql. 2 | # 3 | # A .style file has 4 columns that define how OSM objects end up in tables in 4 | # the database and what columns are created. It interacts with the command-line 5 | # hstore options. 6 | # 7 | # Columns 8 | # ======= 9 | # 10 | # OsmType: This is either "node", "way" or "node,way" and indicates if this tag 11 | # applies to nodes, ways, or both. 12 | # 13 | # Tag: The tag 14 | # 15 | # DataType: The type of the column to be created. Normally "text" 16 | # 17 | # Flags: Flags that indicate what table the OSM object is moved into. 18 | # 19 | # There are 5 possible flags. These flags are used both to indicate if a column 20 | # should be created, and if ways with the tag are assumed to be areas. The area 21 | # assumptions can be overridden with an area=yes/no tag 22 | # 23 | # polygon - Create a column for this tag, and objects the tag with are areas 24 | # 25 | # linear - Create a column for this tag 26 | # 27 | # phstore - Don't create a column for this tag, but objects with the tag are areas 28 | # 29 | # delete - Drop this tag completely and don't create a column for it. This also 30 | # prevents the tag from being added to hstore columns 31 | # 32 | # nocache - Deprecated and does nothing 33 | # 34 | # If an object has a tag that indicates it is an area or has area=yes/1, 35 | # osm2pgsql will try to turn it into an area. If it succeeds, it places it in 36 | # the polygon table. If it fails (e.g. not a closed way) it places it in the 37 | # line table. 38 | # 39 | # Nodes are never placed into the polygon or line table and are always placed in 40 | # the point table. 41 | # 42 | # Hstore 43 | # ====== 44 | # 45 | # The options --hstore, --hstore-match-only, and --hstore-all interact with 46 | # the .style file. 47 | # 48 | # With --hstore any tags without a column will be added to the hstore column. 49 | # This will also cause all objects to be kept. 50 | # 51 | # With --hstore-match-only the behavior for tags is the same, but objects are 52 | # only kept if they have a non-NULL value in one of the columns. 53 | # 54 | # With --hstore-all all tags are added to the hstore column unless they appear 55 | # in the style file with a delete flag, causing duplication between the normal 56 | # columns and the hstore column. 57 | # 58 | # Special database columns 59 | # ======================== 60 | # 61 | # There are some special database columns that if present in the .style file 62 | # will be populated by osm2pgsql. 63 | # 64 | # These are 65 | # 66 | # z_order - datatype int4 67 | # 68 | # way_area - datatype real. The area of the way, in the units of the projection 69 | # (e.g. square mercator meters). Only applies to areas 70 | # 71 | # osm_user, osm_uid, osm_version, osm_timestamp - datatype text. Used with the 72 | # --extra-attributes option to include metadata in the database. If importing 73 | # with both --hstore and --extra-attributes the meta-data will end up in the 74 | # tags hstore column regardless of the style file. 75 | 76 | # OsmType Tag DataType Flags 77 | node,way access text linear 78 | node,way addr:housename text linear 79 | node,way addr:housenumber text linear 80 | node,way addr:interpolation text linear 81 | node,way admin_level text linear 82 | node,way aerialway text linear 83 | node,way aeroway text polygon 84 | node,way amenity text polygon 85 | node,way area text # hard coded support for area=1/yes => polygon is in osm2pgsql 86 | node,way barrier text linear 87 | node,way bicycle text 88 | node,way brand text linear 89 | node,way bridge int4 linear 90 | node,way boundary text linear 91 | node,way building text polygon 92 | node capital text linear 93 | node,way construction text linear 94 | node,way covered text linear 95 | node,way culvert text linear 96 | node,way cutting text linear 97 | node,way denomination text linear 98 | node,way disused text linear 99 | node ele text linear 100 | node,way embankment text linear 101 | node,way foot text linear 102 | node,way generator:source text linear 103 | node,way harbour text polygon 104 | node,way highway text linear 105 | node,way historic text polygon 106 | node,way horse text linear 107 | node,way intermittent text linear 108 | node,way junction text linear 109 | node,way landuse text polygon 110 | node,way layer int4 linear 111 | node,way leisure text polygon 112 | node,way lock text linear 113 | node,way man_made text polygon 114 | node,way military text polygon 115 | node,way motorcar text linear 116 | node,way name text linear 117 | node,way natural text polygon # natural=coastline tags are discarded by a hard coded rule in osm2pgsql 118 | node,way office text polygon 119 | node,way operator text linear 120 | node,way place text polygon 121 | node poi text 122 | node,way population int4 linear 123 | node,way power text polygon 124 | node,way power_source text linear 125 | node,way public_transport text polygon 126 | node,way railway text linear 127 | node,way ref text linear 128 | node,way religion text nocache 129 | node,way route text linear 130 | node,way service text linear 131 | node,way shop text polygon 132 | node,way sport text polygon 133 | node,way surface text linear 134 | node,way toll text linear 135 | node,way tourism text polygon 136 | node,way tower:type text linear 137 | way tracktype text linear 138 | node,way tunnel int4 linear 139 | node,way water text polygon 140 | node,way waterway text polygon 141 | node,way wetland text polygon 142 | node,way width text linear 143 | node,way wood text linear 144 | node,way z_order int4 linear # This is calculated during import 145 | way way_area real # This is calculated during import 146 | 147 | # Area tags 148 | # We don't make columns for these tags, but objects with them are areas. 149 | # Mainly for use with hstore 150 | way abandoned:aeroway text phstore 151 | way abandoned:amenity text phstore 152 | way abandoned:building text phstore 153 | way abandoned:landuse text phstore 154 | way abandoned:power text phstore 155 | way area:highway text phstore 156 | 157 | # Deleted tags 158 | # These are tags that are generally regarded as useless for most rendering. 159 | # Most of them are from imports or intended as internal information for mappers 160 | # Some of them are automatically deleted by editors. 161 | # If you want some of them, perhaps for a debugging layer, just delete the lines. 162 | 163 | # These tags are used by mappers to keep track of data. 164 | # They aren't very useful for rendering. 165 | node,way note text delete 166 | node,way note:* text delete 167 | node,way source text delete 168 | node,way source_ref text delete 169 | node,way source:* text delete 170 | node,way attribution text delete 171 | node,way comment text delete 172 | node,way fixme text delete 173 | 174 | # Tags generally dropped by editors, not otherwise covered 175 | node,way created_by text delete 176 | node,way odbl text delete 177 | node,way odbl:note text delete 178 | node,way SK53_bulk:load text delete 179 | 180 | # Lots of import tags 181 | # TIGER (US) 182 | node,way tiger:* text delete 183 | 184 | # NHD (US) 185 | # NHD has been converted every way imaginable 186 | node,way NHD:* text delete 187 | node,way nhd:* text delete 188 | 189 | # GNIS (US) 190 | node,way gnis:* text delete 191 | 192 | # Geobase (CA) 193 | node,way geobase:* text delete 194 | # NHN (CA) 195 | node,way accuracy:meters text delete 196 | node,way sub_sea:type text delete 197 | node,way waterway:type text delete 198 | 199 | # KSJ2 (JA) 200 | # See also note:ja and source_ref above 201 | node,way KSJ2:* text delete 202 | # Yahoo/ALPS (JA) 203 | node,way yh:* text delete 204 | 205 | # osak (DK) 206 | node,way osak:* text delete 207 | 208 | # kms (DK) 209 | node,way kms:* text delete 210 | 211 | # ngbe (ES) 212 | # See also note:es and source:file above 213 | node,way ngbe:* text delete 214 | 215 | # naptan (UK) 216 | node,way naptan:* text delete 217 | 218 | # Corine (CLC) (Europe) 219 | node,way CLC:* text delete 220 | 221 | # misc 222 | node,way 3dshapes:ggmodelk text delete 223 | node,way AND_nosr_r text delete 224 | node,way import text delete 225 | node,way it:fvg:* text delete 226 | 227 | 228 | 229 | # custom tags 230 | node,way modegroup text linear 231 | node,way sizegroup int4 linear 232 | node placegroup int4 linear 233 | 234 | way cycleway text linear 235 | way cycleway:left text linear 236 | way cycleway:right text linear 237 | 238 | way is_landuse int4 polygon 239 | way is_waterarea int4 polygon 240 | 241 | node,way network text 242 | node,way oneway int4 linear 243 | 244 | -------------------------------------------------------------------------------- /carto/labels_places.mss: -------------------------------------------------------------------------------- 1 | //place labels 2 | #place 3 | { 4 | ::place_a[zoom>=2][zoom<=7] { 5 | [placegroup=0] { 6 | text-min-distance: @text_distance; 7 | text-line-spacing: @line_spacing; 8 | text-wrap-width: @wrap_width; 9 | text-name: [name]; 10 | text-face-name: @sans; 11 | text-fill: @label; 12 | text-halo-fill: @label_halo_place_fill; 13 | text-halo-radius: @label_halo_radius; 14 | text-character-spacing: @char_spacing; 15 | text-allow-overlap: false; 16 | 17 | [zoom=2] { text-size: @ls_2a; text-fill: @label_dim; } 18 | [zoom=3] { text-size: @ls_3a; } 19 | [zoom=4] { text-size: @ls_4a; } 20 | [zoom=5] { text-size: @ls_5a; } 21 | [zoom=6] { text-size: @ls_6a; } 22 | [zoom=7] { text-size: @ls_7a; } 23 | 24 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 25 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 26 | } 27 | } 28 | 29 | ::place_b[zoom>=4][zoom<=15] { 30 | [placegroup=1] { 31 | text-min-distance: @text_distance; 32 | text-line-spacing: @line_spacing; 33 | text-wrap-width: @wrap_width; 34 | text-name: [name]; 35 | text-face-name: @sans; 36 | text-fill: @label; 37 | text-halo-fill: @label_halo_place_fill; 38 | text-halo-radius: @label_halo_radius; 39 | text-character-spacing: @char_spacing; 40 | text-allow-overlap: false; 41 | 42 | [zoom=4] { text-size: @ls_4b; text-fill: @label_dim; } 43 | [zoom=5] { text-size: @ls_5b; } 44 | [zoom=6] { text-size: @ls_6b; } 45 | [zoom=7] { text-size: @ls_7b; } 46 | [zoom=8] { text-size: @ls_8b; } 47 | [zoom=9] { text-size: @ls_9b; } 48 | [zoom=10] { text-size: @ls_10b; } 49 | [zoom=11] { text-size: @ls_11b; } 50 | [zoom=12] { text-size: @ls_12b; text-fill: @label_dim; } 51 | [zoom=13] { text-size: @ls_13b; text-fill: @label_dim; } 52 | [zoom=14] { text-size: @ls_14b; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 53 | [zoom=15] { text-size: @ls_15b; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 54 | 55 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 56 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 57 | } 58 | } 59 | 60 | ::place_c[zoom>=5][zoom<=15] { 61 | [placegroup=2] { 62 | text-min-distance: @text_distance; 63 | text-line-spacing: @line_spacing; 64 | text-wrap-width: @wrap_width; 65 | text-name: [name]; 66 | text-face-name: @sans_lt; 67 | text-fill: @label; 68 | text-halo-fill: @label_halo_place_fill; 69 | text-halo-radius: @label_halo_radius; 70 | text-character-spacing: @char_spacing; 71 | text-allow-overlap: false; 72 | 73 | [zoom=5] { text-size: @ls_5c; text-fill: @label_dim; } 74 | [zoom=6] { text-size: @ls_6c; } 75 | [zoom=7] { text-size: @ls_7c; } 76 | [zoom=8] { text-size: @ls_8c; } 77 | [zoom=9] { text-size: @ls_9c; } 78 | [zoom=10] { text-size: @ls_10c; } 79 | [zoom=11] { text-size: @ls_11c; } 80 | [zoom=12] { text-size: @ls_12c; text-fill: @label_dim; } 81 | [zoom=13] { text-size: @ls_13c; text-fill: @label_dim; } 82 | [zoom=14] { text-size: @ls_14c; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 83 | [zoom=15] { text-size: @ls_15c; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 84 | 85 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 86 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 87 | } 88 | } 89 | 90 | ::place_d[zoom>=6][zoom<=15] { 91 | [placegroup=3] { 92 | text-min-distance: @text_distance; 93 | text-line-spacing: @line_spacing; 94 | text-wrap-width: @wrap_width; 95 | text-name: [name]; 96 | text-face-name: @sans_lt; 97 | text-fill: @label; 98 | text-halo-fill: @label_halo_place_fill; 99 | text-halo-radius: @label_halo_radius; 100 | text-character-spacing: @char_spacing; 101 | text-allow-overlap: false; 102 | 103 | [zoom=6] { text-size: @ls_6d; text-fill: @label_dim; } 104 | [zoom=7] { text-size: @ls_7d; } 105 | [zoom=8] { text-size: @ls_8d; } 106 | [zoom=9] { text-size: @ls_9d; } 107 | [zoom=10] { text-size: @ls_10d; } 108 | [zoom=11] { text-size: @ls_11d; } 109 | [zoom=12] { text-size: @ls_12d; } 110 | [zoom=13] { text-size: @ls_13d; } 111 | [zoom=14] { text-size: @ls_14d; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 112 | [zoom=15] { text-size: @ls_15d; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 113 | 114 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 115 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 116 | } 117 | } 118 | 119 | ::place_e[zoom>=7][zoom<=15] { 120 | [placegroup=4] { 121 | text-min-distance: @text_distance; 122 | text-line-spacing: @line_spacing; 123 | text-wrap-width: @wrap_width; 124 | text-name: [name]; 125 | text-face-name: @sans_lt; 126 | text-fill: @label; 127 | text-halo-fill: @label_halo_place_fill; 128 | text-halo-radius: @label_halo_radius; 129 | text-character-spacing: @char_spacing; 130 | text-allow-overlap: false; 131 | 132 | [zoom=7] { text-size: @ls_7e; text-fill: @label_dim; } 133 | [zoom=8] { text-size: @ls_8e; } 134 | [zoom=9] { text-size: @ls_9e; } 135 | [zoom=10] { text-size: @ls_10e; } 136 | [zoom=11] { text-size: @ls_11e; } 137 | [zoom=12] { text-size: @ls_12e; } 138 | [zoom=13] { text-size: @ls_13e; } 139 | [zoom=14] { text-size: @ls_14e; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 140 | [zoom=15] { text-size: @ls_15e; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 141 | 142 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 143 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 144 | } 145 | } 146 | 147 | ::place_f[zoom>=8][zoom<=15] { 148 | [placegroup=5] { 149 | text-min-distance: @text_distance; 150 | text-line-spacing: @line_spacing; 151 | text-wrap-width: @wrap_width; 152 | text-name: [name]; 153 | text-face-name: @sans_lt; 154 | text-fill: @label; 155 | text-halo-fill: @label_halo_place_fill; 156 | text-halo-radius: @label_halo_radius; 157 | text-character-spacing: @char_spacing; 158 | text-allow-overlap: false; 159 | 160 | [zoom=8] { text-size: @ls_8f; text-fill: @label_dim; } 161 | [zoom=9] { text-size: @ls_9f; } 162 | [zoom=10] { text-size: @ls_10f; } 163 | [zoom=11] { text-size: @ls_11f; } 164 | [zoom=12] { text-size: @ls_12f; } 165 | [zoom=13] { text-size: @ls_13f; } 166 | [zoom=14] { text-size: @ls_14f; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 167 | [zoom=15] { text-size: @ls_15f; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 168 | 169 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 170 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 171 | } 172 | } 173 | 174 | ::place_g[zoom>=9][zoom<=15] { 175 | [placegroup=6] { 176 | text-min-distance: @text_distance; 177 | text-line-spacing: @line_spacing; 178 | text-wrap-width: @wrap_width; 179 | text-name: [name]; 180 | text-face-name: @sans_lt; 181 | text-fill: @label; 182 | text-halo-fill: @label_halo_place_fill; 183 | text-halo-radius: @label_halo_radius; 184 | text-character-spacing: @char_spacing; 185 | text-allow-overlap: false; 186 | 187 | [zoom=9] { text-size: @ls_9g; text-fill: @label_dim; } 188 | [zoom=10] { text-size: @ls_10g; text-fill: @label_dim; } 189 | [zoom=11] { text-size: @ls_11g; } 190 | [zoom=12] { text-size: @ls_12g; } 191 | [zoom=13] { text-size: @ls_13g; } 192 | [zoom=14] { text-size: @ls_14g; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 193 | [zoom=15] { text-size: @ls_15g; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 194 | 195 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 196 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 197 | } 198 | } 199 | 200 | ::place_h[zoom>=11][zoom<=15] { 201 | [placegroup=7] { 202 | text-min-distance: @text_distance; 203 | text-line-spacing: @line_spacing; 204 | text-wrap-width: @wrap_width; 205 | text-name: [name]; 206 | text-face-name: @sans_lt; 207 | text-fill: @label; 208 | text-halo-fill: @label_halo_place_fill; 209 | text-halo-radius: @label_halo_radius; 210 | text-character-spacing: @char_spacing; 211 | text-allow-overlap: false; 212 | 213 | [zoom=11] { text-size: @ls_11h; text-fill: @label_dim; } 214 | [zoom=12] { text-size: @ls_12h; } 215 | [zoom=13] { text-size: @ls_13h; } 216 | [zoom=14] { text-size: @ls_14h; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 217 | [zoom=15] { text-size: @ls_15h; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 218 | 219 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 220 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 221 | } 222 | } 223 | 224 | ::place_i[zoom>=14][zoom<=15] { 225 | [placegroup=8] { 226 | text-min-distance: @text_distance; 227 | text-line-spacing: @line_spacing; 228 | text-wrap-width: @wrap_width; 229 | text-name: [name]; 230 | text-face-name: @sans_lt; 231 | text-fill: @label; 232 | text-halo-fill: @label_halo_place_fill; 233 | text-halo-radius: @label_halo_radius; 234 | text-character-spacing: @char_spacing; 235 | text-allow-overlap: false; 236 | 237 | [zoom=14] { text-size: @ls_14i; text-transform: uppercase; text-fill: @label_dim; text-face-name: @sans; } 238 | [zoom=15] { text-size: @ls_15i; text-transform: uppercase; text-fill: @label_light; text-face-name: @sans; } 239 | 240 | [place='neighbourhood'], [place='suburb'] { text-fill: @label_light; } 241 | [place='island'],[place='islet'],[place='locality'] { text-transform: none; text-face-name: @sans_lt_italic; } 242 | } 243 | } 244 | 245 | ::island[zoom>=10][zoom<=15] { 246 | [place='island'] { 247 | text-min-distance: @text_distance; 248 | text-line-spacing: @line_spacing; 249 | text-wrap-width: @wrap_width; 250 | text-name: [name]; 251 | text-face-name: @sans_lt_italic; 252 | text-fill: @label_dim; 253 | text-halo-fill: @label_halo_place_fill; 254 | text-halo-radius: @label_halo_radius; 255 | text-character-spacing: @char_spacing; 256 | text-allow-overlap: false; 257 | 258 | [zoom=10] { text-size: @ls_10f; text-fill: @label_light; } 259 | [zoom=11] { text-size: @ls_11f; } 260 | [zoom=12] { text-size: @ls_12f; } 261 | [zoom=13] { text-size: @ls_13f; } 262 | [zoom=14] { text-size: @ls_14f; } 263 | [zoom=15] { text-size: @ls_15f; } 264 | } 265 | } 266 | 267 | ::islet[zoom>=12][zoom<=15] { 268 | [place='islet'] { 269 | text-min-distance: @text_distance; 270 | text-line-spacing: @line_spacing; 271 | text-wrap-width: @wrap_width; 272 | text-name: [name]; 273 | text-face-name: @sans_lt_italic; 274 | text-fill: @label_dim; 275 | text-halo-fill: @label_halo_place_fill; 276 | text-halo-radius: @label_halo_radius; 277 | text-character-spacing: @char_spacing; 278 | text-allow-overlap: false; 279 | 280 | [zoom=14] { text-size: @ls_14g; text-fill: @label_light; } 281 | [zoom=15] { text-size: @ls_15g; } 282 | } 283 | } 284 | 285 | } 286 | -------------------------------------------------------------------------------- /carto/roads.mss: -------------------------------------------------------------------------------- 1 | // roads 2 | 3 | @width: 1.2; 4 | 5 | @case_width: 1.3; 6 | 7 | @w0: @width * 0.5; 8 | @w1: @width * 1; 9 | @w2: @width * 2; 10 | @w3: @width * 3; 11 | @w4: @width * 4; 12 | @w5: @width * 6; 13 | @w6: @width * 8; 14 | @w7: @width * 9; 15 | @w8: @width * 12; 16 | @w9: @width * 15; 17 | @w10: @width * 18; 18 | 19 | 20 | //LOW ZOOM 21 | #car_low { 22 | ::line_5[zoom=5] { 23 | [sizegroup<=1] { line-color: @ccar_line; } 24 | [sizegroup=2] { line-color: @ccar_line; } 25 | } 26 | ::line_6[zoom=6] { 27 | [sizegroup<=1] { line-color: @ccar_line; } 28 | [sizegroup=2] { line-color: @ccar_line; } 29 | } 30 | } 31 | 32 | #bike_low { 33 | ::line_5[zoom=5] { 34 | [sizegroup<=1] { line-color: @cbike_line; } 35 | [sizegroup<=2] { line-color: @cbike_line; } 36 | } 37 | ::line_6[zoom=6] { 38 | [sizegroup<=1] { line-color: @cbike_line; } 39 | [sizegroup<=2] { line-color: @cbike_line; } 40 | } 41 | } 42 | 43 | 44 | #car_low, 45 | #bike_low { 46 | ::line_5[zoom=5] { 47 | [sizegroup<=1] { line-width: @w1; } 48 | [sizegroup=2] { line-width: @w0; } 49 | } 50 | ::line_6[zoom=6] { 51 | [sizegroup<=1] { line-width: @w1; } 52 | [sizegroup=2] { line-width: @w0; } 53 | } 54 | } 55 | 56 | //MEDIUM ZOOM 57 | //line 58 | #car_medium { 59 | ::line_7[zoom=7][sizegroup>=0][sizegroup<=3], 60 | ::line_8[zoom=8][sizegroup>=3][sizegroup<=3], 61 | ::line_9[zoom=9][sizegroup>=4][sizegroup<=4], 62 | ::line_10[zoom=10][sizegroup>=4][sizegroup<=4] { 63 | line-color: @ccar_line; 64 | } 65 | } 66 | 67 | #bike_medium { 68 | ::line_7[zoom=7][sizegroup>=0][sizegroup<=3], 69 | ::line_8[zoom=8][sizegroup>=3][sizegroup<=3], 70 | ::line_9[zoom=9][sizegroup>=4][sizegroup<=4], 71 | ::line_10[zoom=10][sizegroup>=4][sizegroup<=4] { 72 | line-color: @cbike_line; 73 | } 74 | } 75 | 76 | #car_medium, 77 | #bike_medium { 78 | ::line_7[zoom=7] { 79 | [sizegroup<=2] { line-width: @w1; } 80 | [sizegroup=3] { line-width: @w0; } 81 | } 82 | ::line_8[zoom=8] { 83 | [sizegroup=3] { line-width: @w1; } 84 | } 85 | ::line_9[zoom=9] { 86 | [sizegroup=4] { line-width: @w0; } 87 | } 88 | ::line_10[zoom=10] { 89 | [sizegroup=4] { line-width: @w1; } 90 | } 91 | } 92 | 93 | //case 94 | #car_medium { 95 | ::case_8[zoom=8][sizegroup<=2], 96 | ::case_9[zoom=9][sizegroup<=3], 97 | ::case_10[zoom=10][sizegroup<=3] { 98 | line-color: @ccar_case; 99 | } 100 | } 101 | 102 | #bike_medium { 103 | ::case_8[zoom=8][sizegroup<=2], 104 | ::case_9[zoom=9][sizegroup<=3], 105 | ::case_10[zoom=10][sizegroup<=3] { 106 | line-color: @cbike_case; 107 | } 108 | } 109 | 110 | #car_medium, 111 | #bike_medium { 112 | ::case_8[zoom=8] { 113 | [sizegroup<=2] { line-width: @w1+@case_width; } 114 | } 115 | ::case_9[zoom=9] { 116 | [sizegroup<=2] { line-width: @w2+@case_width; } 117 | [sizegroup=3] { line-width: @w2+@case_width; } 118 | } 119 | ::case_10[zoom=10] { 120 | [sizegroup<=2] { line-width: @w2+@case_width; } 121 | [sizegroup=3] { line-width: @w2+@case_width; } 122 | } 123 | } 124 | 125 | //fill 126 | #car_medium { 127 | ::fill_8[zoom=8] { 128 | [sizegroup<=2] { line-color: @ccar; } 129 | } 130 | ::fill_9[zoom=9] { 131 | [sizegroup<=2] { line-color: @ccar; } 132 | [sizegroup=3] { line-color: @ccar; } 133 | } 134 | ::fill_10[zoom=10] { 135 | [sizegroup<=2] { line-color: @ccar; } 136 | [sizegroup=3] { line-color: @ccar; } 137 | } 138 | } 139 | 140 | #bike_medium { 141 | ::fill_8[zoom=8] { 142 | [sizegroup<=2] { line-color: @cbike; } 143 | } 144 | ::fill_9[zoom=9] { 145 | [sizegroup<=2] { line-color: @cbike; } 146 | [sizegroup=3] { line-color: @cbike_small; } 147 | } 148 | ::fill_10[zoom=10] { 149 | [sizegroup<=2] { line-color: @cbike; } 150 | [sizegroup=3] { line-color: @cbike_small; } 151 | } 152 | } 153 | 154 | #car_medium, 155 | #bike_medium { 156 | ::fill_8[zoom=8] { 157 | [sizegroup<=2] { line-width: @w1; } 158 | } 159 | ::fill_9[zoom=9] { 160 | [sizegroup<=2] { line-width: @w2; } 161 | [sizegroup=3] { line-width: @w2; } 162 | } 163 | ::fill_10[zoom=10] { 164 | [sizegroup<=2] { line-width: @w2; } 165 | [sizegroup=3] { line-width: @w2; } 166 | } 167 | } 168 | 169 | 170 | 171 | //HIGH ZOOM 172 | //line 173 | #car_tunnels { 174 | ::line_11[zoom=11][sizegroup>=4][sizegroup<=5], 175 | ::line_12[zoom=12][sizegroup>=5][sizegroup<=6], 176 | ::line_13[zoom=13][sizegroup>=6][sizegroup<=7], 177 | ::line_14[zoom=14][sizegroup>=6][sizegroup<=7], 178 | ::line_15[zoom=15], 179 | ::line_16[zoom=16] { 180 | line-color: @ccar_line_tunnel; 181 | } 182 | } 183 | 184 | #car_grounds, 185 | #car_bridges { 186 | ::line_11[zoom=11][sizegroup>=4][sizegroup<=5], 187 | ::line_12[zoom=12][sizegroup>=5][sizegroup<=6], 188 | ::line_13[zoom=13][sizegroup>=6][sizegroup<=7], 189 | ::line_14[zoom=14][sizegroup>=6][sizegroup<=7], 190 | ::line_15[zoom=15], 191 | ::line_16[zoom=16] { 192 | line-color: @ccar_line; 193 | } 194 | } 195 | 196 | #foot_grounds { 197 | ::line_11[zoom=11][sizegroup>=4][sizegroup<=5], 198 | ::line_12[zoom=12][sizegroup>=5][sizegroup<=6], 199 | ::line_13[zoom=13][sizegroup>=6][sizegroup<=7], 200 | ::line_14[zoom=14][sizegroup>=6][sizegroup<=7], 201 | ::line_15[zoom=15] { 202 | line-color: @cfoot_line; 203 | } 204 | ::line_16[zoom=16] { 205 | line-color: @cfoot_line_dark; 206 | } 207 | } 208 | 209 | #bike_tunnels { 210 | ::line_11[zoom=11][sizegroup>=4][sizegroup<=5], 211 | ::line_12[zoom=12][sizegroup>=5][sizegroup<=6], 212 | ::line_13[zoom=13][sizegroup>=6][sizegroup<=7], 213 | ::line_14[zoom=14][sizegroup>=6][sizegroup<=7], 214 | ::line_15[zoom=15], 215 | ::line_16[zoom=16] { 216 | line-color: @cbike_line_tunnel; 217 | } 218 | } 219 | 220 | #bike_grounds, 221 | #bike_bridges { 222 | ::line_11[zoom=11][sizegroup=4], 223 | ::line_12[zoom=12][sizegroup=5], 224 | ::line_13[zoom=13][sizegroup=6], 225 | ::line_14[zoom=14][sizegroup>=6][sizegroup<=7], 226 | ::line_16[zoom=16] { 227 | line-color: @cbike_line_dark; 228 | } 229 | ::line_11[zoom=11][sizegroup>=5][sizegroup<=5], 230 | ::line_12[zoom=12][sizegroup>=6][sizegroup<=6], 231 | ::line_13[zoom=13][sizegroup>=7][sizegroup<=7], 232 | ::line_15[zoom=15] 233 | { 234 | line-color: @cbike_line; 235 | } 236 | } 237 | 238 | .tunnel { 239 | ::line_11[zoom=11][sizegroup>=4][sizegroup<=5], 240 | ::line_12[zoom=12][sizegroup>=5][sizegroup<=6], 241 | ::line_13[zoom=13][sizegroup>=6][sizegroup<=7], 242 | ::line_14[zoom=14][sizegroup>=6][sizegroup<=7], 243 | ::line_15[zoom=15], 244 | ::line_16[zoom=16] { 245 | line-dasharray: @tunnel_dash; 246 | } 247 | } 248 | 249 | .way { 250 | ::line_11[zoom=11] { 251 | [sizegroup=4] { line-width: @w1; } 252 | [sizegroup=5] { line-width: @w0; } 253 | } 254 | ::line_12[zoom=12] { 255 | [sizegroup=5] { line-width: @w1; } 256 | [sizegroup=6] { line-width: @w0; } 257 | } 258 | ::line_13[zoom=13] { 259 | [sizegroup=6] { line-width: @w1; } 260 | [sizegroup=7] { line-width: @w0; } 261 | } 262 | ::line_14[zoom=14] { 263 | [sizegroup=6] { line-width: @w1; } 264 | [sizegroup=7] { line-width: @w0; } 265 | } 266 | ::line_15[zoom=15] { 267 | line-width: @w1; 268 | } 269 | ::line_16[zoom=16] { 270 | line-width: @w1; 271 | } 272 | } 273 | 274 | //casing 275 | .ground { 276 | ::case_11[zoom=11][sizegroup<=3], 277 | ::case_12[zoom=12][sizegroup<=4], 278 | ::case_13[zoom=13][sizegroup<=5], 279 | ::case_14[zoom=14][sizegroup<=5], 280 | ::case_15[zoom=15][sizegroup<=7], 281 | ::case_16[zoom=16][sizegroup<=7], 282 | ::case_17[zoom=17], 283 | ::case_18[zoom>=18] { 284 | line-cap: round; 285 | } 286 | } 287 | 288 | .tunnel, 289 | .bridge { 290 | ::case_11[zoom=11][sizegroup<=3], 291 | ::case_12[zoom=12][sizegroup<=4], 292 | ::case_13[zoom=13][sizegroup<=5], 293 | ::case_14[zoom=14][sizegroup<=5], 294 | ::case_15[zoom=15][sizegroup<=7], 295 | ::case_16[zoom=16][sizegroup<=7], 296 | ::case_17[zoom=17], 297 | ::case_18[zoom>=18] { 298 | line-cap: butt; 299 | } 300 | } 301 | 302 | .tunnel { 303 | ::case_11[zoom=11][sizegroup<=3], 304 | ::case_12[zoom=12][sizegroup<=4], 305 | ::case_13[zoom=13][sizegroup<=5], 306 | ::case_14[zoom=14][sizegroup<=5], 307 | ::case_15[zoom=15][sizegroup<=7], 308 | ::case_16[zoom=16][sizegroup<=7], 309 | ::case_17[zoom=17], 310 | ::case_18[zoom>=18] { 311 | line-dasharray: @tunnel_dash; 312 | } 313 | } 314 | 315 | .car { 316 | ::case_11[zoom=11][sizegroup<=3], 317 | ::case_12[zoom=12][sizegroup<=4], 318 | ::case_13[zoom=13][sizegroup<=5], 319 | ::case_14[zoom=14][sizegroup<=5], 320 | ::case_15[zoom=15][sizegroup<=7], 321 | ::case_16[zoom=16][sizegroup<=7], 322 | ::case_17[zoom=17], 323 | ::case_18[zoom>=18] { 324 | line-join: round; 325 | line-color: @ccar_case; 326 | } 327 | } 328 | 329 | .foot { 330 | ::case_11[zoom=11][sizegroup<=3], 331 | ::case_12[zoom=12][sizegroup<=4], 332 | ::case_13[zoom=13][sizegroup<=5], 333 | ::case_14[zoom=14][sizegroup<=5], 334 | ::case_15[zoom=15][sizegroup<=7], 335 | ::case_16[zoom=16][sizegroup<=7], 336 | ::case_17[zoom=17], 337 | ::case_18[zoom>=18] { 338 | line-join: round; 339 | line-color: @cfoot_case; 340 | } 341 | } 342 | 343 | .bike { 344 | ::case_11[zoom=11][sizegroup<=3], 345 | ::case_12[zoom=12][sizegroup<=4], 346 | ::case_13[zoom=13][sizegroup<=5], 347 | ::case_14[zoom=14][sizegroup<=5], 348 | ::case_15[zoom=15][sizegroup<=7], 349 | ::case_16[zoom=16][sizegroup<=7], 350 | ::case_17[zoom=17], 351 | ::case_18[zoom>=18] { 352 | line-join: round; 353 | line-color: @cbike_case; 354 | } 355 | } 356 | 357 | #bike_bridges { 358 | ::case_11[zoom=11][sizegroup=4] { line-width: @w1+@case_width; } 359 | ::case_12[zoom=12][sizegroup=5] { line-width: @w1+@case_width; } 360 | ::case_13[zoom=13][sizegroup=6] { line-width: @w1+@case_width; } 361 | ::case_14[zoom=14][sizegroup=6] { line-width: @w1+@case_width; } 362 | ::case_15[zoom=15][sizegroup=8] { line-width: @w1+@case_width; } 363 | 364 | ::case_11[zoom=11][sizegroup=5] { line-width: @w0+@case_width; } 365 | ::case_12[zoom=12][sizegroup=6] { line-width: @w0+@case_width; } 366 | ::case_13[zoom=13][sizegroup=7] { line-width: @w0+@case_width; } 367 | ::case_14[zoom=14][sizegroup=7] { line-width: @w0+@case_width; } 368 | 369 | ::case_11[zoom=11][sizegroup>=4][sizegroup<=5], 370 | ::case_12[zoom=12][sizegroup>=5][sizegroup<=6], 371 | ::case_13[zoom=13][sizegroup>=6][sizegroup<=7], 372 | ::case_14[zoom=14][sizegroup>=6][sizegroup<=7], 373 | ::case_15[zoom=15][sizegroup>=8] { 374 | line-color: @cbike_line_case; 375 | } 376 | } 377 | 378 | .way { 379 | ::case_11[zoom=11] { 380 | [sizegroup<=2] { line-width: @w3+@case_width; } 381 | [sizegroup=3] { line-width: @w2+@case_width; } 382 | } 383 | ::case_12[zoom=12] { 384 | [sizegroup<=2] { line-width: @w4+@case_width; } 385 | [sizegroup=3] { line-width: @w3+@case_width; } 386 | [sizegroup=4] { line-width: @w2+@case_width; } 387 | } 388 | ::case_13[zoom=13] { 389 | [sizegroup<=3] { line-width: @w4+@case_width; } 390 | [sizegroup=4] { line-width: @w3+@case_width; } 391 | [sizegroup=5] { line-width: @w2+@case_width; } 392 | } 393 | ::case_14[zoom=14] { 394 | [sizegroup<=2] { line-width: @w5+@case_width; } 395 | [sizegroup=3] { line-width: @w4+@case_width; } 396 | [sizegroup=4] { line-width: @w3+@case_width; } 397 | [sizegroup=5] { line-width: @w2+@case_width; } 398 | } 399 | ::case_15[zoom=15] { 400 | [sizegroup<=3] { line-width: @w7+@case_width; } 401 | [sizegroup=4] { line-width: @w5+@case_width; } 402 | [sizegroup=5] { line-width: @w4+@case_width; } 403 | [sizegroup=6] { line-width: @w3+@case_width; } 404 | [sizegroup=7] { line-width: @w2+@case_width; } 405 | } 406 | ::case_16[zoom=16] { 407 | [sizegroup<=3] { line-width: @w9+@case_width; } 408 | [sizegroup=4] { line-width: @w8+@case_width; } 409 | [sizegroup=5] { line-width: @w6+@case_width; } 410 | [sizegroup=6] { line-width: @w5+@case_width; } 411 | [sizegroup=7] { line-width: @w3+@case_width; } 412 | } 413 | ::case_17[zoom=17] { 414 | [sizegroup<=3] { line-width: @w10+@case_width; } 415 | [sizegroup=4] { line-width: @w9+@case_width; } 416 | [sizegroup=5] { line-width: @w8+@case_width; } 417 | [sizegroup>=6][sizegroup<=7] { line-width: @w6+@case_width; } 418 | [sizegroup>=8] { line-width: @w2+@case_width; } 419 | } 420 | ::case_18[zoom>=18] { 421 | [sizegroup<=3] { line-width: @w10+@case_width; } 422 | [sizegroup=4] { line-width: @w9+@case_width; } 423 | [sizegroup=5] { line-width: @w8+@case_width; } 424 | [sizegroup>=6][sizegroup<=7] { line-width: @w7+@case_width; } 425 | [sizegroup>=8] { line-width: @w4+@case_width; } 426 | } 427 | } 428 | 429 | 430 | //fill 431 | #car_tunnels { 432 | ::fill_11[zoom=11][sizegroup<=3], 433 | ::fill_12[zoom=12][sizegroup<=4], 434 | ::fill_13[zoom=13][sizegroup<=5], 435 | ::fill_14[zoom=14][sizegroup<=5], 436 | ::fill_15[zoom=15][sizegroup<=7], 437 | ::fill_16[zoom=16][sizegroup<=7], 438 | ::fill_17[zoom=17], 439 | ::fill_18[zoom>=18] { 440 | line-color: @ccar_tunnel; 441 | } 442 | } 443 | 444 | #car_grounds, 445 | #car_bridges { 446 | ::fill_11[zoom=11][sizegroup<=3], 447 | ::fill_12[zoom=12][sizegroup<=4], 448 | ::fill_13[zoom=13][sizegroup<=5], 449 | ::fill_14[zoom=14][sizegroup<=5], 450 | ::fill_15[zoom=15][sizegroup<=7], 451 | ::fill_16[zoom=16][sizegroup<=7], 452 | ::fill_17[zoom=17], 453 | ::fill_18[zoom>=18] { 454 | line-color: @ccar; 455 | } 456 | } 457 | 458 | #foot_grounds { 459 | ::fill_11[zoom=11][sizegroup<=3], 460 | ::fill_12[zoom=12][sizegroup<=4], 461 | ::fill_13[zoom=13][sizegroup<=5], 462 | ::fill_14[zoom=14][sizegroup<=5], 463 | ::fill_15[zoom=15][sizegroup<=7], 464 | ::fill_16[zoom=16][sizegroup<=7], 465 | ::fill_17[zoom=17], 466 | ::fill_18[zoom>=18] { 467 | line-color: @cfoot; 468 | } 469 | } 470 | 471 | #bike_tunnels { 472 | ::fill_11[zoom=11][sizegroup<=3], 473 | ::fill_12[zoom=12][sizegroup<=4], 474 | ::fill_13[zoom=13][sizegroup<=5], 475 | ::fill_14[zoom=14][sizegroup<=5], 476 | ::fill_15[zoom=15][sizegroup<=7], 477 | ::fill_16[zoom=16][sizegroup<=7], 478 | ::fill_17[zoom=17], 479 | ::fill_18[zoom>=18] { 480 | line-color: @cbike_tunnel; 481 | } 482 | } 483 | 484 | #bike_grounds, 485 | #bike_bridges { 486 | ::fill_11[zoom=11][sizegroup<=2], 487 | ::fill_12[zoom=12][sizegroup<=3], 488 | ::fill_13[zoom=13][sizegroup<=3], 489 | ::fill_14[zoom=14][sizegroup<=4], 490 | ::fill_15[zoom=15][sizegroup<=5], 491 | ::fill_16[zoom=16][sizegroup<=7], 492 | ::fill_17[zoom=17], 493 | ::fill_18[zoom>=18] { 494 | line-color: @cbike; 495 | } 496 | 497 | ::fill_11[zoom=11][sizegroup=3], 498 | ::fill_12[zoom=12][sizegroup=4], 499 | ::fill_13[zoom=13][sizegroup>=4][sizegroup<=5], 500 | ::fill_14[zoom=14][sizegroup=5], 501 | ::fill_15[zoom=15][sizegroup>=6][sizegroup<=7], 502 | ::fill_16[zoom=16][sizegroup=7] { 503 | line-color: @cbike_small; 504 | } 505 | } 506 | 507 | .way { 508 | ::fill_11[zoom=11][sizegroup<=3], 509 | ::fill_12[zoom=12][sizegroup<=4], 510 | ::fill_13[zoom=13][sizegroup<=5], 511 | ::fill_14[zoom=14][sizegroup<=5], 512 | ::fill_15[zoom=15][sizegroup<=7], 513 | ::fill_16[zoom=16][sizegroup<=7], 514 | ::fill_17[zoom=17], 515 | ::fill_18[zoom>=18] { 516 | line-join: round; 517 | line-cap: round; 518 | } 519 | 520 | ::fill_11[zoom=11] { 521 | [sizegroup<=2] { line-width: @w3; } 522 | [sizegroup=3] { line-width: @w2; } 523 | } 524 | ::fill_12[zoom=12] { 525 | [sizegroup<=2] { line-width: @w4; } 526 | [sizegroup=3] { line-width: @w3; } 527 | [sizegroup=4] { line-width: @w2; } 528 | } 529 | ::fill_13[zoom=13] { 530 | [sizegroup<=3] { line-width: @w4; } 531 | [sizegroup=4] { line-width: @w3; } 532 | [sizegroup=5] { line-width: @w2; } 533 | } 534 | ::fill_14[zoom=14] { 535 | [sizegroup<=2] { line-width: @w5; } 536 | [sizegroup=3] { line-width: @w4; } 537 | [sizegroup=4] { line-width: @w3; } 538 | [sizegroup=5] { line-width: @w2; } 539 | } 540 | ::fill_15[zoom=15] { 541 | [sizegroup<=3] { line-width: @w7; } 542 | [sizegroup=4] { line-width: @w5; } 543 | [sizegroup=5] { line-width: @w4; } 544 | [sizegroup=6] { line-width: @w3; } 545 | [sizegroup=7] { line-width: @w2; } 546 | } 547 | ::fill_16[zoom=16] { 548 | [sizegroup<=3] { line-width: @w9; } 549 | [sizegroup=4] { line-width: @w8; } 550 | [sizegroup=5] { line-width: @w6; } 551 | [sizegroup=6] { line-width: @w5; } 552 | [sizegroup=7] { line-width: @w3; } 553 | } 554 | ::fill_17[zoom=17] { 555 | [sizegroup<=3] { line-width: @w10; } 556 | [sizegroup=4] { line-width: @w9; } 557 | [sizegroup=5] { line-width: @w8; } 558 | [sizegroup>=6][sizegroup<=7] { line-width: @w6; } 559 | [sizegroup>=8] { line-width: @w2; } 560 | } 561 | ::fill_18[zoom>=18] { 562 | [sizegroup<=3] { line-width: @w10; } 563 | [sizegroup=4] { line-width: @w9; } 564 | [sizegroup=5] { line-width: @w8; } 565 | [sizegroup>=6][sizegroup<=7] { line-width: @w7; } 566 | [sizegroup>=8] { line-width: @w4; } 567 | } 568 | } 569 | 570 | // steps 571 | .bike[highway='steps'], 572 | .foot[highway='steps'] { 573 | ::steps_16[zoom=16], 574 | ::steps_17[zoom=17], 575 | ::steps_18[zoom>=18] { 576 | line-color: @csteps; 577 | } 578 | 579 | ::steps_16[zoom=16] { 580 | line-width: 5; 581 | line-dasharray: 1.5, 1.5; 582 | } 583 | ::steps_17[zoom=17] { 584 | line-width: 7; 585 | line-dasharray: 2,2; 586 | } 587 | ::steps_18[zoom>=18] { 588 | line-width: 9; 589 | line-dasharray: 2.5,2.5; 590 | } 591 | } 592 | -------------------------------------------------------------------------------- /project.mml: -------------------------------------------------------------------------------- 1 | { 2 | "bounds": [ 3 | -180, 4 | -85.0511, 5 | 180, 6 | 85.0511 7 | ], 8 | "center": [ 9 | 12.5, 10 | 55.67, 11 | 13 12 | ], 13 | "format": "png", 14 | "interactivity": false, 15 | "minzoom": 0, 16 | "maxzoom": 19, 17 | "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", 18 | "Stylesheet": [ 19 | "carto/settings.mss", 20 | "carto/base.mss", 21 | "carto/areas.mss", 22 | "carto/waterways.mss", 23 | "carto/ferries.mss", 24 | "carto/railways.mss", 25 | "carto/buildings.mss", 26 | "carto/routes.mss", 27 | "carto/roads.mss", 28 | "carto/cobblestones.mss", 29 | "carto/markers.mss", 30 | "carto/labels_base.mss", 31 | "carto/stations.mss", 32 | "carto/labels_areas.mss", 33 | "carto/labels_places.mss", 34 | "carto/labels_poi.mss", 35 | "carto/labels_waterways.mss", 36 | "carto/labels_roads.mss" 37 | ], 38 | "Layer": [ 39 | { 40 | "Datasource": { 41 | "file": "data/10m_land.shp" 42 | }, 43 | "geometry": "polygon", 44 | "id": "land", 45 | "name": "land" 46 | }, 47 | { 48 | "Datasource": { 49 | "file": "data/coastline-good.shp" 50 | }, 51 | "geometry": "polygon", 52 | "id": "processed_p", 53 | "name": "coastline" 54 | }, 55 | { 56 | "Datasource": { 57 | "file": "data/shoreline_300.shp" 58 | }, 59 | "geometry": "polygon", 60 | "id": "shoreline_300", 61 | "name": "shoreline" 62 | }, 63 | { 64 | "Datasource": { 65 | "dbname": "osm", 66 | "table": "(SELECT way, way_area, surface,landuse, leisure, tourism, amenity, place, aeroway, highway, area, \"natural\", barrier FROM planet_osm_polygon WHERE is_landuse=1 ORDER BY way_area DESC) AS data", 67 | "type": "postgis", 68 | "user": "osm" 69 | }, 70 | "class": "", 71 | "geometry": "polygon", 72 | "id": "landuse", 73 | "name": "landuse", 74 | "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", 75 | "srs-name": "900913" 76 | }, 77 | { 78 | "Datasource": { 79 | "dbname": "osm", 80 | "geometry_field": "way", 81 | "id": "water", 82 | "table": "(SELECT way, way_area FROM planet_osm_polygon WHERE is_waterarea=1) AS data", 83 | "type": "postgis", 84 | "user": "osm" 85 | }, 86 | "class": "", 87 | "geometry": "polygon", 88 | "id": "water", 89 | "name": "water", 90 | "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", 91 | "srs-name": "900913" 92 | }, 93 | { 94 | "Datasource": { 95 | "dbname": "osm", 96 | "geometry_field": "way", 97 | "table": "(SELECT way, waterway FROM planet_osm_line WHERE modegroup='water') AS data", 98 | "type": "postgis", 99 | "user": "osm" 100 | }, 101 | "class": "", 102 | "geometry": "linestring", 103 | "id": "waterway", 104 | "name": "waterway", 105 | "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", 106 | "srs-name": "900913" 107 | }, 108 | { 109 | "Datasource": { 110 | "dbname": "osm", 111 | "geometry_field": "way", 112 | "key_field": "", 113 | "table": "(SELECT way, way_area, building, railway, aeroway, name, area, amenity, tourism FROM planet_osm_polygon WHERE building IS NOT NULL) AS data", 114 | "type": "postgis", 115 | "user": "osm" 116 | }, 117 | "class": "", 118 | "geometry": "polygon", 119 | "id": "buildings", 120 | "name": "buildings", 121 | "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", 122 | "srs-name": "900913" 123 | }, 124 | { 125 | "Datasource": { 126 | "dbname": "osm", 127 | "geometry_field": "way", 128 | "table": "(SELECT way,name FROM planet_osm_line WHERE modegroup='ferry') AS data", 129 | "type": "postgis", 130 | "user": "osm" 131 | }, 132 | "class": "ferry", 133 | "geometry": "linestring", 134 | "id": "ferries", 135 | "name": "ferries", 136 | "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", 137 | "srs-name": "900913" 138 | }, 139 | { 140 | "Datasource": { 141 | "dbname": "osm", 142 | "geometry_field": "way", 143 | "table": "(SELECT way FROM planet_osm_line WHERE modegroup='rail' AND tunnel=0) AS data", 144 | "type": "postgis", 145 | "user": "osm" 146 | }, 147 | "class": "railway", 148 | "geometry": "linestring", 149 | "id": "railway_ground", 150 | "name": "railway_ground", 151 | "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", 152 | "srs-name": "900913" 153 | }, 154 | { 155 | "Datasource": { 156 | "dbname": "osm", 157 | "geometry_field": "way", 158 | "table": "(SELECT way FROM planet_osm_line WHERE modegroup='rail' AND tunnel=1) AS data", 159 | "type": "postgis", 160 | "user": "osm" 161 | }, 162 | "class": "railway", 163 | "geometry": "linestring", 164 | "id": "railway_tunnel", 165 | "name": "railway_tunnel", 166 | "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", 167 | "srs-name": "900913" 168 | }, 169 | { 170 | "Datasource": { 171 | "dbname": "osm", 172 | "geometry_field": "way", 173 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_roads WHERE modegroup='no' and sizegroup<=2) AS data", 174 | "type": "postgis", 175 | "user": "osm" 176 | }, 177 | "class": "", 178 | "geometry": "linestring", 179 | "id": "car_low", 180 | "name": "car_low", 181 | "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", 182 | "srs-name": "900913" 183 | }, 184 | { 185 | "Datasource": { 186 | "dbname": "osm", 187 | "geometry_field": "way", 188 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_roads WHERE modegroup='yes' and sizegroup<=2) AS data", 189 | "type": "postgis", 190 | "user": "osm" 191 | }, 192 | "class": "", 193 | "geometry": "linestring", 194 | "id": "bike_low", 195 | "name": "bike_low", 196 | "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", 197 | "srs-name": "900913" 198 | }, 199 | { 200 | "Datasource": { 201 | "dbname": "osm", 202 | "geometry_field": "way", 203 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_roads WHERE modegroup='no' AND sizegroup<=4) AS data", 204 | "type": "postgis", 205 | "user": "osm" 206 | }, 207 | "class": "", 208 | "geometry": "linestring", 209 | "id": "car_medium", 210 | "name": "car_medium", 211 | "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", 212 | "srs-name": "900913" 213 | }, 214 | { 215 | "Datasource": { 216 | "dbname": "osm", 217 | "geometry_field": "way", 218 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_roads WHERE modegroup='yes' AND sizegroup<=4) AS data", 219 | "type": "postgis", 220 | "user": "osm" 221 | }, 222 | "class": "", 223 | "geometry": "linestring", 224 | "id": "bike_medium", 225 | "name": "bike_medium", 226 | "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", 227 | "srs-name": "900913" 228 | }, 229 | { 230 | "Datasource": { 231 | "dbname": "osm", 232 | "project": "ibikecph", 233 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_line WHERE modegroup='no' AND tunnel=1 ORDER BY COALESCE(layer,0) ASC, sizegroup DESC) AS data", 234 | "type": "postgis", 235 | "user": "osm" 236 | }, 237 | "class": "way tunnel car", 238 | "geometry": "linestring", 239 | "id": "car_tunnels", 240 | "name": "car_tunnels", 241 | "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", 242 | "srs-name": "900913" 243 | }, 244 | { 245 | "Datasource": { 246 | "dbname": "osm", 247 | "project": "ibikecph", 248 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_line where modegroup='no' AND bridge=0 AND tunnel=0 ORDER BY COALESCE(layer,0) ASC, sizegroup DESC) AS data", 249 | "type": "postgis", 250 | "user": "osm" 251 | }, 252 | "class": "way car ground", 253 | "geometry": "linestring", 254 | "id": "car_grounds", 255 | "name": "car_grounds", 256 | "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", 257 | "srs-name": "900913" 258 | }, 259 | { 260 | "Datasource": { 261 | "dbname": "osm", 262 | "project": "ibikecph", 263 | "table": "(SELECT way, highway, sizegroup FROM planet_osm_line WHERE modegroup='no' AND bridge=1 ORDER BY COALESCE(layer,0) ASC, sizegroup DESC) AS data", 264 | "type": "postgis", 265 | "user": "osm" 266 | }, 267 | "class": "way car bridge", 268 | "geometry": "linestring", 269 | "id": "car_bridges", 270 | "name": "car_bridges", 271 | "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", 272 | "srs-name": "900913" 273 | }, 274 | { 275 | "Datasource": { 276 | "dbname": "osm", 277 | "project": "ibikecph", 278 | "table": "(SELECT way, highway, sizegroup, surface FROM planet_osm_line WHERE modegroup='push' AND bridge=0 AND tunnel=0 ORDER BY COALESCE(layer,0) ASC, sizegroup DESC) AS data", 279 | "type": "postgis", 280 | "user": "osm" 281 | }, 282 | "class": "way foot ground", 283 | "geometry": "linestring", 284 | "id": "foot_grounds", 285 | "name": "foot_grounds", 286 | "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", 287 | "srs-name": "900913" 288 | }, 289 | { 290 | "Datasource": { 291 | "dbname": "osm", 292 | "project": "ibikecph", 293 | "table": "(SELECT way, highway, sizegroup, surface FROM planet_osm_line WHERE (modegroup='yes' OR modegroup='push') AND tunnel=1 ORDER BY modegroup, COALESCE(layer,0) ASC, sizegroup DESC) AS data", 294 | "type": "postgis", 295 | "user": "osm" 296 | }, 297 | "class": "way bike tunnel", 298 | "geometry": "linestring", 299 | "id": "bike_tunnels", 300 | "name": "bike_tunnels", 301 | "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", 302 | "srs-name": "900913" 303 | }, 304 | { 305 | "Datasource": { 306 | "dbname": "osm", 307 | "project": "ibikecph", 308 | "table": "(SELECT way, highway, sizegroup, surface FROM planet_osm_line WHERE modegroup='yes' AND bridge=0 AND tunnel=0 ORDER BY COALESCE(layer,0) ASC, sizegroup DESC) AS data", 309 | "type": "postgis", 310 | "user": "osm" 311 | }, 312 | "class": "way bike ground", 313 | "geometry": "linestring", 314 | "id": "bike_grounds", 315 | "name": "bike_grounds", 316 | "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", 317 | "srs-name": "900913" 318 | }, 319 | { 320 | "Datasource": { 321 | "dbname": "osm", 322 | "project": "ibikecph", 323 | "table": "(SELECT way, highway, sizegroup, surface FROM planet_osm_line WHERE (modegroup='yes' OR modegroup='push') AND bridge=1 ORDER BY modegroup, COALESCE(layer,0) ASC, sizegroup DESC) AS data", 324 | "type": "postgis", 325 | "user": "osm" 326 | }, 327 | "class": "way bike bridge", 328 | "geometry": "linestring", 329 | "id": "bike_bridges", 330 | "name": "bike_bridges", 331 | "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", 332 | "srs-name": "900913" 333 | }, 334 | { 335 | "Datasource": { 336 | "dbname": "osm", 337 | "project": "ibikecph", 338 | "table": "(SELECT way, sizegroup, surface FROM planet_osm_line WHERE surface='cobblestone') AS data", 339 | "type": "postgis", 340 | "user": "osm" 341 | }, 342 | "class": "", 343 | "geometry": "linestring", 344 | "id": "cobblestones", 345 | "name": "cobblestones", 346 | "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", 347 | "srs-name": "900913" 348 | }, 349 | { 350 | "Datasource": { 351 | "dbname": "osm", 352 | "project": "ibikecph", 353 | "table": "(SELECT way, name, ref, surface, network AS network FROM planet_osm_line WHERE route='bicycle' ORDER BY modegroup, COALESCE(layer,0) ASC, sizegroup DESC) AS data", 354 | "type": "postgis", 355 | "user": "osm" 356 | }, 357 | "class": "route", 358 | "geometry": "linestring", 359 | "id": "bike_routes", 360 | "name": "bike_routes", 361 | "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", 362 | "srs-name": "900913" 363 | }, 364 | { 365 | "Datasource": { 366 | "dbname": "osm", 367 | "table": "(SELECT way,name, network, POSITION('metro' in LOWER(COALESCE(network,'')))>0 AS metro, POSITION('s-tog' in LOWER(COALESCE(network,'')))>0 AS stog FROM planet_osm_polygon WHERE railway='station' AND name IS NOT NULL) AS data", 368 | "type": "postgis", 369 | "user": "osm" 370 | }, 371 | "class": "stations", 372 | "geometry": "polygon", 373 | "id": "station_polygons", 374 | "name": "station_polygons", 375 | "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", 376 | "srs-name": "900913" 377 | }, 378 | { 379 | "Datasource": { 380 | "dbname": "osm", 381 | "table": "(SELECT way,name, network, POSITION('metro' in LOWER(COALESCE(network,'')))>0 AS metro, POSITION('s-tog' in LOWER(COALESCE(network,'')))>0 AS stog FROM planet_osm_point WHERE railway='station' AND name IS NOT NULL) AS data", 382 | "type": "postgis", 383 | "user": "osm" 384 | }, 385 | "class": "stations", 386 | "geometry": "point", 387 | "id": "station_nodes", 388 | "name": "station_nodes", 389 | "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", 390 | "srs-name": "900913" 391 | }, 392 | { 393 | "Datasource": { 394 | "dbname": "osm", 395 | "table": "(SELECT way,placegroup,name,place,population,\"natural\" FROM planet_osm_point WHERE placegroup IS NOT NULL AND name IS NOT NULL ORDER BY placegroup ASC, population DESC NULLS LAST) AS data", 396 | "type": "postgis", 397 | "user": "osm" 398 | }, 399 | "class": "", 400 | "geometry": "point", 401 | "id": "place", 402 | "name": "place", 403 | "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", 404 | "srs-name": "900913" 405 | }, 406 | { 407 | "Datasource": { 408 | "dbname": "osm", 409 | "table": "(SELECT way, way_area, place, name, landuse, amenity, \"natural\", leisure FROM planet_osm_polygon WHERE name IS NOT NULL AND boundary IS NULL ORDER BY way_area DESC) AS data", 410 | "type": "postgis", 411 | "user": "osm" 412 | }, 413 | "geometry": "point", 414 | "class": "", 415 | "id": "area_label", 416 | "name": "area_label", 417 | "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", 418 | "srs-name": "900913" 419 | }, 420 | { 421 | "Datasource": { 422 | "dbname": "osm", 423 | "table": "(SELECT way, highway, name, place, barrier FROM planet_osm_point WHERE barrier IS NOT NULL or highway IS NOT NULL) AS data", 424 | "type": "postgis", 425 | "user": "osm" 426 | }, 427 | "class": "", 428 | "geometry": "point", 429 | "id": "poi", 430 | "name": "poi", 431 | "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", 432 | "srs-name": "900913" 433 | }, 434 | { 435 | "Datasource": { 436 | "dbname": "osm", 437 | "project": "ibikecph", 438 | "table": "(SELECT way, name, ref, network AS network FROM planet_osm_line WHERE route='bicycle' ORDER BY modegroup, COALESCE(layer,0) ASC, sizegroup DESC) AS data", 439 | "type": "postgis", 440 | "user": "osm" 441 | }, 442 | "class": "", 443 | "geometry": "linestring", 444 | "id": "route_labels", 445 | "name": "route_labels", 446 | "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", 447 | "srs-name": "900913" 448 | }, 449 | { 450 | "Datasource": { 451 | "dbname": "osm", 452 | "table": "(SELECT way, highway, sizegroup, modegroup, name, ref, oneway, CHAR_LENGTH(ref) AS reflen FROM planet_osm_line WHERE (modegroup='yes' OR modegroup='push') AND (name IS NOT NULL OR ref IS NOT NULL) ORDER BY sizegroup, ST_Length(way) DESC) AS data", 453 | "type": "postgis", 454 | "user": "osm" 455 | }, 456 | "class": "", 457 | "id": "way_label_bike", 458 | "name": "way_label_bike", 459 | "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", 460 | "srs-name": "900913" 461 | }, 462 | { 463 | "Datasource": { 464 | "dbname": "osm", 465 | "table": "(SELECT way, waterway, name FROM planet_osm_line WHERE waterway IS NOT NULL AND name IS NOT NULL) AS data", 466 | "type": "postgis", 467 | "user": "osm" 468 | }, 469 | "class": "", 470 | "geometry": "linestring", 471 | "id": "waterway_label", 472 | "name": "waterway_label", 473 | "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", 474 | "srs-name": "900913" 475 | } 476 | ], 477 | "scale": 1, 478 | "metatile": 8, 479 | "attribution": "Copyright © City of Copenhagen. Data © OpenStreetMap (and) contributors, CC-BY-SA", 480 | "description": "Bicycle Map used in the I Bike CPH navigation service.", 481 | "name": "I Bike CPH" 482 | } -------------------------------------------------------------------------------- /tools/import.lua: -------------------------------------------------------------------------------- 1 | -- osm2pgsql lua docs: http://lists.openstreetmap.org/pipermail/dev/2013-May/026933.html 2 | 3 | function Set (list) 4 | local set = {} 5 | for _, l in ipairs(list) do set[l] = true end 6 | return set 7 | end 8 | 9 | polygon_tags = { 10 | 'landuse', 'amenity', 'historic', 'leisure', 'natural', 'place', 'shop', 11 | 'tourism', 'waterway', 'water', 'building', 'wetland', 'sport', 'public_transport', 12 | 'harbour', 'office', 'power', 'man_made', 'military', 'aeroway' 13 | } 14 | 15 | polygon_keys = { 'building', 'landuse', 'amenity', 'harbour', 'historic', 'leisure', 16 | 'man_made', 'military', 'natural', 'office', 'place', 'power', 17 | 'public_transport', 'shop', 'sport', 'tourism', 'waterway', 18 | 'wetland', 'water', 'aeroway' } 19 | 20 | generic_keys = {'access','addr:housename','addr:housenumber','addr:interpolation','admin_level','aerialway','aeroway','amenity','area','barrier', 21 | 'bicycle','brand','bridge','boundary','building','capital','construction','covered','culvert','cutting','denomination','disused','ele', 22 | 'embarkment','foot','generation:source','harbour','highway','historic','hours','intermittent','junction','landuse','layer','leisure','lock', 23 | 'man_made','military','motor_car','name','natural','office','oneway','operator','place','poi','population','power','power_source','public_transport', 24 | 'railway','ref','religion','route','service','shop','sport','surface','toll','tourism','tower:type', 'tracktype','tunnel','water','waterway', 25 | 'wetland','width','wood','type','townhall','museum'} 26 | 27 | cycle_highways={ footway=true, track=true, path=true, cycleway=true, bridleway=true } 28 | designations = { public_bridleway=true, byway_open_to_all_traffic=true, restricted_byway=true, public_byway=true, permissive_bridleway=true, bridleway=true, byway=true, public_cycleway=true } 29 | surfaces = { asphalt=1, paved=1, concrete=1, tarmac=1, paving_stones=1, 30 | compacted=2, gravel=2, 31 | ground=3, earth=3, cobblestone=3, grass=3, unpaved=3, dirt=3, sand=3, 32 | grade1=2, grade2=2, grade3=3, grade4=3, grade5=3 } 33 | cycle_tags = { 'cycle_solid', 'cycle_gravel', 'cycle_bumpy' } 34 | waterway_tags= { basin=true, canal=true, dock=true, mill_pond=true, pond=true, riverbank=true, stream=true } 35 | leisure_tags = { common=true, golf_course=true, park=true, pitch=true, sports_centre=true, stadium=true } 36 | 37 | yes_values = Set { 'yes', '1', 'true' } 38 | no_values = Set { 'no', '0', 'false' } 39 | 40 | aeroway_areas = Set { 41 | 'aerodrome', 42 | 'helipad', 43 | 'apron', 44 | 'hangar', 45 | 'runway', 46 | 'terminal' 47 | } 48 | 49 | aeroways = Set { 50 | 'runway', 51 | 'taxiway' 52 | } 53 | railways = Set { 54 | 'rail', 55 | 'tram', 56 | 'light_rail', 57 | 'subway', 58 | 'narrow_gauge', 59 | 'preserved', 60 | 'funicular', 61 | 'monorail' 62 | } 63 | 64 | waterways = Set { 65 | 'canal', 66 | 'river', 67 | 'stream', 68 | 'drain', 69 | 'ditch' 70 | } 71 | 72 | function unify(v) 73 | if yes_values[v] then 74 | return 1 75 | end 76 | return 0 77 | end 78 | 79 | function in_set(v,values) 80 | if values[v] then 81 | return true 82 | end 83 | return false 84 | end 85 | 86 | function sizegroup(tag) 87 | rank = { 88 | ['motorway'] = 0, 89 | ['runway'] = 0, 90 | ['trunk'] = 1, 91 | ['primary'] = 2, 92 | ['secondary'] = 3, 93 | ['tertiary'] = 4, 94 | ['motorway_link'] = 4, 95 | ['trunk_link'] = 4, 96 | ['primary_link'] = 4, 97 | ['secondary_link'] = 4, 98 | ['unclassified'] = 5, 99 | ['tertiary_link'] = 5, 100 | ['taxiway'] = 5, 101 | ['residential'] = 6, 102 | ['living_street'] = 6, 103 | ['pedestrian'] = 7, 104 | ['cycleway'] = 7, 105 | ['service'] = 7, 106 | ['footway'] = 8, 107 | ['path'] = 8, 108 | ['track'] = 8, 109 | ['road'] = 8, 110 | ['minor'] = 8, 111 | ['bridleway'] = 8 112 | } 113 | 114 | default = 8 115 | 116 | if tag and tag ~= "" then 117 | return rank[tag] or default 118 | else 119 | return default 120 | end 121 | end 122 | 123 | function modegroup(tags) 124 | -- Mode field, based on highway types and various other tags. 125 | -- 126 | -- yes: you can bike 127 | -- push: you can push your bike 128 | -- no: you cannot ride or push a bike. includes both motorways and some paths in ex park 129 | -- rail: railways 130 | -- water: waterways 131 | 132 | 133 | if railways[tags['railway']] then 134 | return 'rail' 135 | end 136 | 137 | if tags['route']=='ferry' then 138 | return 'ferry' 139 | end 140 | 141 | if waterways[tags['waterway']] then 142 | return 'water' 143 | end 144 | 145 | bikeable = Set { 146 | 'cycleway', 147 | 'path', 148 | 'track', 149 | 'minor', 150 | 'road', 151 | 'living_street', 152 | 'service', 153 | 'unclassified', 154 | 'residential', 155 | 'tertiary_link', 156 | 'tertiary', 157 | 'secondary_link', 158 | 'secondary', 159 | 'primary_link', 160 | 'primary' 161 | } 162 | 163 | pushable = Set {'footway','pedestrian','steps'} 164 | access_no = Set {'no','private','agricultural','forestery'} 165 | access_yes = Set {'yes','permissive','designated'} 166 | tracks_lanes = Set {'lane','track','opposite_lane','opposite_track' } 167 | foot_yes = Set {'yes','permissive','designated'} 168 | amenity_yes = Set {'parking','parking_entrance'} 169 | 170 | 171 | 172 | access = tags['bicycle'] or tags['access'] 173 | 174 | -- access tag 175 | if access_no[access] then 176 | return 'no' 177 | end 178 | 179 | if access_yes[access] then 180 | return 'yes' 181 | end 182 | 183 | 184 | -- forbidden 185 | if tags['highway']=='construction' or tags['railway']=='construction' then 186 | return 'no' 187 | end 188 | 189 | cars_only = Set { 190 | 'motorway', 191 | 'motorway_link', 192 | 'trunk', 193 | 'trunk_link', 194 | 'construction', 195 | 'bridleway' 196 | } 197 | if cars_only[tags['highway']] then 198 | return 'no' 199 | end 200 | 201 | if tags['access']=='private' then 202 | return 'no' 203 | end 204 | 205 | if aeroways[tags['aeroway']] then 206 | return 'no' 207 | end 208 | 209 | -- ridable 210 | if bikeable[tags['highway']] then 211 | return 'yes' 212 | end 213 | 214 | if amenity_yes[tags['amenity']] then 215 | return 'yes' 216 | end 217 | 218 | if tracks_lanes[tags['cycleway']] or 219 | tracks_lanes[tags['cycleway:left']] or 220 | tracks_lanes[tags['cycleway:right']] then 221 | return 'yes' 222 | end 223 | 224 | -- pushable 225 | if pushable[tags['highway']] or 226 | tags['man_made']=='pier' or 227 | tags['railway']=='platform' or 228 | tags['public_transport']=='platform' or 229 | foot_yes[tags['foot']] then 230 | return 'push' 231 | end 232 | 233 | -- unknown, don't show 234 | return nil 235 | end 236 | 237 | function placegroup(tags) 238 | if tags['place'] then 239 | if tags['population'] then 240 | population = tonumber(tags['population']) 241 | if population>=1638400 then 242 | return 0 243 | elseif population>=409600 and population<1638400 then 244 | return 1 245 | elseif population>=102400 and population<409600 then 246 | return 2 247 | elseif population>=25600 and population<102400 then 248 | return 3 249 | elseif population>=6400 and population<25600 then 250 | return 4 251 | elseif population>=1600 and population<6400 then 252 | return 5 253 | elseif population>=400 and population<1600 then 254 | return 6 255 | elseif population>=100 and population<400 then 256 | return 7 257 | elseif population>=0 and population<100 then 258 | return 8 259 | end 260 | else 261 | place = tags['place'] 262 | if place=='country' then 263 | return 0 264 | elseif false then 265 | return 1 266 | elseif place=='city' or tags['natural']=='wood' then 267 | return 2 268 | elseif false then 269 | return 3 270 | elseif place=='town' then 271 | return 4 272 | elseif place=='suburb' or place=='locality' then 273 | return 5 274 | elseif place=='neighbourhood' then 275 | return 6 276 | elseif place=='village' then 277 | return 7 278 | elseif place=='hamlet' then 279 | return 8 280 | end 281 | end 282 | 283 | else 284 | return nil 285 | end 286 | end 287 | 288 | function filter_tags_node (tags, nokeys) 289 | if nokeys==0 then 290 | return 1, {} 291 | end 292 | 293 | tags["FIXME"] = nil 294 | tags["note"] = nil 295 | tags["source"] = nil 296 | tags['placegroup'] = placegroup(tags) 297 | 298 | return 0, tags 299 | end 300 | 301 | function filter_basic_tags_rel (tags, nokeys) 302 | filter = 0 303 | tagcount = 0 304 | for i,v in pairs(tags) do tagcount = tagcount + 1 end 305 | if tagcount == 0 then 306 | filter = 1 307 | return filter, tags 308 | end 309 | 310 | tags["FIXME"] = nil 311 | tags["note"] = nil 312 | tags["source"] = nil 313 | 314 | if ((tags["type"] ~= "route") and (tags["type"] ~= "multipolygon") and (tags["type"] ~= "boundary")) then 315 | filter = 1 316 | return filter, tags 317 | end 318 | 319 | return filter, tags 320 | end 321 | 322 | function is_waterarea(tags) 323 | waterway = Set { 324 | 'riverbank' 325 | } 326 | if waterway[tags['waterway']] then 327 | return 1 328 | end 329 | 330 | natural = Set { 331 | 'water' 332 | } 333 | if natural[tags['natural']] then 334 | return 1 335 | end 336 | 337 | landuse = Set { 338 | 'basin', 339 | 'reservoir' 340 | } 341 | if landuse[tags['landuse']] then 342 | return 1 343 | end 344 | 345 | return 0 346 | end 347 | 348 | function is_landuse(tags) 349 | landuse = Set { 350 | 'park', 351 | 'forest', 352 | 'residential', 353 | 'retail', 354 | 'commercial', 355 | 'industrial', 356 | 'military', 357 | 'railway', 358 | 'cemetery', 359 | 'grass', 360 | 'field', 361 | 'pasture', 362 | 'farmyard', 363 | 'farm', 364 | 'farmland', 365 | 'farmyard', 366 | 'orchard', 367 | 'vineyard', 368 | 'meadow', 369 | 'village_green', 370 | 'recreation_ground', 371 | 'allotments', 372 | 'quarry', 373 | 'reservoir', 374 | 'construction' 375 | } 376 | if landuse[tags['landuse']] then 377 | return 1 378 | end 379 | 380 | leisure = Set { 381 | 'park', 382 | 'garden', 383 | 'playground', 384 | 'recreation_ground', 385 | 'golf_course', 386 | 'sports_centre', 387 | 'pitch', 388 | 'stadium', 389 | 'common', 390 | 'nature_reserve' 391 | } 392 | if leisure[tags['leisure']] then 393 | return 1 394 | end 395 | 396 | natural = Set { 397 | 'wood', 398 | 'land', 399 | 'scrub', 400 | 'wetland', 401 | 'beach', 402 | 'sand', 403 | 'bare_rock', 404 | 'fell', 405 | 'heath', 406 | 'mud', 407 | 'bay', 408 | 'scree' 409 | } 410 | if natural[tags['natural']] then 411 | return 1 412 | end 413 | 414 | tourism = Set { 415 | 'zoo' 416 | } 417 | if tourism[tags['tourism']] then 418 | return 1 419 | end 420 | 421 | highway = Set { 422 | 'pedestrian', 423 | 'footway' 424 | } 425 | if highway[tags['highway']] then 426 | return 1 427 | end 428 | 429 | amenity = Set { 430 | 'university', 431 | 'school', 432 | 'college', 433 | 'library', 434 | 'fuel', 435 | 'parking', 436 | 'cinema', 437 | 'theatre', 438 | 'place_of_worship', 439 | 'hospital', 440 | 'grave_yard' 441 | } 442 | if amenity[tags['amenity']] then 443 | return 1 444 | end 445 | 446 | place = { 447 | 'island' 448 | } 449 | if place[tags['place']] then 450 | return 1 451 | end 452 | 453 | if aeroway_areas[tags['aeroway']] then 454 | return 1 455 | end 456 | 457 | return 0 458 | end 459 | 460 | function add_z_order(keyvalues) 461 | z_order = 0 462 | if (keyvalues["layer"] ~= nil ) then 463 | z_order = 10*keyvalues["layer"] 464 | end 465 | 466 | 467 | zordering_tags = {{ 'railway', nil, 5, 1}, { 'boundary', 'administrative', 0, 1}, 468 | { 'bridge', 'yes', 10, 0 }, { 'bridge', 'true', 10, 0 }, { 'bridge', 1, 10, 0 }, 469 | { 'tunnel', 'yes', -10, 0}, { 'tunnel', 'true', -10, 0}, { 'tunnel', 1, -10, 0}, 470 | { 'highway', 'minor', 3, 0}, { 'highway', 'road', 3, 0 }, { 'highway', 'unclassified', 3, 0 }, 471 | { 'highway', 'residential', 3, 0 }, { 'highway', 'tertiary_link', 4, 0}, { 'highway', 'tertiary', 4, 0}, 472 | { 'highway', 'secondary_link', 6, 1}, { 'highway', 'secondary', 6, 1}, 473 | { 'highway', 'primary_link', 7, 1}, { 'highway', 'primary', 7, 1}, 474 | { 'highway', 'trunk_link', 8, 1}, { 'highway', 'trunk', 8, 1}, 475 | { 'highway', 'motorway_link', 9, 1}, { 'highway', 'motorway', 9, 1}, 476 | } 477 | 478 | for i,k in ipairs(zordering_tags) do 479 | if ((k[2] and keyvalues[k[1]] == k[2]) or (k[2] == nil and keyvalues[k[1]] ~= nil)) then 480 | if (k[4] == 1) then 481 | roads = 1 482 | end 483 | z_order = z_order + k[3] 484 | end 485 | end 486 | 487 | keyvalues["z_order"] = z_order 488 | 489 | return keyvalues, roads 490 | end 491 | 492 | function compute_oneway(tags) 493 | oneway = tags["oneway"] 494 | oneway_bicycle = tags["oneway:bicycle"] 495 | junction = tags["junction"] 496 | highway = tags["highway"] 497 | implied_oneway = 0 498 | 499 | if junction=="roundabout" or highway=="motorway_link" or highway=="motorway" then 500 | implied_oneway = 1 501 | end 502 | 503 | if not oneway and not oneway_bicycle then 504 | return implied_oneway 505 | end 506 | 507 | if in_set(oneway_bicycle,yes_values) then 508 | return 1 509 | elseif in_set(oneway_bicycle,no_values) then 510 | return 0 511 | elseif oneway_bicycle == '-1' then 512 | return -1 513 | elseif in_set(oneway,no_values) then 514 | return 0 515 | end 516 | 517 | cycleway = tags["cycleway"] 518 | cycleway_left = tags["cycleway:left"] 519 | cycleway_right = tags["cycleway:right"] 520 | cycleways_forward = Set {'track','lane'} 521 | cycleways_backward = Set {'opposite','opposite_track','opposite_lane'} 522 | 523 | if in_set(cycleway,cycleways_backward) then 524 | if implied_oneway==1 then 525 | return -1 526 | else 527 | return 0 528 | end 529 | elseif in_set(cycleway_left,cycleways_forward) and in_set(cycleway_right,cycleways_forward) then 530 | return 0 531 | elseif in_set(cycleway_left,cycleways_forward) then 532 | if implied_oneway==1 then 533 | return -1 534 | else 535 | return 0 536 | end 537 | elseif in_set(cycleway_right,cycleways_forward) then 538 | if implied_oneway==1 then 539 | return 1 540 | else 541 | return 1 -- TODO is this correct? 542 | end 543 | elseif oneway == '-1' then 544 | return -1 545 | elseif in_set(oneway,yes_values) then 546 | return 1 547 | end 548 | 549 | return 0 550 | end 551 | 552 | function filter_tags_relation_member (keyvalues, keyvaluemembers, roles, membercount) 553 | filter = 0 554 | boundary = 0 555 | polygon = 0 556 | roads = 0 557 | membersuperseeded = {} 558 | for i = 1, membercount do 559 | membersuperseeded[i] = 1 560 | end 561 | 562 | type = keyvalues["type"] 563 | keyvalues["type"] = nil 564 | 565 | if (type == "boundary") then 566 | boundary = 1 567 | end 568 | if ((type == "multipolygon") and keyvalues["boundary"]) then 569 | boundary = 1 570 | elseif (type == "multipolygon") then 571 | polygon = 1 572 | polytagcount = 0 573 | for i,k in ipairs(polygon_keys) do 574 | if keyvalues[k] then 575 | polytagcount = polytagcount + 1 576 | end 577 | end 578 | 579 | -- copy tags from members 580 | for i = 1,membercount do 581 | if (roles[i] == "outer") then 582 | for k,v in pairs(keyvaluemembers[i]) do 583 | keyvalues[k] = v 584 | end 585 | end 586 | end 587 | 588 | -- TODO if an inner member in a multipolygon has tags that are not in the relation, 589 | -- then we should probably retain it, which seems to be what this code is doing: 590 | --for i = 1,membercount do 591 | -- for k,v in pairs(keyvaluemembers[i]) do 592 | -- if ((keyvalues[k] == nil) or (keyvalues[k] ~= v)) then 593 | -- for j,k2 in ipairs(generic_keys) do 594 | -- if (k == k2) then 595 | -- membersuperseeded[i] = 0 596 | -- break 597 | -- end 598 | -- end 599 | -- end 600 | -- end 601 | --end 602 | 603 | keyvalues['is_landuse'] = is_landuse(keyvalues) 604 | keyvalues['is_waterarea'] = is_waterarea(keyvalues) 605 | -- elseif (type == "route") then 606 | -- if keyvalues["route"] == 'bicycle' then 607 | -- end 608 | end 609 | 610 | -- keyvalues, roads = add_z_order(keyvalues) 611 | 612 | return filter, keyvalues, membersuperseeded, boundary, polygon, roads 613 | end 614 | 615 | function filter_tags_generic(keyvalues, nokeys) 616 | filter = 0 617 | tagcount = 0 618 | 619 | if nokeys == 0 then 620 | filter = 1 621 | return filter, keyvalues 622 | end 623 | 624 | delete_tags = { 'FIXME', 'note', 'source', 'description' } 625 | 626 | for i,k in ipairs(delete_tags) do 627 | keyvalues[k] = nil 628 | end 629 | 630 | for k,v in pairs(keyvalues) do 631 | for i, k2 in ipairs(generic_keys) do if k2 == k then tagcount = tagcount + 1; end end 632 | end 633 | if tagcount == 0 then 634 | filter = 1 635 | end 636 | 637 | return filter, keyvalues 638 | end 639 | 640 | function filter_tags_way (keyvalues, nokeys) 641 | -- The first return value is filter, a flag which you should set to 1 if the way/node/relation 642 | -- should be filtered out and not added to the database, 0 otherwise. 643 | -- (They will still end up in the slim mode tables, but not in the rendering tables) 644 | 645 | -- The second return value is tags, a transformed (or unchanged) set of tags. 646 | 647 | -- filter_tags_way returns two additional flags. poly should be 1 if the way should 648 | -- be treated as a polygon, 0 as a line. roads should be 1 if the way should be added 649 | -- to the planet_osm_roads table, 0 otherwise. 650 | 651 | filter = 0 652 | poly = 0 653 | tagcount = 0 654 | roads = 0 655 | 656 | 657 | filter, keyvalues = filter_tags_generic(keyvalues, nokeys) 658 | if filter == 1 then 659 | return filter, keyvalues, poly, roads 660 | end 661 | 662 | 663 | if yes_values[keyvalues["area"]] then 664 | poly = 1 665 | elseif no_values[keyvalues["area"]] then 666 | poly = 0 667 | else 668 | for i,k in ipairs(polygon_keys) do 669 | if keyvalues[k] then 670 | poly=1 671 | break 672 | end 673 | end 674 | end 675 | 676 | -- determine mode 677 | keyvalues['modegroup'] = modegroup(keyvalues) 678 | 679 | -- filter away unroutable lines like fences, etc 680 | if poly==0 and keyvalues['modegroup']==nil then 681 | return 1, keyvalues, poly, roads 682 | end 683 | 684 | 685 | -- filter out unwanted lines 686 | --if (not tags['highway'] or tags['highway'] == '') and 687 | -- (not tags['route'] or tags['route'] == '') and 688 | -- (not tags['railway'] or tags['railway']=='') and 689 | -- (not tags['amenity'] or tags['amenity']=='') and 690 | -- (not tags['man_made'] or tags['man_made']=='') and 691 | -- (not tags['public_transport'] or tags['public_transport']=='') 692 | -- then 693 | -- return 1, [], 0, 0 694 | --end 695 | 696 | -- determine landuses and waterareas 697 | if poly==1 then 698 | keyvalues['is_landuse'] = is_landuse(keyvalues) 699 | keyvalues['is_waterarea'] = is_waterarea(keyvalues) 700 | end 701 | -- determine mode 702 | keyvalues['sizegroup'] = sizegroup(keyvalues['highway'] or keyvalues['aeroway']) 703 | 704 | -- determine oneway 705 | keyvalues['oneway'] = compute_oneway(keyvalues) 706 | 707 | -- unify tunnel and bridge tags 708 | keyvalues['tunnel'] = unify(keyvalues['tunnel']) 709 | keyvalues['bridge'] = unify(keyvalues['bridge']) 710 | 711 | --keyvalues, roads = add_z_order(keyvalues) 712 | 713 | -- place big roads in low-zoom 'planet_osm_roads' table 714 | if keyvalues['sizegroup'] <= 4 then 715 | roads = 1 716 | end 717 | 718 | return filter, keyvalues, poly, roads 719 | end 720 | -------------------------------------------------------------------------------- /img/shields.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 20 | 45 | 52 | 53 | 55 | 56 | 58 | image/svg+xml 59 | 61 | 62 | 63 | 64 | 65 | 70 | 80 | 90 | 100 | 110 | 120 | 130 | 136 | 146 | 156 | 166 | 176 | 186 | Trunk 197 | Primary 208 | Secondary 219 | Motorway 231 | 241 | 251 | 261 | 271 | 281 | 291 | 297 | 307 | 317 | 327 | 337 | 347 | 357 | 367 | 377 | 387 | 397 | 407 | 417 | 427 | 428 | 722 | 723 | --------------------------------------------------------------------------------