lgtm
Some checks failed
Build and publish Docker image / build-and-push (push) Successful in 18m12s
CI / Check (push) Failing after 23m38s

This commit is contained in:
Andras Schmelczer 2026-06-22 22:12:27 +01:00
parent f7e0814a38
commit fd2860070a
55 changed files with 4084 additions and 186 deletions

View file

@ -217,6 +217,16 @@ pub async fn get_postcode_stats(
stats::crime_latest_available_year(&state.crime_by_year)
};
let (crime_outcode, crime_sector, crime_area_averages) = stats::area_crime_averages_for(
Some(postcode_str.as_str()),
&state.area_crime_averages,
fields_specified,
&field_set,
);
// Usual residents (Census 2021) for this postcode. Display-only.
let population = state.population.for_postcode(&postcode_str);
Ok(HexagonStatsResponse {
count: total_count,
numeric_features,
@ -224,7 +234,11 @@ pub async fn get_postcode_stats(
price_history,
crime_by_year,
crime_latest_year,
crime_outcode,
crime_sector,
crime_area_averages,
central_postcode: None,
population,
filter_exclusions,
})
})