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:
traveller195 2023-03-08 15:30:39 +01:00 committed by GitHub
parent d1d1e00cc2
commit 4dcd3de93a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,44 +71,52 @@ const LAYER_QUERIES = {
WHERE
construction_core_material IS NOT NULL`,
location: `
SELECT
geometry_id,
(
case when location_name IS NULL then 0 else 1 end +
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_line_two IS NULL then 0 else 1 end +
case when location_town IS NULL then 0 else 1 end +
case when location_postcode IS NULL then 0 else 1 end +
case when location_latitude IS NULL then 0 else 1 end +
case when location_longitude IS NULL then 0 else 1 end +
case when ref_toid IS NULL then 0 else 1 end +
case when ref_osm_id IS NULL then 0 else 1 end
) AS location_info_count
FROM
buildings`,
SELECT blds_with_data.*
FROM (
SELECT
geometry_id,
(
case when location_name IS NULL then 0 else 1 end +
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_line_two IS NULL then 0 else 1 end +
case when location_town IS NULL then 0 else 1 end +
case when location_postcode IS NULL then 0 else 1 end +
case when location_latitude IS NULL then 0 else 1 end +
case when location_longitude IS NULL then 0 else 1 end +
case when ref_toid IS NULL then 0 else 1 end +
case when ref_osm_id IS NULL then 0 else 1 end
) AS location_info_count
FROM
buildings
) AS blds_with_data
WHERE blds_with_data.location_info_count > 0`,
team: `
SELECT
geometry_id,
(
case when has_extension IS NULL then 0 else 1 end +
case when extension_year IS NULL then 0 else 1 end +
case when developer_type IS NULL then 0 else 1 end +
case when developer_name IS NULL then 0 else 1 end +
case when developer_source_link IS NULL then 0 else 1 end +
case when designers IS NULL then 0 else 1 end +
case when designers_source_link IS NULL then 0 else 1 end +
case when lead_designer_type IS NULL then 0 else 1 end +
case when designer_awards IS NULL then 0 else 1 end +
case when awards_source_link IS NULL then 0 else 1 end +
case when builder IS NULL then 0 else 1 end +
case when builder_source_link IS NULL then 0 else 1 end +
case when other_team IS NULL then 0 else 1 end +
case when other_team_source_link IS NULL then 0 else 1 end +
case when date_year IS NULL then 0 else 1 end
) AS team_info_count
FROM
buildings`,
SELECT blds_with_data.*
FROM (
SELECT
geometry_id,
(
case when has_extension IS NULL then 0 else 1 end +
case when extension_year IS NULL then 0 else 1 end +
case when developer_type IS NULL then 0 else 1 end +
case when developer_name IS NULL then 0 else 1 end +
case when developer_source_link IS NULL then 0 else 1 end +
case when designers IS NULL then 0 else 1 end +
case when designers_source_link IS NULL then 0 else 1 end +
case when lead_designer_type IS NULL then 0 else 1 end +
case when designer_awards IS NULL then 0 else 1 end +
case when awards_source_link IS NULL then 0 else 1 end +
case when builder IS NULL then 0 else 1 end +
case when builder_source_link IS NULL then 0 else 1 end +
case when other_team IS NULL then 0 else 1 end +
case when other_team_source_link IS NULL then 0 else 1 end +
case when date_year IS NULL then 0 else 1 end
) AS team_info_count
FROM
buildings
) AS blds_with_data
WHERE blds_with_data.team_info_count > 0`,
is_domestic: `
SELECT
geometry_id,