Replace UNION with WHERE

pull/65/head
Lukas Martinelli 2015-11-04 20:30:52 +01:00
rodzic 141f82de7e
commit 317d68df0f
1 zmienionych plików z 50 dodań i 98 usunięć

Wyświetl plik

@ -658,70 +658,42 @@ Layer:
coalesce(name, name_de) AS name_de, coalesce(name, name_de) AS name_de,
coalesce(name, name_ru) AS name_ru, coalesce(name, name_ru) AS name_ru,
coalesce(name, name_zh) AS name_zh coalesce(name, name_zh) AS name_zh
FROM ( FROM osm_water_polygons
SELECT geometry, osm_id, area, WHERE geometry && !bbox! AND
name, name_en, name_es, name_fr, name_de, name_ru, name_zh (
FROM osm_water_polygons (
WHERE area >= 5000000000 area >= 5000000000
AND z(!scale_denominator!) >= 5 AND z(!scale_denominator!) >= 5
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area,
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 5000000000 AND area >= 1500000000
AND z(!scale_denominator!) >= 5
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area,
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 1500000000 AND area >= 500000000
AND z(!scale_denominator!) >= 8
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 500000000 AND area >= 100000000
AND z(!scale_denominator!) >= 9
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area,
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 100000000 AND area >= 40000000
AND z(!scale_denominator!) >= 10
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area,
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 40000000 AND area >= 20000000
AND z(!scale_denominator!) >= 11
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 20000000 AND area >= 10000000
AND z(!scale_denominator!) >= 12
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 10000000 AND area >= 5000000
AND z(!scale_denominator!) >= 13
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id, area
name, name_en, name_es, name_fr, name_de, name_ru, name_zh
FROM osm_water_polygons
WHERE area < 5000000 AND area >= 1000000
AND z(!scale_denominator!) >= 14
AND geometry && !bbox!
) )
OR (
area < 1500000000 AND area >= 500000000
AND z(!scale_denominator!) >= 8
)
OR (
area < 500000000 AND area >= 100000000
AND z(!scale_denominator!) >= 9
)
OR (
area < 100000000 AND area >= 40000000
AND z(!scale_denominator!) >= 10
)
OR (
area < 40000000 AND area >= 20000000
AND z(!scale_denominator!) >= 11
)
OR (
area < 20000000 AND area >= 10000000
AND z(!scale_denominator!) >= 12
)
OR (
area < 10000000 AND area >= 5000000
AND z(!scale_denominator!) >= 13
)
OR (
area < 5000000 AND area >= 1000000
AND z(!scale_denominator!) >= 14
)
)
) AS data ) AS data
type: postgis type: postgis
user: osm user: osm
@ -904,42 +876,22 @@ Layer:
coalesce(name, name_fr) as name_fr, coalesce(name, name_fr) as name_fr,
coalesce(name, name_ru) AS name_ru, coalesce(name, name_ru) AS name_ru,
coalesce(name, name_zh) AS name_zh, coalesce(name, name_zh) AS name_zh,
type, type as class type, type as class
FROM osm_water_lines FROM osm_water_lines
WHERE type in ('river', 'canal') WHERE geometry && !bbox! AND (
AND z(!scale_denominator!) >= 8 (
AND linelabel(z(!scale_denominator!), name, geometry) type in ('river', 'canal')
AND geometry && !bbox! AND z(!scale_denominator!) >= 8
UNION ALL AND linelabel(z(!scale_denominator!), name, geometry)
SELECT geometry, osm_id, AND geometry && !bbox!
name, )
coalesce(name, name_de) as name_de, OR (
coalesce(name, name_en) as name_en, type in ('stream', 'stream_intermittent')
coalesce(name, name_es) as name_es, AND z(!scale_denominator!) >= 13
coalesce(name, name_fr) as name_fr, AND linelabel(z(!scale_denominator!), name, geometry)
coalesce(name, name_ru) AS name_ru, AND geometry && !bbox!
coalesce(name, name_zh) AS name_zh, )
type, type as class )
FROM osm_water_lines
WHERE type in ('stream', 'stream_intermittent')
AND z(!scale_denominator!) >= 13
AND linelabel(z(!scale_denominator!), name, geometry)
AND geometry && !bbox!
UNION ALL
SELECT geometry, osm_id,
name,
coalesce(name, name_de) as name_de,
coalesce(name, name_en) as name_en,
coalesce(name, name_es) as name_es,
coalesce(name, name_fr) as name_fr,
coalesce(name, name_ru) AS name_ru,
coalesce(name, name_zh) AS name_zh,
type, type as class
FROM osm_water_lines
WHERE type in ('drain', 'ditch')
AND z(!scale_denominator!) >= 15
AND linelabel(z(!scale_denominator!), name, geometry)
AND geometry && !bbox!
) AS data ) AS data
type: postgis type: postgis
user: osm user: osm