likes typology display
This commit is contained in:
parent
5431f8528e
commit
26a330f743
@ -664,6 +664,47 @@
|
||||
<LineSymbolizer stroke="#888" stroke-width="3.0"/>
|
||||
</Rule>
|
||||
</Style>
|
||||
<Style name="typology_likes">
|
||||
<Rule>
|
||||
<Filter>[likes] >= 100</Filter>
|
||||
<PolygonSymbolizer fill="#bd0026" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[likes] >= 50 and [likes] < 100</Filter>
|
||||
<PolygonSymbolizer fill="#e31a1c" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[likes] >= 20 and [likes] < 50</Filter>
|
||||
<PolygonSymbolizer fill="#fc4e2a" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[likes] >= 10 and [likes] < 20</Filter>
|
||||
<PolygonSymbolizer fill="#fd8d3c" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[likes] >= 3 and [likes] < 10</Filter>
|
||||
<PolygonSymbolizer fill="#feb24c" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[likes] = 2</Filter>
|
||||
<PolygonSymbolizer fill="#fed976" />
|
||||
</Rule>
|
||||
<Rule>
|
||||
<Filter>[likes] = 1</Filter>
|
||||
<PolygonSymbolizer fill="#ffe8a9" />
|
||||
</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="community_local_significance_total">
|
||||
<Rule>
|
||||
<Filter>[community_local_significance_total] >= 100</Filter>
|
||||
|
@ -19,6 +19,12 @@ export const aggregationsConfig: { [key in keyof typeof buildingUserAttributesCo
|
||||
aggregationMethod: 'countTrue'
|
||||
}
|
||||
],
|
||||
community_type_worth_keeping: [
|
||||
{
|
||||
aggregateFieldName: 'community_type_worth_keeping_total',
|
||||
aggregationMethod: 'countTrue'
|
||||
}
|
||||
],
|
||||
community_local_significance: [
|
||||
{
|
||||
aggregateFieldName: 'community_local_significance_total',
|
||||
|
@ -301,6 +301,11 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
|
||||
derivedEdit: true,
|
||||
verify: false
|
||||
},
|
||||
community_type_worth_keeping_total: {
|
||||
edit: false,
|
||||
derivedEdit: true,
|
||||
verify: false
|
||||
},
|
||||
community_local_significance_total: {
|
||||
edit: false,
|
||||
derivedEdit: true,
|
||||
|
@ -97,6 +97,7 @@ const withCopyEdit: (wc: React.ComponentType<CategoryViewProps>) => DataContaine
|
||||
'current_landuse_verified',
|
||||
'planning_list_grade',
|
||||
'likes_total',
|
||||
'community_type_worth_keeping_total',
|
||||
'community_local_significance_total',
|
||||
'community_expected_planning_application_total'
|
||||
]
|
||||
|
@ -28,6 +28,10 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
||||
e.preventDefault();
|
||||
props.onMapColourScale('likes')
|
||||
}
|
||||
const switchToTypologyMapStyle = (e) => {
|
||||
e.preventDefault();
|
||||
props.onMapColourScale('typology_likes')
|
||||
}
|
||||
const switchToLocalSignificanceMapStyle = (e) => {
|
||||
e.preventDefault();
|
||||
props.onMapColourScale('community_local_significance_total')
|
||||
@ -117,6 +121,9 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
||||
mode={props.mode}
|
||||
/>
|
||||
}
|
||||
<button className={`map-switcher-inline ${props.mapColourScale == "likes" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToTypologyMapStyle}>
|
||||
{(props.mapColourScale == "likes")? 'Showing likes for typologies (not about specific buildings)' : 'Click to see likes for typologies (not about specific buildings) mapped'}
|
||||
</button>
|
||||
|
||||
|
||||
<UserOpinionEntry
|
||||
|
@ -134,6 +134,21 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} =
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
mapStyle: 'typology_likes',
|
||||
legend: {
|
||||
title: 'Liked typologies',
|
||||
elements: [
|
||||
{ color: '#bd0026', text: '👍👍👍👍 100+' },
|
||||
{ color: '#e31a1c', text: '👍👍👍 50–99' },
|
||||
{ color: '#fc4e2a', text: '👍👍 20–49' },
|
||||
{ color: '#fd8d3c', text: '👍👍 10–19' },
|
||||
{ color: '#feb24c', text: '👍 3–9' },
|
||||
{ color: '#fed976', text: '👍 2' },
|
||||
{ color: '#ffe8a9', text: '👍 1'}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
mapStyle: 'community_local_significance_total',
|
||||
legend: {
|
||||
|
@ -583,7 +583,11 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
|
||||
example: 100,
|
||||
tooltip: "People who like the building and think it contributes to the city.",
|
||||
},
|
||||
|
||||
community_type_worth_keeping_total: {
|
||||
category: Category.Community,
|
||||
title: "People who think this type of building is contributes to the city.",
|
||||
example: 100,
|
||||
},
|
||||
community_local_significance_total: {
|
||||
category: Category.Community,
|
||||
title: "People who think the building should be recorded as one of local significance",
|
||||
|
@ -9,6 +9,7 @@ export type BuildingMapTileset = 'date_year' |
|
||||
'location' |
|
||||
'is_domestic' |
|
||||
'likes' |
|
||||
'typology_likes' |
|
||||
'community_local_significance_total' |
|
||||
'community_expected_planning_application_total' |
|
||||
'community_in_public_ownership' |
|
||||
|
@ -127,6 +127,14 @@ const LAYER_QUERIES = {
|
||||
is_domestic <> 'yes'
|
||||
AND
|
||||
likes_total > 0`,
|
||||
typology_likes: `
|
||||
SELECT
|
||||
geometry_id,
|
||||
community_type_worth_keeping_total AS likes
|
||||
FROM
|
||||
buildings
|
||||
WHERE
|
||||
community_type_worth_keeping_total > 0`,
|
||||
community_local_significance_total: `
|
||||
SELECT
|
||||
geometry_id,
|
||||
|
@ -55,6 +55,7 @@ COPY (SELECT
|
||||
planning_local_list_url,
|
||||
planning_historic_area_assessment_url,
|
||||
is_domestic,
|
||||
community_type_worth_keeping_total,
|
||||
likes_total
|
||||
FROM buildings)
|
||||
TO '/tmp/building_attributes.csv'
|
||||
|
@ -1 +1,2 @@
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS is_domestic;
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS community_type_worth_keeping_total;
|
||||
|
@ -1 +1,2 @@
|
||||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic text null;
|
||||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS community_type_worth_keeping_total integer DEFAULT 0;
|
||||
|
Loading…
Reference in New Issue
Block a user