Support outcode & gps search

This commit is contained in:
Andras Schmelczer 2026-04-04 09:58:58 +01:00
parent 23d128ff63
commit 3853b5dce7
6 changed files with 188 additions and 3 deletions

View file

@ -243,6 +243,9 @@ async fn main() -> anyhow::Result<()> {
"Postcode boundaries loaded"
);
let outcode_data =
data::OutcodeData::from_postcode_and_place_data(&postcode_data, &place_data);
// Initialize tile reader
let tiles_path = &cli.tiles;
if !tiles_path.exists() {
@ -375,6 +378,7 @@ async fn main() -> anyhow::Result<()> {
poi_grid: Arc::new(poi_grid),
place_data: Arc::new(place_data),
postcode_data: Arc::new(postcode_data),
outcode_data: Arc::new(outcode_data),
feature_name_to_index,
min_keys,
max_keys,
@ -444,6 +448,7 @@ async fn main() -> anyhow::Result<()> {
get(routes::get_postcodes).layer(ConcurrencyLimitLayer::new(20)),
)
.route("/api/postcode/{postcode}", get(routes::get_postcode_lookup))
.route("/api/nearest-postcode", get(routes::get_nearest_postcode))
.route(
"/api/pois",
get(routes::get_pois).layer(ConcurrencyLimitLayer::new(20)),
@ -460,6 +465,7 @@ async fn main() -> anyhow::Result<()> {
"/api/hexagon-properties",
get(routes::get_hexagon_properties),
)
.route("/api/filter-counts", get(routes::get_filter_counts))
.route("/api/hexagon-stats", get(routes::get_hexagon_stats))
.route("/api/postcode-stats", get(routes::get_postcode_stats))
.route(