Fix crime & add actual listings
This commit is contained in:
parent
017902b8e6
commit
ebe7bbb51d
34 changed files with 2014 additions and 172754 deletions
|
|
@ -202,6 +202,10 @@ struct Cli {
|
|||
#[arg(long, env = "TRAVEL_TIMES")]
|
||||
travel_times: PathBuf,
|
||||
|
||||
/// Optional path to a parquet of live online listings (Rightmove etc.) to overlay on the map.
|
||||
#[arg(long, env = "ACTUAL_LISTINGS_PATH")]
|
||||
actual_listings_path: Option<PathBuf>,
|
||||
|
||||
/// Google Maps API key for Street View metadata lookups
|
||||
#[arg(long, env = "GOOGLE_MAPS_API_KEY")]
|
||||
google_maps_api_key: String,
|
||||
|
|
@ -531,6 +535,20 @@ async fn main() -> anyhow::Result<()> {
|
|||
let superuser_token_cache = Arc::new(pocketbase::SuperuserTokenCache::new());
|
||||
let share_cache = Arc::new(licensing::ShareBoundsCache::new());
|
||||
|
||||
let actual_listings = if let Some(path) = cli.actual_listings_path.as_ref() {
|
||||
if !path.exists() {
|
||||
bail!("Actual listings parquet not found: {}", path.display());
|
||||
}
|
||||
info!("Loading actual listings from {}", path.display());
|
||||
let listings = data::ActualListingData::load(path)?;
|
||||
trim_allocator("actual listings load");
|
||||
info!(rows = listings.lat.len(), "Actual listings loaded");
|
||||
Some(Arc::new(listings))
|
||||
} else {
|
||||
info!("ACTUAL_LISTINGS_PATH not set; live listings overlay disabled");
|
||||
None
|
||||
};
|
||||
|
||||
let app_state = AppState {
|
||||
data: property_data,
|
||||
grid,
|
||||
|
|
@ -556,6 +574,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
gemini_api_key: cli.gemini_api_key,
|
||||
gemini_model: cli.gemini_model,
|
||||
travel_time_store,
|
||||
actual_listings,
|
||||
token_cache,
|
||||
superuser_token_cache,
|
||||
share_cache,
|
||||
|
|
@ -617,6 +636,10 @@ async fn main() -> anyhow::Result<()> {
|
|||
"/api/pois",
|
||||
get(routes::get_pois).layer(ConcurrencyLimitLayer::new(20)),
|
||||
)
|
||||
.route(
|
||||
"/api/actual-listings",
|
||||
get(routes::get_actual_listings).layer(ConcurrencyLimitLayer::new(20)),
|
||||
)
|
||||
.route(
|
||||
"/api/poi-categories",
|
||||
get(routes::get_poi_categories).layer(ConcurrencyLimitLayer::new(20)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue