change data definiton for tile mapstyle of 'location' and 'team'
using Subquery/ nested SQL Qquery to only load those buildings, having at least a few collected data. The benefit is, that the mapstyle is not different for nodata buildings comparing different data categories. Now, if you compare nodata buildings in 'team' or 'location' with others, the stroke width is larger than the normal map style... loading only builidings with data avoids this problem of different map styles. It is a better and more performant solution than changing it in polygon.xml
see also c80f243c0d
This commit is contained in:
parent
d1d1e00cc2
commit
4dcd3de93a
@ -71,44 +71,52 @@ const LAYER_QUERIES = {
|
|||||||
WHERE
|
WHERE
|
||||||
construction_core_material IS NOT NULL`,
|
construction_core_material IS NOT NULL`,
|
||||||
location: `
|
location: `
|
||||||
SELECT
|
SELECT blds_with_data.*
|
||||||
geometry_id,
|
FROM (
|
||||||
(
|
SELECT
|
||||||
case when location_name IS NULL then 0 else 1 end +
|
geometry_id,
|
||||||
case when location_number IS NULL then 0 else 1 end +
|
(
|
||||||
case when location_street IS NULL then 0 else 1 end +
|
case when location_name IS NULL then 0 else 1 end +
|
||||||
case when location_line_two IS NULL then 0 else 1 end +
|
case when location_number IS NULL then 0 else 1 end +
|
||||||
case when location_town IS NULL then 0 else 1 end +
|
case when location_street IS NULL then 0 else 1 end +
|
||||||
case when location_postcode IS NULL then 0 else 1 end +
|
case when location_line_two IS NULL then 0 else 1 end +
|
||||||
case when location_latitude IS NULL then 0 else 1 end +
|
case when location_town IS NULL then 0 else 1 end +
|
||||||
case when location_longitude IS NULL then 0 else 1 end +
|
case when location_postcode IS NULL then 0 else 1 end +
|
||||||
case when ref_toid IS NULL then 0 else 1 end +
|
case when location_latitude IS NULL then 0 else 1 end +
|
||||||
case when ref_osm_id IS NULL then 0 else 1 end
|
case when location_longitude IS NULL then 0 else 1 end +
|
||||||
) AS location_info_count
|
case when ref_toid IS NULL then 0 else 1 end +
|
||||||
FROM
|
case when ref_osm_id IS NULL then 0 else 1 end
|
||||||
buildings`,
|
) AS location_info_count
|
||||||
|
FROM
|
||||||
|
buildings
|
||||||
|
) AS blds_with_data
|
||||||
|
WHERE blds_with_data.location_info_count > 0`,
|
||||||
team: `
|
team: `
|
||||||
SELECT
|
SELECT blds_with_data.*
|
||||||
geometry_id,
|
FROM (
|
||||||
(
|
SELECT
|
||||||
case when has_extension IS NULL then 0 else 1 end +
|
geometry_id,
|
||||||
case when extension_year IS NULL then 0 else 1 end +
|
(
|
||||||
case when developer_type IS NULL then 0 else 1 end +
|
case when has_extension IS NULL then 0 else 1 end +
|
||||||
case when developer_name IS NULL then 0 else 1 end +
|
case when extension_year IS NULL then 0 else 1 end +
|
||||||
case when developer_source_link IS NULL then 0 else 1 end +
|
case when developer_type IS NULL then 0 else 1 end +
|
||||||
case when designers IS NULL then 0 else 1 end +
|
case when developer_name IS NULL then 0 else 1 end +
|
||||||
case when designers_source_link IS NULL then 0 else 1 end +
|
case when developer_source_link IS NULL then 0 else 1 end +
|
||||||
case when lead_designer_type IS NULL then 0 else 1 end +
|
case when designers IS NULL then 0 else 1 end +
|
||||||
case when designer_awards IS NULL then 0 else 1 end +
|
case when designers_source_link IS NULL then 0 else 1 end +
|
||||||
case when awards_source_link IS NULL then 0 else 1 end +
|
case when lead_designer_type IS NULL then 0 else 1 end +
|
||||||
case when builder IS NULL then 0 else 1 end +
|
case when designer_awards IS NULL then 0 else 1 end +
|
||||||
case when builder_source_link IS NULL then 0 else 1 end +
|
case when awards_source_link IS NULL then 0 else 1 end +
|
||||||
case when other_team IS NULL then 0 else 1 end +
|
case when builder IS NULL then 0 else 1 end +
|
||||||
case when other_team_source_link IS NULL then 0 else 1 end +
|
case when builder_source_link IS NULL then 0 else 1 end +
|
||||||
case when date_year IS NULL then 0 else 1 end
|
case when other_team IS NULL then 0 else 1 end +
|
||||||
) AS team_info_count
|
case when other_team_source_link IS NULL then 0 else 1 end +
|
||||||
FROM
|
case when date_year IS NULL then 0 else 1 end
|
||||||
buildings`,
|
) AS team_info_count
|
||||||
|
FROM
|
||||||
|
buildings
|
||||||
|
) AS blds_with_data
|
||||||
|
WHERE blds_with_data.team_info_count > 0`,
|
||||||
is_domestic: `
|
is_domestic: `
|
||||||
SELECT
|
SELECT
|
||||||
geometry_id,
|
geometry_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user