Optimisations
This commit is contained in:
parent
66c2a25457
commit
9179acd4cd
21 changed files with 653 additions and 139 deletions
|
|
@ -69,7 +69,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
);
|
||||
|
||||
info!("Building spatial grid index (0.01° cells)");
|
||||
let grid = grid_index::GridIndex::build(&property_data.lat, &property_data.lon, 0.01);
|
||||
let grid = grid_index::GridIndex::build(&property_data.lat, &property_data.lon, consts::GRID_CELL_SIZE);
|
||||
|
||||
info!(
|
||||
"Precomputing H3 cells for resolutions {}-{}",
|
||||
|
|
@ -89,7 +89,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
info!(pois = poi_data.lat.len(), "POI data loaded");
|
||||
|
||||
info!("Building POI spatial grid index");
|
||||
let poi_grid = grid_index::GridIndex::build(&poi_data.lat, &poi_data.lng, 0.01);
|
||||
let poi_grid = grid_index::GridIndex::build(&poi_data.lat, &poi_data.lng, consts::GRID_CELL_SIZE);
|
||||
|
||||
let min_keys: Vec<String> = property_data
|
||||
.feature_names
|
||||
|
|
@ -116,11 +116,14 @@ async fn main() -> anyhow::Result<()> {
|
|||
let poi_category_groups = {
|
||||
let mut group_cats: std::collections::HashMap<String, std::collections::HashSet<String>> =
|
||||
std::collections::HashMap::new();
|
||||
for (category, group) in poi_data.category.iter().zip(poi_data.group.iter()) {
|
||||
let num_pois = poi_data.category.indices.len();
|
||||
for row in 0..num_pois {
|
||||
let category = poi_data.category.get(row).to_string();
|
||||
let group = poi_data.group.get(row).to_string();
|
||||
group_cats
|
||||
.entry(group.clone())
|
||||
.entry(group)
|
||||
.or_default()
|
||||
.insert(category.clone());
|
||||
.insert(category);
|
||||
}
|
||||
// Validate that data groups match the hardcoded order exactly
|
||||
let expected: std::collections::HashSet<&str> =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue