Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…map-carto

Conflicts:
	project.mml
  • Loading branch information
matthijsmelissen committed Sep 23, 2016
2 parents d6b7388 + dbf4e25 commit d0d4a81
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 84 deletions.
43 changes: 21 additions & 22 deletions addressing.mss
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
/* Features related to (postal) adresses: */

@address-color: #666;

#interpolation {
[zoom >= 17] {
line-color: #888;
line-color: @address-color;
line-width: 1;
line-dasharray: 2,4;
}
}

#housenumbers {
#addresses {
[zoom >= 17] {
text-name: "[addr:housenumber]";
text-placement: interior;
text-min-distance: 1;
text-wrap-width: 0;
text-face-name: @book-fonts;
text-fill: @address-color;
text-size: 10;
[zoom >= 20] {
text-size: 11;
text-name: "[addr_housename]";
["addr_housenumber" != null] {
text-name: [addr_housenumber];
["addr_housename" != null] {
text-name: [addr_housenumber] + "\n" + [addr_housename];
}
}
}
}

#housenames {
[zoom >= 17] {
text-name: "[addr:housename]";
text-placement: interior;
text-min-distance: 1;
text-wrap-width: 20;
text-face-name: @book-fonts;
text-fill: @address-color;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-size: 10;
[zoom >= 20] {
text-size: 11;
}
}
}

/* Building names (rendered differently from addresses because they are
no official postal addresses) */

#building-text {
[zoom >= 14][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: 11;
text-fill: #444;
text-placement: interior;
text-wrap-width: 20;
text-face-name: @book-fonts;
text-fill: #444;
text-halo-radius: @standard-halo-radius;
text-wrap-width: 20;
text-halo-fill: rgba(255,255,255,0.5);
text-placement: interior;
text-halo-fill: @standard-halo-fill;
text-size: 11;
}
}
32 changes: 3 additions & 29 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1861,41 +1861,15 @@
"advanced": {}
},
{
"name": "housenumbers",
"name": "addresses",
"srs-name": "900913",
"geometry": "point",
"class": "",
"id": "housenumbers",
"id": "addresses",
"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 \"addr:housenumber\",\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels\n FROM planet_osm_polygon\n WHERE \"addr:housenumber\" IS NOT NULL\n AND building IS NOT NULL\nUNION ALL\nSELECT\n way,\n \"addr:housenumber\",\n NULL AS way_pixels\n FROM planet_osm_point\n WHERE \"addr:housenumber\" IS NOT NULL\n ORDER BY way_pixels DESC NULLS LAST\n) AS housenumbers",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
"dbname": "gis"
},
"extent": [
-180,
-85.05112877980659,
180,
85.05112877980659
],
"properties": {
"minzoom": 17
},
"advanced": {}
},
{
"name": "housenames",
"srs-name": "900913",
"geometry": "point",
"class": "",
"id": "housenames",
"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 \"addr:housename\",\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels\n FROM planet_osm_polygon\n WHERE \"addr:housename\" IS NOT NULL\n AND building IS NOT NULL\nUNION ALL\nSELECT\n way,\n \"addr:housename\",\n NULL AS way_pixels\n FROM planet_osm_point WHERE \"addr:housename\" IS NOT NULL\nORDER BY way_pixels DESC NULLS LAST\n) AS housenames",
"table": "(SELECT\n way,\n \"addr:housenumber\" AS addr_housenumber,\n \"addr:housename\" AS addr_housename,\n way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels\n FROM planet_osm_polygon\n WHERE ((\"addr:housenumber\" IS NOT NULL) OR (\"addr:housename\" IS NOT NULL))\n AND building IS NOT NULL\nUNION ALL\nSELECT\n way,\n \"addr:housenumber\" AS addr_housenumber,\n \"addr:housename\" AS addr_housename,\n NULL AS way_pixels\n FROM planet_osm_point\n WHERE (\"addr:housenumber\" IS NOT NULL) OR (\"addr:housename\" IS NOT NULL)\n ORDER BY way_pixels DESC NULLS LAST\n) AS addresses",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down
42 changes: 9 additions & 33 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2398,8 +2398,8 @@ Layer:
properties:
minzoom: 17
advanced: {}
- id: "housenumbers"
name: "housenumbers"
- id: "addresses"
name: "addresses"
class: ""
geometry: "point"
<<: *extents
Expand All @@ -2408,46 +2408,22 @@ Layer:
table: |-
(SELECT
way,
"addr:housenumber",
"addr:housenumber" AS addr_housenumber,
"addr:housename" AS addr_housename,
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE "addr:housenumber" IS NOT NULL
WHERE (("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL))
AND building IS NOT NULL
UNION ALL
SELECT
way,
"addr:housenumber",
"addr:housenumber" AS addr_housenumber,
"addr:housename" AS addr_housename,
NULL AS way_pixels
FROM planet_osm_point
WHERE "addr:housenumber" IS NOT NULL
WHERE ("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL)
ORDER BY way_pixels DESC NULLS LAST
) AS housenumbers
properties:
minzoom: 17
advanced: {}
- id: "housenames"
name: "housenames"
class: ""
geometry: "point"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
"addr:housename",
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE "addr:housename" IS NOT NULL
AND building IS NOT NULL
UNION ALL
SELECT
way,
"addr:housename",
NULL AS way_pixels
FROM planet_osm_point WHERE "addr:housename" IS NOT NULL
ORDER BY way_pixels DESC NULLS LAST
) AS housenames
) AS addresses
properties:
minzoom: 17
advanced: {}
Expand Down

0 comments on commit d0d4a81

Please sign in to comment.