From 3eaf7c41a3212e8a14721aaa0f9e46ce22bacbb0 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Tue, 16 Feb 2016 23:08:12 -0800 Subject: [PATCH 01/11] Reformat road SQL --- project.mml | 10 +++---- project.yaml | 83 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 57 insertions(+), 36 deletions(-) diff --git a/project.mml b/project.mml index 2912f08e4a..3c115308d5 100644 --- a/project.mml +++ b/project.mml @@ -587,7 +587,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', \n 'grass_paver', 'gravel', 'ground', 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE \n CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', \n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' \n ELSE null END END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS tunnels", + "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes')\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS tunnels", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -821,7 +821,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', \n 'grass_paver', 'gravel', 'ground', 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE \n CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', \n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' \n ELSE null END END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_casing", + "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_casing", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -873,7 +873,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', \n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE \n CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', \n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' \n ELSE null END END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_fill", + "table": "(SELECT\n way,\n (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n int_surface,\n access,\n construction,\n service,\n oneway,\n link,\n layernotnull\n FROM ( -- begin \"features\" subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, -- only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null' AS surface, -- Should be a SQL NULL?\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE (tunnel IS NULL OR NOT tunnel IN ('yes', 'building_passage'))\n AND (covered IS NULL OR NOT covered = 'yes')\n AND (bridge IS NULL OR NOT bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct'))\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS roads_fill", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -951,7 +951,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n COALESCE(\n ('highway_' || (CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway end)),\n ('railway_' || (CASE WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN railway IN ('rail', 'tram', 'light_rail', 'funicular', 'narrow_gauge') THEN railway ELSE NULL END))\n ) AS feature,\n CASE WHEN tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes' THEN 'yes' ELSE 'no' END AS int_tunnel,\n CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes' ELSE 'no' END AS link,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', \n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE \n CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', \n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' \n ELSE null END END AS int_surface\n FROM planet_osm_roads\n WHERE highway IS NOT NULL\n OR (railway IS NOT NULL AND railway != 'preserved'\n AND (service IS NULL OR service NOT IN ('spur', 'siding', 'yard')))\n ORDER BY z_order\n) AS roads_low_zoom", + "table": "(SELECT\n way,\n COALESCE(\n ('highway_' || (CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN substr(highway, 0, length(highway)-4) ELSE highway end)),\n ('railway_' || (CASE WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN railway IN ('rail', 'tram', 'light_rail', 'funicular', 'narrow_gauge') THEN railway ELSE NULL END))\n ) AS feature,\n CASE WHEN tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes' THEN 'yes' ELSE 'no' END AS int_tunnel,\n CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes' ELSE 'no' END AS link,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface\n FROM planet_osm_roads\n WHERE highway IS NOT NULL\n OR (railway IS NOT NULL AND railway != 'preserved'\n AND (service IS NULL OR service NOT IN ('spur', 'siding', 'yard')))\n ORDER BY z_order\n) AS roads_low_zoom", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1004,7 +1004,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', \n 'ground', 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE \n CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', \n 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' \n ELSE null END END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS bridges", + "table": "(SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature,\n horse, foot, bicycle, tracktype, int_surface, access, construction,\n service, oneway, link, layernotnull\n FROM ( -- subselect that contains both roads and rail/aero\n SELECT\n way,\n ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on\n horse,\n foot,\n bicycle,\n tracktype,\n CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground',\n 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved'\n WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes',\n 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved'\n ELSE NULL\n END AS int_surface,\n CASE WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE\n WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text\n ELSE 'INT-normal'::text\n END AS service,\n CASE\n WHEN oneway IN ('yes', '-1') THEN oneway\n WHEN junction IN ('roundabout') AND (oneway IS NULL OR NOT oneway IN ('no', 'reversible')) THEN 'yes'\n ELSE NULL\n END AS oneway,\n CASE\n WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes'\n ELSE 'no'\n END AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')\n AND highway IS NOT NULL -- end of road select\n UNION ALL\n SELECT\n way,\n COALESCE(\n ('railway_' || (CASE WHEN railway = 'preserved' AND service IN ('spur', 'siding', 'yard') THEN 'INT-preserved-ssy'::text \n WHEN (railway = 'rail' AND service IN ('spur', 'siding', 'yard')) THEN 'INT-spur-siding-yard' \n WHEN (railway = 'tram' AND service IN ('spur', 'siding', 'yard')) THEN 'tram-service' ELSE railway END)),\n ('aeroway_' || aeroway)\n ) AS feature,\n horse,\n foot,\n bicycle,\n tracktype,\n 'null',\n CASE\n WHEN access IN ('destination') THEN 'destination'::text\n WHEN access IN ('no', 'private') THEN 'no'::text\n ELSE NULL\n END AS access,\n construction,\n CASE WHEN service IN ('parking_aisle', 'drive-through', 'driveway') THEN 'INT-minor'::text ELSE 'INT-normal'::text END AS service,\n NULL AS oneway,\n 'no' AS link,\n CASE WHEN layer~E'^-?\\\\d+$' AND length(layer)<10 THEN layer::integer ELSE 0 END AS layernotnull\n FROM planet_osm_line\n WHERE bridge IN ('yes', 'boardwalk', 'cantilever', 'covered', 'low_water_crossing', 'movable', 'trestle', 'viaduct')\n AND (railway IS NOT NULL OR aeroway IS NOT NULL) -- end of rail/aero select\n ) AS features\n JOIN (VALUES -- this join is also putting a condition on what is selected. features not matching it do not make it into the results.\n ('railway_rail', 440),\n ('railway_INT-preserved-ssy', 430),\n ('railway_INT-spur-siding-yard', 430),\n ('railway_subway', 420),\n ('railway_narrow_gauge', 420),\n ('railway_light_rail', 420),\n ('railway_preserved', 420),\n ('railway_funicular', 420),\n ('railway_monorail', 420),\n ('railway_miniature', 420),\n ('railway_turntable', 420),\n ('railway_tram', 410),\n ('railway_tram-service', 405),\n ('railway_disused', 400),\n ('railway_construction', 400),\n ('highway_motorway', 380),\n ('highway_trunk', 370),\n ('highway_primary', 360),\n ('highway_secondary', 350),\n ('highway_tertiary', 340),\n ('highway_residential', 330),\n ('highway_unclassified', 330),\n ('highway_road', 330),\n ('highway_living_street', 320),\n ('highway_pedestrian', 310),\n ('highway_raceway', 300),\n ('highway_motorway_link', 240),\n ('highway_trunk_link', 230),\n ('highway_primary_link', 220),\n ('highway_secondary_link', 210),\n ('highway_tertiary_link', 200),\n ('highway_service', 150),\n ('highway_track', 110),\n ('highway_path', 100),\n ('highway_footway', 100),\n ('highway_bridleway', 100),\n ('highway_cycleway', 100),\n ('highway_steps', 100),\n ('highway_platform', 90),\n ('railway_platform', 90),\n ('aeroway_runway', 60),\n ('aeroway_taxiway', 50),\n ('highway_construction', 10)\n ) AS ordertable (feature, prio)\n USING (feature)\n ORDER BY\n layernotnull,\n prio,\n CASE WHEN access IN ('no', 'private') THEN 0 WHEN access IN ('destination') THEN 1 ELSE 2 END,\n CASE WHEN int_surface IN ('unpaved') THEN 0 ELSE 2 END\n) AS bridges", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index a2ecd19210..35716d5553 100644 --- a/project.yaml +++ b/project.yaml @@ -508,11 +508,12 @@ Layer: foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', - 'grass_paver', 'gravel', 'ground', 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE - CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' - ELSE null END END AS int_surface, + CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', + 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' + ELSE NULL + END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text ELSE NULL @@ -792,11 +793,12 @@ Layer: foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', - 'grass_paver', 'gravel', 'ground', 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE - CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' - ELSE null END END AS int_surface, + CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', + 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' + ELSE NULL + END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text ELSE NULL @@ -938,23 +940,40 @@ Layer: <<: *extents Datasource: <<: *osm2pgsql + # This is one of the most complex layers, so it bears explaining in some detail + # It is necessary to + # - Have roads and railways in the same layer to get ordering right + # - Return two linestrings for ways which are both a road and railway + # - Compute z_order here, rather than rely on osm2pgsql z_order table: |- - (SELECT way, (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, - horse, foot, bicycle, tracktype, int_surface, access, construction, - service, oneway, link, layernotnull - FROM ( -- subselect that contains both roads and rail/aero + (SELECT + way, + (CASE WHEN substr(feature, length(feature)-3, 4) = 'link' THEN substr(feature, 0, length(feature)-4) ELSE feature END) AS feature, + horse, + foot, + bicycle, + tracktype, + int_surface, + access, + construction, + service, + oneway, + link, + layernotnull + FROM ( -- begin "features" subselect that contains both roads and rail/aero SELECT way, - ('highway_' || highway) AS feature, --only motorway to tertiary links are accepted later on + ('highway_' || highway) AS feature, -- only motorway to tertiary links are accepted later on horse, foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', - 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE - CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' - ELSE null END END AS int_surface, + CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', + 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' + ELSE NULL + END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text ELSE NULL @@ -992,7 +1011,7 @@ Layer: foot, bicycle, tracktype, - 'null', + 'null' AS surface, -- Should be a SQL NULL? CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text @@ -1129,11 +1148,12 @@ Layer: ) AS feature, CASE WHEN tunnel = 'yes' OR tunnel = 'building_passage' OR covered = 'yes' THEN 'yes' ELSE 'no' END AS int_tunnel, CASE WHEN substr(highway, length(highway)-3, 4) = 'link' THEN 'yes' ELSE 'no' END AS link, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', - 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE - CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', - 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' - ELSE null END END AS int_surface + CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', + 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' + ELSE NULL + END AS int_surface FROM planet_osm_roads WHERE highway IS NOT NULL OR (railway IS NOT NULL AND railway != 'preserved' @@ -1186,11 +1206,12 @@ Layer: foot, bicycle, tracktype, - CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', - 'ground', 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' ELSE - CASE WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', - 'concrete:lanes', 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' - ELSE null END END AS int_surface, + CASE WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'ground', + 'mud', 'pebblestone', 'salt', 'sand', 'woodchips', 'clay') THEN 'unpaved' + WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'cobblestone:flattened', 'sett', 'concrete', 'concrete:lanes', + 'concrete:plates', 'paving_stones', 'metal', 'wood') THEN 'paved' + ELSE NULL + END AS int_surface, CASE WHEN access IN ('destination') THEN 'destination'::text WHEN access IN ('no', 'private') THEN 'no'::text ELSE NULL From 1710ea6ed9ab105a6caa491eb2fe0dc2417a92c9 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Fri, 17 Jun 2016 09:10:51 +0200 Subject: [PATCH 02/11] placenames-medium is not used on z3 --- project.mml | 2 +- project.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project.mml b/project.mml index b66d511ec1..5f7ee21cd1 100644 --- a/project.mml +++ b/project.mml @@ -1306,7 +1306,7 @@ ], "properties": { "maxzoom": 15, - "minzoom": 3 + "minzoom": 4 }, "advanced": {} }, diff --git a/project.yaml b/project.yaml index 8e2967b66b..3a06c9570a 100644 --- a/project.yaml +++ b/project.yaml @@ -1533,7 +1533,7 @@ Layer: ORDER BY score DESC, length(name) DESC, name ) AS placenames_medium properties: - minzoom: 3 + minzoom: 4 maxzoom: 15 advanced: {} - id: "placenames-small" From 7b492e6eb5f3ec02fb2d2c22fdf69249e1943896 Mon Sep 17 00:00:00 2001 From: math1985 Date: Sat, 18 Jun 2016 23:27:03 +0200 Subject: [PATCH 03/11] Revert "Merge remote-tracking branch 'pnorman/water_polygons'" This reverts commit 759b4862d9b6fdb780f032544eee5a4e31e427fb, reversing changes made to 2294a2e5d71ead7d794dbeff0d7b0e5eddd1e55a. Conflicts: INSTALL.md project.mml --- .travis.yml | 4 ++-- INSTALL.md | 4 ++-- get-shapefiles.sh | 48 +++++++++++++++++++++---------------------- project.mml | 16 +++++++-------- project.yaml | 16 +++++++-------- shapefiles.mss | 12 +++++++++++ style.mss | 2 +- water.mss | 52 ++++++++++++++++++++++++++++++----------------- 8 files changed, 90 insertions(+), 64 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69393231c7..04bea3848a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ node_js: - "0.10" install: - npm install carto@0.12.1 - - mkdir -p data/world_boundaries data/simplified-land-polygons-complete-3857 data/simplified-water-polygons-complete-3857 data/ne_110m_admin_0_boundary_lines_land data/ne_10m_populated_places data/water-polygons-split-3857 - - touch data/world_boundaries/builtup_area.shp data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp data/water-polygons-split-3857/water_polygons.shp + - mkdir -p data/world_boundaries data/simplified-land-polygons-complete-3857 data/ne_110m_admin_0_boundary_lines_land data/ne_10m_populated_places data/land-polygons-split-3857 + - touch data/world_boundaries/builtup_area.shp data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp data/land-polygons-split-3857/land_polygons.shp script: - jsonlint project.mml - ./node_modules/carto/bin/carto project.mml | xmllint - | wc -l diff --git a/INSTALL.md b/INSTALL.md index fa4e230e3c..51da6bf07b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -32,8 +32,8 @@ To download the shapefiles you can run the following script from this directory. You can also download them manually at the following paths: -* [`simplified-water-polygons.shp`](http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip) (updated daily) -* [`water-polygon.shp`](http://data.openstreetmapdata.com/water-polygons-split-3857.zip) (updated daily) +* [`simplified-land-polygons.shp`](http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip) (updated daily) +* [`land-polygon.shp`](http://data.openstreetmapdata.com/land-polygons-split-3857.zip) (updated daily) * [`builtup_area.shp`](http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz) * [`ne_110m_admin_0_boundary_lines_land.shp`](http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip) diff --git a/get-shapefiles.sh b/get-shapefiles.sh index c99d8305bf..da232de4d1 100755 --- a/get-shapefiles.sh +++ b/get-shapefiles.sh @@ -6,9 +6,9 @@ UNZIP_OPTS=-qqun # create and populate data dir mkdir -p data/ mkdir -p data/world_boundaries -mkdir -p data/simplified-water-polygons-complete-3857 +mkdir -p data/simplified-land-polygons-complete-3857 mkdir -p data/ne_110m_admin_0_boundary_lines_land -mkdir -p data/water-polygons-split-3857 +mkdir -p data/land-polygons-split-3857 # world_boundaries echo "downloading world_boundaries..." @@ -16,16 +16,16 @@ curl -z "data/world_boundaries-spherical.tgz" -L -o "data/world_boundaries-spher echo "expanding world_boundaries..." tar -xzf data/world_boundaries-spherical.tgz -C data/ -# simplified-water-polygons-complete-3857 -echo "downloading simplified-water-polygons-complete-3857..." -curl -z "data/simplified-water-polygons-complete-3857.zip" -L -o "data/simplified-water-polygons-complete-3857.zip" "http://data.openstreetmapdata.com/simplified-water-polygons-complete-3857.zip" -echo "simplified-water-polygons-complete-3857..." -unzip $UNZIP_OPTS data/simplified-water-polygons-complete-3857.zip \ - simplified-water-polygons-complete-3857/simplified_water_polygons.shp \ - simplified-water-polygons-complete-3857/simplified_water_polygons.shx \ - simplified-water-polygons-complete-3857/simplified_water_polygons.prj \ - simplified-water-polygons-complete-3857/simplified_water_polygons.dbf \ - simplified-water-polygons-complete-3857/simplified_water_polygons.cpg \ +# simplified-land-polygons-complete-3857 +echo "downloading simplified-land-polygons-complete-3857..." +curl -z "data/simplified-land-polygons-complete-3857.zip" -L -o "data/simplified-land-polygons-complete-3857.zip" "http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip" +echo "simplified-land-polygons-complete-3857..." +unzip $UNZIP_OPTS data/simplified-land-polygons-complete-3857.zip \ + simplified-land-polygons-complete-3857/simplified_land_polygons.shp \ + simplified-land-polygons-complete-3857/simplified_land_polygons.shx \ + simplified-land-polygons-complete-3857/simplified_land_polygons.prj \ + simplified-land-polygons-complete-3857/simplified_land_polygons.dbf \ + simplified-land-polygons-complete-3857/simplified_land_polygons.cpg \ -d data/ # ne_110m_admin_0_boundary_lines_land @@ -39,16 +39,16 @@ unzip $UNZIP_OPTS data/ne_110m_admin_0_boundary_lines_land.zip \ ne_110m_admin_0_boundary_lines_land.dbf \ -d data/ne_110m_admin_0_boundary_lines_land/ -# water-polygons-split-3857 -echo "downloading water-polygons-split-3857..." -curl -z "data/water-polygons-split-3857.zip" -L -o "data/water-polygons-split-3857.zip" "http://data.openstreetmapdata.com/water-polygons-split-3857.zip" -echo "expanding water-polygons-split-3857..." -unzip $UNZIP_OPTS data/water-polygons-split-3857.zip \ - water-polygons-split-3857/water_polygons.shp \ - water-polygons-split-3857/water_polygons.shx \ - water-polygons-split-3857/water_polygons.prj \ - water-polygons-split-3857/water_polygons.dbf \ - water-polygons-split-3857/water_polygons.cpg \ +# land-polygons-split-3857 +echo "downloading land-polygons-split-3857..." +curl -z "data/land-polygons-split-3857.zip" -L -o "data/land-polygons-split-3857.zip" "http://data.openstreetmapdata.com/land-polygons-split-3857.zip" +echo "expanding land-polygons-split-3857..." +unzip $UNZIP_OPTS data/land-polygons-split-3857.zip \ + land-polygons-split-3857/land_polygons.shp \ + land-polygons-split-3857/land_polygons.shx \ + land-polygons-split-3857/land_polygons.prj \ + land-polygons-split-3857/land_polygons.dbf \ + land-polygons-split-3857/land_polygons.cpg \ -d data/ # antarctica-icesheet-polygons-3857 @@ -76,8 +76,8 @@ unzip $UNZIP_OPTS data/antarctica-icesheet-outlines-3857.zip \ #index echo "indexing shapefiles" shapeindex --shape_files \ -data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp \ -data/water-polygons-split-3857/water_polygons.shp \ +data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp \ +data/land-polygons-split-3857/land_polygons.shp \ data/antarctica-icesheet-polygons-3857/icesheet_polygons.shp \ data/antarctica-icesheet-outlines-3857/icesheet_outlines.shp \ data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp diff --git a/project.mml b/project.mml index 13a4324f34..64c2401da0 100644 --- a/project.mml +++ b/project.mml @@ -2,15 +2,15 @@ "interactivity": false, "Layer": [ { - "name": "ocean-lz", + "name": "world", "srs-name": "900913", "geometry": "polygon", - "class": "ocean", - "id": "ocean-lz", + "class": "", + "id": "world", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "type": "shape", - "file": "data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp" + "file": "data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp" }, "extent": [ -180, @@ -24,15 +24,15 @@ "advanced": {} }, { - "name": "ocean", + "name": "coast-poly", "srs-name": "900913", "geometry": "polygon", - "class": "ocean", - "id": "ocean", + "class": "", + "id": "coast-poly", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "type": "shape", - "file": "data/water-polygons-split-3857/water_polygons.shp" + "file": "data/land-polygons-split-3857/land_polygons.shp" }, "extent": [ -180, diff --git a/project.yaml b/project.yaml index 7f1fa26434..5478a62a84 100644 --- a/project.yaml +++ b/project.yaml @@ -53,24 +53,24 @@ Stylesheet: - "admin.mss" - "addressing.mss" Layer: - - id: "ocean-lz" - name: "ocean-lz" - class: "ocean" + - id: "world" + name: "world" + class: "" geometry: "polygon" <<: *extents Datasource: - file: "data/simplified-water-polygons-complete-3857/simplified_water_polygons.shp" + file: "data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp" type: "shape" advanced: {} properties: maxzoom: 9 - - id: "ocean" - name: "ocean" - class: "ocean" + - id: "coast-poly" + name: "coast-poly" + class: "" geometry: "polygon" <<: *extents Datasource: - file: "data/water-polygons-split-3857/water_polygons.shp" + file: "data/land-polygons-split-3857/land_polygons.shp" type: "shape" properties: minzoom: 10 diff --git a/shapefiles.mss b/shapefiles.mss index 4b91e63291..1274b57a74 100644 --- a/shapefiles.mss +++ b/shapefiles.mss @@ -11,6 +11,18 @@ } } +#world { + [zoom >= 0][zoom < 10] { + polygon-fill: @land-color; + } +} + +#coast-poly { + [zoom >= 10] { + polygon-fill: @land-color; + } +} + #icesheet-poly { [zoom >= 6] { polygon-fill: @glacier; diff --git a/style.mss b/style.mss index 1d35b6a7ff..86083cb319 100644 --- a/style.mss +++ b/style.mss @@ -1,5 +1,5 @@ Map { - background-color: @land-color; + background-color: @water-color; } @book-fonts: "DejaVu Sans Book", "Arundina Sans Regular", "Padauk Regular", "Khmer OS Metal Chrieng Regular", diff --git a/water.mss b/water.mss index cf00fdc976..c37ed9779e 100644 --- a/water.mss +++ b/water.mss @@ -17,28 +17,42 @@ } } } -} - -/* - * Water areas, of all types. Because they are rendered all the same, - * attachments can be used to reduce combinational rules - */ -#water-areas[waterway = 'dock'][zoom >= 9]::waterway, -#water-areas[waterway = 'canal'][zoom >= 9]::waterway, -#water-areas[landuse = 'basin'][zoom >= 7]::landuse, -#water-areas[natural = 'water'][zoom >= 6]::natural, -#water-areas[landuse = 'reservoir'][zoom >= 6]::landuse, -#water-areas[waterway = 'riverbank'][zoom >= 6]::waterway, -.ocean { - polygon-fill: @water-color; + [waterway = 'dock'], + [waterway = 'canal'] { + [zoom >= 9]::waterway { + polygon-fill: @water-color; + [way_pixels >= 4] { + polygon-gamma: 0.75; + } + [way_pixels >= 64] { + polygon-gamma: 0.6; + } + } + } - // Only the SQL layers have way_pixels - #water-areas[way_pixels >= 4] { - polygon-gamma: 0.75; + [landuse = 'basin'][zoom >= 7]::landuse { + polygon-fill: @water-color; + [way_pixels >= 4] { + polygon-gamma: 0.75; + } + [way_pixels >= 64] { + polygon-gamma: 0.6; + } } - #water-areas[way_pixels >= 64] { - polygon-gamma: 0.6; + + [natural = 'water']::natural, + [landuse = 'reservoir']::landuse, + [waterway = 'riverbank']::waterway { + [zoom >= 6] { + polygon-fill: @water-color; + [way_pixels >= 4] { + polygon-gamma: 0.75; + } + [way_pixels >= 64] { + polygon-gamma: 0.6; + } + } } } From 77b30109192f192705f5a1457b98906e8dd42a2a Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Fri, 17 Jun 2016 16:03:19 +0200 Subject: [PATCH 04/11] rewrite low priority layer to make it like main amenity layer also, removes combinatorial explosion in generated .xml file --- amenity-points.mss | 34 +++++++++++++++---------------- project.mml | 4 ++-- project.yaml | 50 +++++++++++++++++++++++----------------------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/amenity-points.mss b/amenity-points.mss index ef8ac3f87e..a25aa1af97 100644 --- a/amenity-points.mss +++ b/amenity-points.mss @@ -1031,24 +1031,24 @@ } .amenity-low-priority { - [man_made = 'cross'][zoom >= 16], - [historic = 'wayside_cross'][zoom >= 16] { + [feature = 'man_made_cross'][zoom >= 16], + [feature = 'historic_wayside_cross'][zoom >= 16] { marker-file: url('symbols/christian.9.svg'); marker-fill: #000000; marker-placement: interior; marker-clip: false; } - [amenity = 'parking'][zoom >= 17], - [amenity = 'bicycle_parking'][zoom >= 17], - [amenity = 'motorcycle_parking'][zoom >= 17] { - [amenity = 'parking'] { + [feature = 'amenity_parking'][zoom >= 17], + [feature = 'amenity_bicycle_parking'][zoom >= 17], + [feature = 'amenity_motorcycle_parking'][zoom >= 17] { + [feature = 'amenity_parking'] { marker-file: url('symbols/parking.svg'); } - [amenity = 'bicycle_parking'] { + [feature = 'amenity_bicycle_parking'] { marker-file: url('symbols/bicycle_parking.16.svg'); } - [amenity = 'motorcycle_parking'] { + [feature = 'amenity_motorcycle_parking'] { marker-file: url('symbols/motorcycle_parking.16.svg'); } marker-placement: interior; @@ -1059,7 +1059,7 @@ } } - [railway = 'level_crossing'][zoom >= 14]::railway { + [feature = 'railway_level_crossing'][zoom >= 14]::railway { point-file: url('symbols/level_crossing.svg'); point-placement: interior; [zoom >= 16] { @@ -1067,13 +1067,13 @@ } } - [highway = 'mini_roundabout'][zoom >= 16]::highway { + [feature = 'highway_mini_roundabout'][zoom >= 16]::highway { marker-file: url('symbols/mini_roundabout.svg'); marker-placement: interior; marker-clip: false; } - [barrier = 'gate']::barrier { + [feature = 'barrier_gate']::barrier { [zoom >= 16] { marker-file: url('symbols/gate.svg'); marker-placement: interior; @@ -1081,16 +1081,16 @@ } } - [barrier = 'lift_gate'][zoom >= 16]::barrier, - [barrier = 'swing_gate'][zoom >= 16]::barrier { + [feature = 'barrier_lift_gate'][zoom >= 16]::barrier, + [feature = 'barrier_swing_gate'][zoom >= 16]::barrier { marker-file: url('symbols/liftgate.svg'); marker-fill: #3f3f3f; marker-placement: interior; marker-clip: false; } - [barrier = 'bollard'], - [barrier = 'block'] { + [feature = 'barrier_bollard'], + [feature = 'barrier_block'] { [zoom >= 16] { marker-width: 3; marker-line-width: 0; @@ -1103,13 +1103,13 @@ } } - [amenity = 'bench'][zoom >= 19]::amenity { + [feature = 'amenity_bench'][zoom >= 19]::amenity { marker-file: url('symbols/bench.16.svg'); marker-fill: @amenity-brown; marker-placement: interior; } - [amenity = 'waste_basket'][zoom >= 19]::amenity { + [feature = 'amenity_waste_basket'][zoom >= 19]::amenity { marker-file: url('symbols/waste_basket.10.svg'); marker-fill: @amenity-brown; marker-placement: interior; diff --git a/project.mml b/project.mml index dd5f01e15a..b6c4b928ce 100644 --- a/project.mml +++ b/project.mml @@ -1997,7 +1997,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n amenity,\n railway,\n highway,\n barrier,\n man_made,\n historic,\n access,\n name,\n CASE WHEN amenity='waste_basket' THEN 2 ELSE 1 END AS prio\n FROM planet_osm_point p\n WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block')\n OR highway IN ('mini_roundabout')\n OR railway = 'level_crossing'\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket')\n OR historic = 'wayside_cross'\n OR man_made = 'cross'\n ORDER BY prio\n ) AS amenity_low_priority", + "table": "(SELECT\n way,\n COALESCE(\n 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END,\n 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket') THEN amenity ELSE NULL END,\n 'historic_' || CASE WHEN historic IN ('wayside_cross') THEN historic ELSE NULL END,\n 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END,\n 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END\n ) AS feature,\n access,\n CASE WHEN amenity='waste_basket' THEN 2 ELSE 1 END AS prio\n FROM planet_osm_point p\n WHERE highway IN ('mini_roundabout')\n OR railway IN ('level_crossing')\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket')\n OR historic IN ('wayside_cross')\n OR man_made IN ('cross')\n OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block')\n ORDER BY prio\n ) AS amenity_low_priority", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -2023,7 +2023,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n amenity,\n railway,\n highway,\n barrier,\n man_made,\n historic,\n access,\n name\n FROM planet_osm_polygon\n WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block')\n OR highway IN ('mini_roundabout')\n OR railway = 'level_crossing'\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')\n ) AS amenity_low_priority_poly", + "table": "(SELECT\n way,\n COALESCE(\n 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END,\n 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END,\n 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END\n ) AS feature,\n access\n FROM planet_osm_polygon p\n WHERE highway IN ('mini_roundabout')\n OR railway IN ('level_crossing')\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')\n OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block')\n ) AS amenity_low_priority_poly", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index eeade57ec8..9be6b31563 100644 --- a/project.yaml +++ b/project.yaml @@ -2457,22 +2457,23 @@ Layer: table: |- (SELECT way, - amenity, - railway, - highway, - barrier, - man_made, - historic, + COALESCE( + 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END, + 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket') THEN amenity ELSE NULL END, + 'historic_' || CASE WHEN historic IN ('wayside_cross') THEN historic ELSE NULL END, + 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END, + 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END + ) AS feature, access, - name, CASE WHEN amenity='waste_basket' THEN 2 ELSE 1 END AS prio FROM planet_osm_point p - WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') - OR highway IN ('mini_roundabout') - OR railway = 'level_crossing' + WHERE highway IN ('mini_roundabout') + OR railway IN ('level_crossing') OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'bench', 'waste_basket') - OR historic = 'wayside_cross' - OR man_made = 'cross' + OR historic IN ('wayside_cross') + OR man_made IN ('cross') + OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') ORDER BY prio ) AS amenity_low_priority properties: @@ -2488,19 +2489,18 @@ Layer: table: |- (SELECT way, - amenity, - railway, - highway, - barrier, - man_made, - historic, - access, - name - FROM planet_osm_polygon - WHERE barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') - OR highway IN ('mini_roundabout') - OR railway = 'level_crossing' - OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') + COALESCE( + 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END, + 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END, + 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END, + 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END + ) AS feature, + access + FROM planet_osm_polygon p + WHERE highway IN ('mini_roundabout') + OR railway IN ('level_crossing') + OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') + OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') ) AS amenity_low_priority_poly properties: minzoom: 14 From 2af08b0bdafac1072ec337c675d0724853c50685 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 18 Jun 2016 10:01:23 +0200 Subject: [PATCH 05/11] stop displaying highway=mini_roundabout and highway=level_crossing mapped as areas --- project.mml | 2 +- project.yaml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/project.mml b/project.mml index b6c4b928ce..4beec2ca16 100644 --- a/project.mml +++ b/project.mml @@ -2023,7 +2023,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n COALESCE(\n 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END,\n 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END,\n 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END,\n 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END\n ) AS feature,\n access\n FROM planet_osm_polygon p\n WHERE highway IN ('mini_roundabout')\n OR railway IN ('level_crossing')\n OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')\n OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block')\n ) AS amenity_low_priority_poly", + "table": "(SELECT\n way,\n COALESCE(\n 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END,\n 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END\n ) AS feature,\n access\n FROM planet_osm_polygon p\n WHERE amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking')\n OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block')\n ) AS amenity_low_priority_poly", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index 9be6b31563..b047936a85 100644 --- a/project.yaml +++ b/project.yaml @@ -2490,16 +2490,12 @@ Layer: (SELECT way, COALESCE( - 'highway_' || CASE WHEN highway IN ('mini_roundabout') THEN highway ELSE NULL END, - 'railway_' || CASE WHEN railway IN ('level_crossing') THEN railway ELSE NULL END, 'amenity_' || CASE WHEN amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') THEN amenity ELSE NULL END, 'barrier_' || CASE WHEN barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') THEN barrier ELSE NULL END ) AS feature, access FROM planet_osm_polygon p - WHERE highway IN ('mini_roundabout') - OR railway IN ('level_crossing') - OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') + WHERE amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking') OR barrier IN ('bollard', 'gate', 'lift_gate', 'swing_gate', 'block') ) AS amenity_low_priority_poly properties: From cb69b8081dc49114a47c8be878df43da98a31576 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 18 Jun 2016 20:51:57 +0200 Subject: [PATCH 06/11] larger labels for placenames fixes #2175 --- placenames.mss | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/placenames.mss b/placenames.mss index ec05e60f74..7c8986014a 100644 --- a/placenames.mss +++ b/placenames.mss @@ -66,7 +66,7 @@ [zoom >= 4][score >= 3000000], [zoom >= 5][score >= 400000] { text-name: "[name]"; - text-size: 8; + text-size: 11; text-fill: @placenames; text-face-name: @book-fonts; text-halo-radius: 1.5; @@ -74,13 +74,21 @@ text-wrap-width: 30; text-min-distance: 10; [zoom >= 5] { - text-size: 10; + text-size: 11; text-wrap-width: 45; } [zoom >= 6] { text-size: 12; text-wrap-width: 60; } + [zoom >= 8] { + text-size: 13; + text-wrap-width: 60; + } + [zoom >= 9] { + text-size: 14; + text-wrap-width: 65; + } [zoom >= 11] { text-size: 15; text-wrap-width: 75; @@ -94,7 +102,7 @@ [zoom >= 6][score >= 70000], [zoom >= 7] { text-name: "[name]"; - text-size: 9; + text-size: 10; text-fill: @placenames; text-face-name: @book-fonts; text-halo-radius: 1.5; @@ -102,7 +110,7 @@ text-wrap-width: 30; text-min-distance: 10; [zoom >= 9] { - text-size: 11; + text-size: 12; text-wrap-width: 60; } [zoom >= 11] { @@ -121,7 +129,7 @@ [category = 2] { [zoom >= 9][zoom < 16] { text-name: "[name]"; - text-size: 9; + text-size: 10; text-fill: @placenames; text-face-name: @book-fonts; text-halo-radius: 1.5; From eb5f7839bd2d8ae2790830a27d18000fe5016ba0 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Mon, 20 Jun 2016 21:20:58 -0700 Subject: [PATCH 07/11] Filter placenames-large based on way_area The style only shows large placenames, and this allows partial index usage --- project.mml | 2 +- project.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/project.mml b/project.mml index 4beec2ca16..17db2cbe38 100644 --- a/project.mml +++ b/project.mml @@ -1266,7 +1266,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,\n name,\n ref,\n admin_level\n FROM planet_osm_polygon\n WHERE boundary = 'administrative'\n AND admin_level IN ('2', '4')\n AND name IS NOT NULL\n ORDER BY admin_level ASC, way_area DESC\n) AS placenames_large", + "table": "(SELECT\n way,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels,\n name,\n ref,\n admin_level\n FROM planet_osm_polygon\n WHERE boundary = 'administrative'\n AND admin_level IN ('2', '4')\n AND name IS NOT NULL\n AND way_area > 750*!pixel_width!::real*!pixel_height!::real -- only labels for larger areas are displayed\n ORDER BY admin_level ASC, way_area DESC\n) AS placenames_large", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index b047936a85..d9be9689e9 100644 --- a/project.yaml +++ b/project.yaml @@ -1507,6 +1507,7 @@ Layer: WHERE boundary = 'administrative' AND admin_level IN ('2', '4') AND name IS NOT NULL + AND way_area > 750*!pixel_width!::real*!pixel_height!::real -- only labels for larger areas are displayed ORDER BY admin_level ASC, way_area DESC ) AS placenames_large properties: From c573c8dcff238f05c3964557f4d3ce4c3ea7a934 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Mon, 20 Jun 2016 21:27:04 -0700 Subject: [PATCH 08/11] Add name IS NOT NULL check to medium placenames --- project.mml | 2 +- project.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/project.mml b/project.mml index 4beec2ca16..0a03e51071 100644 --- a/project.mml +++ b/project.mml @@ -1292,7 +1292,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way,\n name,\n score,\n CASE\n WHEN (place = 'city' OR (capital = 'yes' AND score >= 100000)) THEN 1\n ELSE 2\n END as category\n FROM \n (SELECT\n way,\n place,\n name,\n capital,\n (\n (CASE\n WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER\n WHEN (place = 'city') THEN 100000\n WHEN (place = 'town') THEN 1000\n ELSE 1\n END)\n *\n (CASE\n WHEN (capital = 'yes') THEN 3\n WHEN (capital = '4') THEN 2\n ELSE 1\n END)\n ) AS score\n FROM planet_osm_point\n WHERE place IN ('city', 'town')\n ) as p\n ORDER BY score DESC, length(name) DESC, name\n) AS placenames_medium", + "table": "(SELECT\n way,\n name,\n score,\n CASE\n WHEN (place = 'city' OR (capital = 'yes' AND score >= 100000)) THEN 1\n ELSE 2\n END as category\n FROM \n (SELECT\n way,\n place,\n name,\n capital,\n (\n (CASE\n WHEN (population ~ '^[0-9]{1,8}$') THEN population::INTEGER\n WHEN (place = 'city') THEN 100000\n WHEN (place = 'town') THEN 1000\n ELSE 1\n END)\n *\n (CASE\n WHEN (capital = 'yes') THEN 3\n WHEN (capital = '4') THEN 2\n ELSE 1\n END)\n ) AS score\n FROM planet_osm_point\n WHERE place IN ('city', 'town')\n AND name IS NOT NULL\n ) as p\n ORDER BY score DESC, length(name) DESC, name\n) AS placenames_medium", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index b047936a85..9a573c1042 100644 --- a/project.yaml +++ b/project.yaml @@ -1550,6 +1550,7 @@ Layer: ) AS score FROM planet_osm_point WHERE place IN ('city', 'town') + AND name IS NOT NULL ) as p ORDER BY score DESC, length(name) DESC, name ) AS placenames_medium From e2ab3a1264fa5a470bc555030d311eee24065476 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Tue, 21 Jun 2016 12:27:17 +0200 Subject: [PATCH 09/11] synchronise description in Github repo and project file --- project.mml | 2 +- project.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project.mml b/project.mml index 0a03e51071..7391e9228a 100644 --- a/project.mml +++ b/project.mml @@ -2106,5 +2106,5 @@ ], "minzoom": 0, "maxzoom": 22, - "description": "A faithful reimplementation of the standard OpenStreetMap style" + "description": "A general-purpose OpenStreetMap mapnik style, in CartoCSS" } \ No newline at end of file diff --git a/project.yaml b/project.yaml index 9a573c1042..4b92da1d5f 100644 --- a/project.yaml +++ b/project.yaml @@ -1,7 +1,7 @@ scale: 1 metatile: 2 name: "OpenStreetMap Carto" -description: "A faithful reimplementation of the standard OpenStreetMap style" +description: "A general-purpose OpenStreetMap mapnik style, in CartoCSS" bounds: &world - -180 - -85.05112877980659 From dbb4d94bfcdd25fe0afb8eab851ccd6bd189cb7d Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Tue, 21 Jun 2016 14:35:55 +0200 Subject: [PATCH 10/11] it is not necessary to query buildings for z12, as buildings are not displayed on z12 --- project.mml | 4 ++-- project.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project.mml b/project.mml index 7391e9228a..db31b792df 100644 --- a/project.mml +++ b/project.mml @@ -548,7 +548,7 @@ 85.05112877980659 ], "properties": { - "minzoom": 12 + "minzoom": 13 }, "advanced": {} }, @@ -574,7 +574,7 @@ 85.05112877980659 ], "properties": { - "minzoom": 12 + "minzoom": 13 }, "advanced": {} }, diff --git a/project.yaml b/project.yaml index 4b92da1d5f..6df1b09413 100644 --- a/project.yaml +++ b/project.yaml @@ -460,7 +460,7 @@ Layer: ORDER BY z_order, way_area DESC ) AS buildings properties: - minzoom: 12 + minzoom: 13 advanced: {} - id: "buildings-major" name: "buildings-major" @@ -483,7 +483,7 @@ Layer: ORDER BY z_order, way_area DESC) AS buildings_major properties: - minzoom: 12 + minzoom: 13 advanced: {} - id: "tunnels" name: "tunnels" From 51da5e21c484d88d353cc9af05442dbe585a9bae Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Tue, 21 Jun 2016 13:50:31 +0200 Subject: [PATCH 11/11] show bus_guideway tunnels no special rendering as this case is extremely rare (one known place where this is valid tagging) fixes #2187 --- project.mml | 2 +- project.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project.mml b/project.mml index 6641f8abce..8c182dc725 100644 --- a/project.mml +++ b/project.mml @@ -1031,7 +1031,7 @@ "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "Datasource": { "extent": "-20037508,-20037508,20037508,20037508", - "table": "(SELECT\n way\n FROM planet_osm_line\n WHERE highway = 'bus_guideway' AND (tunnel IS NULL OR tunnel != 'yes')\n) AS guideways", + "table": "(SELECT\n way\n FROM planet_osm_line\n WHERE highway = 'bus_guideway'\n) AS guideways", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index b6aac9dee7..efbcaea0de 100644 --- a/project.yaml +++ b/project.yaml @@ -1329,7 +1329,7 @@ Layer: (SELECT way FROM planet_osm_line - WHERE highway = 'bus_guideway' AND (tunnel IS NULL OR tunnel != 'yes') + WHERE highway = 'bus_guideway' ) AS guideways properties: minzoom: 13