add team_info_count to deteermin colour

This commit is contained in:
Ed Chalstrey 2022-06-10 14:45:39 +01:00
parent 1642c2c8fb
commit 56abebf4de
2 changed files with 26 additions and 5 deletions

View File

@ -81,23 +81,23 @@
</Style>
<Style name="team">
<Rule>
<Filter>[location_info_count] &gt;= 8</Filter>
<Filter>[team_info_count] &gt;= 8</Filter>
<PolygonSymbolizer fill="#994d00" />
</Rule>
<Rule>
<Filter>[location_info_count] &gt;= 6 and [location_info_count] &lt; 8</Filter>
<Filter>[team_info_count] &gt;= 6 and [location_info_count] &lt; 8</Filter>
<PolygonSymbolizer fill="#e67300" />
</Rule>
<Rule>
<Filter>[location_info_count] &gt;= 4 and [location_info_count] &lt; 6</Filter>
<Filter>[team_info_count] &gt;= 4 and [location_info_count] &lt; 6</Filter>
<PolygonSymbolizer fill="#ff9933" />
</Rule>
<Rule>
<Filter>[location_info_count] &gt;= 2 and [location_info_count] &lt; 4</Filter>
<Filter>[team_info_count] &gt;= 2 and [location_info_count] &lt; 4</Filter>
<PolygonSymbolizer fill="#ffbf80" />
</Rule>
<Rule>
<Filter>[location_info_count] &gt; 0 and [location_info_count] &lt; 2</Filter>
<Filter>[team_info_count] &gt; 0 and [location_info_count] &lt; 2</Filter>
<PolygonSymbolizer fill="#ffe6cc" />
</Rule>

View File

@ -76,6 +76,27 @@ const LAYER_QUERIES = {
) AS location_info_count
FROM
buildings`,
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
) AS team_info_count
FROM
buildings`,
likes: `
SELECT
geometry_id,