diff --git a/project.mml b/project.mml index cf6e65969b..e319b68fd4 100644 --- a/project.mml +++ b/project.mml @@ -1768,7 +1768,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\nFROM planet_osm_line\nWHERE \"addr:interpolation\" IS NOT NULL) AS interpolation", + "table": "(SELECT\n way\n FROM planet_osm_line\n WHERE \"addr:interpolation\" IS NOT NULL\n) AS interpolation", "geometry_field": "way", "type": "postgis", "key_field": "", @@ -1794,7 +1794,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,\"addr:housenumber\", way_area FROM planet_osm_polygon WHERE \"addr:housenumber\" IS NOT NULL AND building IS NOT NULL\n UNION\n SELECT way,\"addr:housenumber\", NULL AS way_area FROM planet_osm_point WHERE \"addr:housenumber\" IS NOT NULL\n ORDER BY way_area DESC\n ) AS housenumbers", + "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": "", @@ -1820,7 +1820,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,\"addr:housename\", way_area FROM planet_osm_polygon WHERE \"addr:housename\" IS NOT NULL AND building IS NOT NULL\n UNION\n SELECT way,\"addr:housename\", NULL AS way_area FROM planet_osm_point WHERE \"addr:housename\" IS NOT NULL\n ORDER BY way_area DESC\n ) AS housenames", + "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", "geometry_field": "way", "type": "postgis", "key_field": "", diff --git a/project.yaml b/project.yaml index 33d6f09028..7ef3d7be8e 100644 --- a/project.yaml +++ b/project.yaml @@ -1719,10 +1719,12 @@ Layer: <<: *extents Datasource: <<: *osm2pgsql - table: |2- - (SELECT way - FROM planet_osm_line - WHERE "addr:interpolation" IS NOT NULL) AS interpolation + table: |- + (SELECT + way + FROM planet_osm_line + WHERE "addr:interpolation" IS NOT NULL + ) AS interpolation properties: minzoom: 17 advanced: {} @@ -1733,12 +1735,23 @@ Layer: <<: *extents Datasource: <<: *osm2pgsql - table: |2- - (SELECT way,"addr:housenumber", way_area FROM planet_osm_polygon WHERE "addr:housenumber" IS NOT NULL AND building IS NOT NULL - UNION - SELECT way,"addr:housenumber", NULL AS way_area FROM planet_osm_point WHERE "addr:housenumber" IS NOT NULL - ORDER BY way_area DESC - ) AS housenumbers + table: |- + (SELECT + way, + "addr:housenumber", + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE "addr:housenumber" IS NOT NULL + AND building IS NOT NULL + UNION ALL + SELECT + way, + "addr:housenumber", + NULL AS way_pixels + FROM planet_osm_point + WHERE "addr:housenumber" IS NOT NULL + ORDER BY way_pixels DESC NULLS LAST + ) AS housenumbers properties: minzoom: 17 advanced: {} @@ -1749,12 +1762,22 @@ Layer: <<: *extents Datasource: <<: *osm2pgsql - table: |2- - (SELECT way,"addr:housename", way_area FROM planet_osm_polygon WHERE "addr:housename" IS NOT NULL AND building IS NOT NULL - UNION - SELECT way,"addr:housename", NULL AS way_area FROM planet_osm_point WHERE "addr:housename" IS NOT NULL - ORDER BY way_area DESC - ) AS housenames + 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 properties: minzoom: 17 advanced: {}