Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rust/bambam-core/src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pub mod date_deserialization_ops;
pub mod geo_utils;
pub mod polygonal_rtree;
127 changes: 0 additions & 127 deletions rust/bambam-core/src/util/polygonal_rtree.rs

This file was deleted.

1 change: 0 additions & 1 deletion rust/bambam/src/app/oppvec/app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::SourceFormat;
use crate::util::polygonal_rtree::PolygonalRTree;
use csv::Reader;
use geo::{
triangulate_delaunay::DelaunayTriangulationConfig, Area, BoundingRect, Contains,
Expand Down
14 changes: 7 additions & 7 deletions rust/bambam/src/model/input_plugin/grid/grid_input_plugin.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use super::{extent_format::ExtentFormat, grid_type::GridType};
use crate::{
model::input_plugin::population::population_source::PopulationSource,
util::polygonal_rtree::PolygonalRTree,
};
use crate::model::input_plugin::population::population_source::PopulationSource;
use geo::{Area, Geometry};
use kdam::{Bar, BarExt};
use rayon::prelude::*;
use routee_compass::{
app::search::SearchApp,
plugin::input::{InputPlugin, InputPluginError},
};
use routee_compass_core::config::{CompassConfigurationError, ConfigJsonExtensions};
use routee_compass_core::{
config::{CompassConfigurationError, ConfigJsonExtensions},
util::geo::PolygonalRTree,
};
use serde_json::json;
use std::{
collections::LinkedList,
Expand Down Expand Up @@ -241,7 +241,7 @@ fn add_population_source(
/// perform a uniform (dis) aggregation from the source data.
fn get_query_population_proportion(
row: &serde_json::Value,
population: &PolygonalRTree<f64>,
population_rtree: &PolygonalRTree<f64, f64>,
) -> Result<f64, String> {
let wkt_string = row.get_config_string(&super::GEOMETRY, &"").map_err(|e| {
format!(
Expand All @@ -252,7 +252,7 @@ fn get_query_population_proportion(
})?;
let geometry = Geometry::try_from_wkt_str(&wkt_string)
.map_err(|e| format!("internal error, expected {} is WKT: {}", super::GEOMETRY, e))?;
let intersecting = population.intersection_with_overlap_area(&geometry)?;
let intersecting = population_rtree.intersection_with_overlap_area(&geometry)?;

let mut population = 0.0;
for (node, overlap_area) in intersecting.iter() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
use crate::{model::input_plugin::grid, util::polygonal_rtree::PolygonalRTree};
use std::collections::HashSet;

use bamcensus::app::acs_tiger::{self, AcsTigerResponse};
use bamcensus_acs::model::{AcsApiQueryParams, AcsGeoidQuery, AcsType};
use bamcensus_core::model::identifier::{Geoid, GeoidType};
use geo::Geometry;
use itertools::Itertools;
use kdam::{tqdm, Bar, BarExt};
use routee_compass_core::config::ConfigJsonExtensions;
use std::collections::HashSet;
use wkt::TryFromWkt;
use routee_compass_core::util::geo::PolygonalRTree;

pub enum PopulationSource {
UsCensusAcs {
states: PolygonalRTree<Geoid>,
states: PolygonalRTree<f64, Geoid>,
acs_type: AcsType,
acs_year: u64,
acs_resolution: Option<GeoidType>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::util::polygonal_rtree::PolygonalRTree;
use bamcensus_core::model::identifier::Geoid;
use flate2::read::GzDecoder;
use geo::Geometry;
use routee_compass_core::util::geo::PolygonalRTree;
use std::io::Read;

pub fn load() -> Result<PolygonalRTree<Geoid>, String> {
pub fn load() -> Result<PolygonalRTree<f64, Geoid>, String> {
// source: https://www2.census.gov/geo/tiger/TIGER2023/STATE/tl_2023_us_state.zip
// shapefile loaded in GeoPandas, written to file using df.to_json() method. removed
// any entries with FIPS Geoids that do not occur in the Tiger/LINES datasets,
Expand Down
1 change: 0 additions & 1 deletion rust/bambam/src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pub mod date_deserialization_ops;
pub mod geo_utils;
pub mod polygonal_rtree;
127 changes: 0 additions & 127 deletions rust/bambam/src/util/polygonal_rtree.rs

This file was deleted.

Loading