PointGrid

Struct PointGrid 

Source
pub struct PointGrid<V: Interpolatable + Serialize + DeserializeOwned + Debug = RGBA, S: VectorStore<S2CellId, IndexPoint<V>> = Vector<S2CellId, IndexPoint<V>>, G: KVStore<S2CellId, Vec<V>> = KV<S2CellId, Vec<V>>> { /* private fields */ }
Expand description

§Grid Cluster

§Description

A cluster store to build grid data of grid_size x grid_size. The resultant tiles are filled. Useful for building raster tiles or other grid like data (temperature, precipitation, wind, etc).

Implementations§

Source§

impl<V: Interpolatable + Serialize + DeserializeOwned + Debug, S: VectorStore<S2CellId, IndexPoint<V>>, G: KVStore<S2CellId, Vec<V>>> PointGrid<V, S, G>

Source

pub fn new(options: Option<GridOptions<V>>) -> Self

Create a new point grid

Source

pub fn insert_point<T: GetXY>(&mut self, point: T, data: Option<V>)

Add a lon-lat pair as with any shape

Source

pub fn insert_lon_lat(&mut self, ll: LonLat<V>)

Add a lon-lat pair to the cluster

Source

pub fn insert_face_st(&mut self, face: Face, s: f64, t: f64, data: V)

Insert an STPoint to the index

Source

pub fn insert_reader<L: Clone, F: FeatureReader<L, V, V>>(&mut self, reader: &F)

Add all points from a reader. It will try to use the M-value first, but if it doesn’t exist it will use the feature properties data

Source

pub fn insert_feature<L: Clone>(&mut self, data: JSONCollection<L, V, V>)

Add a vector feature. It will try to use the M-value first, but if it doesn’t exist it will use the feature properties data

Source

pub fn get_tile(&self, id: S2CellId) -> Option<TileGrid<'_, V>>

Get the point data as a grid of a tile

Source

pub fn build_clusters(&mut self)

Build the grid cluster tiles

Trait Implementations§

Source§

impl<V: Debug + Interpolatable + Serialize + DeserializeOwned + Debug, S: Debug + VectorStore<S2CellId, IndexPoint<V>>, G: Debug + KVStore<S2CellId, Vec<V>>> Debug for PointGrid<V, S, G>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<V, S, G> Freeze for PointGrid<V, S, G>
where G: Freeze, S: Freeze,

§

impl<V, S, G> RefUnwindSafe for PointGrid<V, S, G>

§

impl<V, S, G> Send for PointGrid<V, S, G>
where G: Send, S: Send, V: Send,

§

impl<V, S, G> Sync for PointGrid<V, S, G>
where G: Sync, S: Sync, V: Sync,

§

impl<V, S, G> Unpin for PointGrid<V, S, G>
where G: Unpin, S: Unpin, V: Unpin,

§

impl<V, S, G> UnwindSafe for PointGrid<V, S, G>
where G: UnwindSafe, S: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V