Skip to content

Commit

Permalink
Merge pull request #1266 from colouring-cities/feature/new-map-keys
Browse files Browse the repository at this point in the history
Feature/new map keys
  • Loading branch information
mdsimpson42 authored Nov 3, 2023
2 parents 8a0bb98 + 25afb0a commit 5adca7f
Show file tree
Hide file tree
Showing 12 changed files with 374 additions and 51 deletions.
109 changes: 109 additions & 0 deletions app/map_styles/polygon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,4 +1345,113 @@
<LineSymbolizer stroke="#888" stroke-width="2.0"/>
</Rule>
</Style>
<Style name="context_back_garden">
<Rule>
<Filter>[context_back_garden] = true</Filter>
<PolygonSymbolizer fill="#7cbf39" />
</Rule>

<Rule>
<MaxScaleDenominator>17061</MaxScaleDenominator>
<MinScaleDenominator>4264</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="1.0"/>
</Rule>
<Rule>
<MaxScaleDenominator>4264</MaxScaleDenominator>
<MinScaleDenominator>0</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
</Rule>
</Style>
<Style name="designer_awards">
<Rule>
<Filter>[designer_awards] = true</Filter>
<PolygonSymbolizer fill="#f7ec25" />
</Rule>

<Rule>
<MaxScaleDenominator>17061</MaxScaleDenominator>
<MinScaleDenominator>4264</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="1.0"/>
</Rule>
<Rule>
<MaxScaleDenominator>4264</MaxScaleDenominator>
<MinScaleDenominator>0</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
</Rule>
</Style>
<Style name="energy_solar">
<Rule>
<Filter>[energy_solar] = true</Filter>
<PolygonSymbolizer fill="#6bb1e3" />
</Rule>

<Rule>
<MaxScaleDenominator>17061</MaxScaleDenominator>
<MinScaleDenominator>4264</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="1.0"/>
</Rule>
<Rule>
<MaxScaleDenominator>4264</MaxScaleDenominator>
<MinScaleDenominator>0</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
</Rule>
</Style>
<Style name="energy_green_roof">
<Rule>
<Filter>[energy_green_roof] = true</Filter>
<PolygonSymbolizer fill="#7cbf39" />
</Rule>

<Rule>
<MaxScaleDenominator>17061</MaxScaleDenominator>
<MinScaleDenominator>4264</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="1.0"/>
</Rule>
<Rule>
<MaxScaleDenominator>4264</MaxScaleDenominator>
<MinScaleDenominator>0</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
</Rule>
</Style>
<Style name="sust_aggregate_estimate_epc">
<Rule>
<Filter>[sust_aggregate_estimate_epc] = A</Filter>
<PolygonSymbolizer fill="#007f3d" />
</Rule>
<Rule>
<Filter>[sust_aggregate_estimate_epc] = B</Filter>
<PolygonSymbolizer fill="#2c9f29" />
</Rule>
<Rule>
<Filter>[sust_aggregate_estimate_epc] = C</Filter>
<PolygonSymbolizer fill="#9dcb3c" />
</Rule>
<Rule>
<Filter>[sust_aggregate_estimate_epc] = D</Filter>
<PolygonSymbolizer fill="#fff200" />
</Rule>
<Rule>
<Filter>[sust_aggregate_estimate_epc] = E</Filter>
<PolygonSymbolizer fill="#f7af1d" />
</Rule>
<Rule>
<Filter>[sust_aggregate_estimate_epc] = F</Filter>
<PolygonSymbolizer fill="#ed6823" />
</Rule>
<Rule>
<Filter>[sust_aggregate_estimate_epc] = G</Filter>
<PolygonSymbolizer fill="#e31d23" />
</Rule>

