From a382f9246a73ad053de7a64ce22ee5f81dcacda9 Mon Sep 17 00:00:00 2001 From: Maximilian Ammann Date: Tue, 5 Apr 2022 21:10:24 +0200 Subject: [PATCH] Rename struct --- src/io/geometry_index.rs | 26 +++++++++++++------------- src/io/scheduler.rs | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/io/geometry_index.rs b/src/io/geometry_index.rs index 0cdfa56e..da5dddcc 100644 --- a/src/io/geometry_index.rs +++ b/src/io/geometry_index.rs @@ -34,7 +34,7 @@ impl GeometryIndex { world_coords: &WorldCoords, z: u8, zoom: f64, - ) -> Option>> { + ) -> Option>> { let world_tile_coords = world_coords.into_world_tile(z, zoom); if let Some(index) = world_tile_coords @@ -56,12 +56,12 @@ impl GeometryIndex { } pub enum TileIndex { - Spatial { tree: RTree> }, - Linear { list: Vec> }, + Spatial { tree: RTree> }, + Linear { list: Vec> }, } impl TileIndex { - pub fn point_query(&self, inner_coords: InnerCoords) -> Vec<&IndexGeometry> { + pub fn point_query(&self, inner_coords: InnerCoords) -> Vec<&IndexedGeometry> { let point = geo_types::Point::new(inner_coords.x, inner_coords.y); let coordinate: Coordinate<_> = point.into(); @@ -86,7 +86,7 @@ impl TileIndex { } #[derive(Debug, Clone)] -pub struct IndexGeometry +pub struct IndexedGeometry where T: CoordFloat + Bounded + Signed, { @@ -104,7 +104,7 @@ where LineString(LineString), } -impl IndexGeometry +impl IndexedGeometry where T: CoordFloat + Bounded + Signed + PartialOrd, { @@ -131,7 +131,7 @@ where } } -impl RTreeObject for IndexGeometry +impl RTreeObject for IndexedGeometry where T: CoordFloat + Bounded + Signed + PartialOrd, { @@ -142,7 +142,7 @@ where } } -impl PointDistance for IndexGeometry +impl PointDistance for IndexedGeometry where T: CoordFloat + Bounded + Signed + PartialOrd, { @@ -160,7 +160,7 @@ where pub struct IndexProcessor { geo_writer: GeoWriter, - geometries: Vec>, + geometries: Vec>, properties: Option>, } @@ -173,11 +173,11 @@ impl IndexProcessor { } } - pub fn build_tree(self) -> RTree> { + pub fn build_tree(self) -> RTree> { RTree::bulk_load(self.geometries) } - pub fn get_geometries(self) -> Vec> { + pub fn get_geometries(self) -> Vec> { self.geometries } } @@ -271,10 +271,10 @@ impl FeatureProcessor for IndexProcessor { match geometry { Geometry::Polygon(polygon) => self.geometries.push( - IndexGeometry::from_polygon(polygon, self.properties.take().unwrap()).unwrap(), + IndexedGeometry::from_polygon(polygon, self.properties.take().unwrap()).unwrap(), ), Geometry::LineString(linestring) => self.geometries.push( - IndexGeometry::from_linestring(linestring, self.properties.take().unwrap()) + IndexedGeometry::from_linestring(linestring, self.properties.take().unwrap()) .unwrap(), ), _ => {} diff --git a/src/io/scheduler.rs b/src/io/scheduler.rs index 686e8a84..ca77cd90 100644 --- a/src/io/scheduler.rs +++ b/src/io/scheduler.rs @@ -18,7 +18,7 @@ use crate::io::{ }; use crate::error::Error; -use crate::io::geometry_index::{GeometryIndex, IndexGeometry, IndexProcessor, TileIndex}; +use crate::io::geometry_index::{GeometryIndex, IndexProcessor, IndexedGeometry, TileIndex}; use crate::io::source_client::{HttpSourceClient, SourceClient}; use crate::io::tile_request_state::TileRequestState; use crate::tessellation::Tessellated; @@ -168,7 +168,7 @@ impl ThreadLocalState { world_coords: &WorldCoords, z: u8, zoom: f64, - ) -> Option>> { + ) -> Option>> { if let Ok(mut geometry_index) = self.geometry_index.lock() { geometry_index .query_point(world_coords, z, zoom) @@ -177,7 +177,7 @@ impl ThreadLocalState { .iter() .cloned() .cloned() - .collect::>>() + .collect::>>() }) } else { unimplemented!()