Skip to content

Commit

Permalink
Merge remote-tracking branch 'pnorman/sql_cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijsmelissen committed Mar 2, 2015
2 parents 7ce4979 + 11b3519 commit 9478102
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 19 deletions.
6 changes: 3 additions & 3 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -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": "",
Expand All @@ -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": "",
Expand Down
55 changes: 39 additions & 16 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand All @@ -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: {}
Expand All @@ -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: {}
Expand Down

0 comments on commit 9478102

Please sign in to comment.