<Rule>
<MaxScaleDenominator>17061</MaxScaleDenominator>
<MinScaleDenominator>4264</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="1.0"/>
</Rule>
<Rule>
<MaxScaleDenominator>4264</MaxScaleDenominator>
<MinScaleDenominator>0</MinScaleDenominator>
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
</Rule>
</Style>
</Map>
4 changes: 4 additions & 0 deletions app/src/api/config/dataFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true
},
context_walkability_index : {
edit: true,
verify: true
},
context_pavement_width : {
edit: true,
verify: true
Expand Down
2 changes: 1 addition & 1 deletion app/src/cc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"initialZoomLevel": 16,

"postcode": "Postcode",
"energy_rating": "Building Research Establishment Environmental Assessment Method (BREEAM) rating"
"energy_rating": "Building Research Establishment Environmental Assessment Method (BREEAM) rating [<a href='https://bregroup.com/products/breeam/how-breeam-works'>More info</a>]"
}
13 changes: 3 additions & 10 deletions app/src/frontend/building/data-containers/energy-performance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ const SustainabilityView: React.FunctionComponent<CategoryViewProps> = (props) =
return (
<Fragment>
<DataEntryGroup name="Environmental quality rating" collapsed={subcat==null || subcat!="1"}>
<DataEntry
title="Official environmental quality rating"
slug=""
value=""
mode='view'
tooltip='Under development'
/>
</DataEntryGroup>
<DataEntryGroup name="Energy rating" collapsed={subcat==null || subcat!="2"}>
<SelectDataEntry
title={dataFields.sust_breeam_rating.title}
slug="sust_breeam_rating"
Expand All @@ -61,7 +52,9 @@ const SustainabilityView: React.FunctionComponent<CategoryViewProps> = (props) =
user_verified={props.user_verified.hasOwnProperty("sust_breeam_rating")}
user_verified_as={props.user_verified.sust_breeam_rating}
verified_count={props.building.verified.sust_breeam_rating}
/>
/>
</DataEntryGroup>
<DataEntryGroup name="Energy rating" collapsed={subcat==null || subcat!="2"}>
<SelectDataEntry
title={dataFields.sust_dec.title}
slug="sust_dec"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const StreetContextView: React.FunctionComponent<CategoryViewProps> = (props) =>
<DataEntryGroup name="Street/pavement" collapsed={subcat==null || subcat!="2"}>
<DataEntry
title="Walkability Index"
slug=""
slug="context_walkability_index"
value=""
mode='view'
tooltip='Under development'
Expand Down
179 changes: 145 additions & 34 deletions app/src/frontend/config/category-maps-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,76 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} =
{ color: '#980043', text: '≥152'}
]
},
},
{
mapStyle: 'size_total_floors',
legend: {
title: 'Total number of floors',
elements: [
{ color: '#f7f4f9', text: '1 - 5'},
{ color: '#e7e1ef', text: '6 - 10'},
{ color: '#d4b9da', text: '11 - 15'},
{ color: '#c994c7', text: '16 - 20'},
{ color: '#df65b0', text: '21 - 25'},
{ color: '#e7298a', text: '26 - 30'},
{ color: '#ce1256', text: '31 - 35'},
{ color: '#980043', text: '35 +'}
]
},
},
{
mapStyle: 'size_storeys_basement',
legend: {
title: 'Floors below ground level',
elements: [
{ color: '#f7f4f9', text: '1'},
{ color: '#d4b9da', text: '2'},
{ color: '#df65b0', text: '3'},
{ color: '#ce1256', text: '4+'},
]
},
},
{
mapStyle: 'size_floor_area_ground',
legend: {
title: 'Ground floor area',
elements: [
{ color: '#f7f4f9', text: '0 - 100'},
{ color: '#e7e1ef', text: '100 - 200'},
{ color: '#d4b9da', text: '200 - 300'},
{ color: '#c994c7', text: '300 - 400'},
{ color: '#df65b0', text: '400 - 500'},
{ color: '#e7298a', text: '500 +'},
]
},
}
],
[Category.Team]: [{
mapStyle: 'team',
legend: {
title: 'Team',
description: '% data collected',
elements: [
{ color: '#994d00', text: '≥80%' },
{ color: '#e67300', text: '60–80%' },
{ color: '#ff9933', text: '40–60%' },
{ color: '#ffbf80', text: '20–40%' },
{ color: '#ffe6cc', text: '<20%' }
]
[Category.Team]: [
{
mapStyle: 'team',
legend: {
title: 'Team',
description: '% data collected',
elements: [
{ color: '#994d00', text: '≥80%' },
{ color: '#e67300', text: '60–80%' },
{ color: '#ff9933', text: '40–60%' },
{ color: '#ffbf80', text: '20–40%' },
{ color: '#ffe6cc', text: '<20%' }
]
},
},
}],
{
mapStyle: 'designer_awards',
legend: {
title: 'Awards',
description: 'Has the building won any awards?',
elements: [
{color: '#f7ec25', text: 'Yes'},
]
},
},
],
[Category.Construction]: [
{
mapStyle: 'construction_core_material',
Expand Down Expand Up @@ -362,22 +416,60 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} =
},
}
],
[Category.EnergyPerformance]: [{
mapStyle: 'sust_dec',
legend: {
title: 'Sustainability',
description: 'DEC Rating',
elements: [
{ color: "#007f3d", text: 'A' },
{ color: "#2c9f29", text: 'B' },
{ color: "#9dcb3c", text: 'C' },
{ color: "#fff200", text: 'D' },
{ color: "#f7af1d", text: 'E' },
{ color: "#ed6823", text: 'F' },
{ color: "#e31d23", text: 'G' },
]
[Category.EnergyPerformance]: [
{
mapStyle: 'sust_dec',
legend: {
title: 'Energy rating (DEC)',
description: 'Non-domestic energy rating (DEC Rating)',
elements: [
{ color: "#007f3d", text: 'A' },
{ color: "#2c9f29", text: 'B' },
{ color: "#9dcb3c", text: 'C' },
{ color: "#fff200", text: 'D' },
{ color: "#f7af1d", text: 'E' },
{ color: "#ed6823", text: 'F' },
{ color: "#e31d23", text: 'G' },
]
},
},
}],
{
mapStyle: 'sust_aggregate_estimate_epc',
legend: {
title: 'Energy rating (EPC)',
description: 'Domestic energy rating (EPC Rating)',
elements: [
{ color: "#007f3d", text: 'A' },
{ color: "#2c9f29", text: 'B' },
{ color: "#9dcb3c", text: 'C' },
{ color: "#fff200", text: 'D' },
{ color: "#f7af1d", text: 'E' },
{ color: "#ed6823", text: 'F' },
{ color: "#e31d23", text: 'G' },
]
},
},
{
mapStyle: 'energy_solar',
legend: {
title: 'Solar panels',
description: 'Does the building have Solar Panels?',
elements: [
{color: '#6bb1e3', text: 'Yes'},
]
},
},
{
mapStyle: 'energy_green_roof',
legend: {
title: 'Green roof',
description: 'Does the building have a Green Roof?',
elements: [
{color: '#7cbf39', text: 'Yes'},
]
},
},
],
[Category.Typology]: [
{
mapStyle: 'typology_classification',
Expand Down Expand Up @@ -498,13 +590,32 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} =
}
}
],
[Category.StreetContext]: [{
mapStyle: undefined,
legend: {
title: 'Street Context',
elements: []
[Category.StreetContext]: [
{
mapStyle: 'context_back_garden',
legend: {
title: 'Back gardens',
description: 'Does the building have a back garden?',
elements: [
{color: '#7cbf39', text: 'Yes'},
]
},
},
}],
{
mapStyle: "context_walkability_index",
legend: {
title: 'Walkability Index',
elements: []
},
},
{
mapStyle: "context_street_width",
legend: {
title: 'Street width',
elements: []
},
}
],
[Category.Resilience]: [
{
mapStyle: 'disaster_severity',
Expand Down
8 changes: 7 additions & 1 deletion app/src/frontend/config/data-fields-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */

sust_breeam_rating: {
category: Category.EnergyPerformance,
title: "Residential energy rating",
title: "Official environmental quality rating",
tooltip: ccconfig.energy_rating,
example: "",
},
Expand Down Expand Up @@ -1758,6 +1758,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
tooltip: "Source link(s) for pavement width data",
example: ["", "", ""],
},
context_walkability_index: {
category: Category.Team,
title: "Walkability index",
tooltip: "How walkable is the area...?",
example: 10
},
context_green_space_distance: {
category: Category.Team,
title: "Distance to nearest green space (m)",
Expand Down
Loading

0 comments on commit 5adca7f

Please sign in to comment.