Struct s2::cell::Cell[][src]

pub struct Cell {
    pub orientation: u8,
    pub id: CellID,
    pub uv: Rect,
    // some fields omitted
}

Cell is an S2 region object that represents a cell. Unlike CellIDs, it supports efficient containment and intersection tests. However, it is also a more expensive representation.

Fields

Methods

impl Cell
[src]

vertex returns the k-th vertex of the cell (k = 0,1,2,3) in CCW order (lower left, lower right, upper right, upper left in the UV plane).

edge returns the inward-facing normal of the great circle passing through the CCW ordered edge from vertex k to vertex k+1 (mod 4) (for k = 0,1,2,3).

bound_uv returns the bounds of this cell in (u,v)-space.

center returns the direction vector corresponding to the center in (s,t)-space of the given cell. This is the point at which the cell is divided into four subcells; it is not necessarily the centroid of the cell in (u,v)-space or (x,y,z)-space

Children returns the four direct children of this cell in traversal order and returns true. If this is a leaf cell, or the children could not be created, false is returned. The C++ method is called Subdivide.

exact_area returns the area of this cell as accurately as possible.

approx_area returns the approximate area of this cell. This method is accurate to within 3% percent for all cell sizes and accurate to within 0.1% for cells at level 5 or higher (i.e. squares 350km to a side or smaller on the Earth's surface). It is moderately cheap to compute.

average_area returns the average area of cells at the level of this cell. This is accurate to within a factor of 1.7.

latitude returns the latitude of the cell vertex given by (i,j), where "i" and "j" are either 0 or 1.

longitude returns the longitude of the cell vertex given by (i,j), where "i" and "j" are either 0 or 1.

rect_bound returns the bounding rectangle of this cell.

Trait Implementations

impl Debug for Cell
[src]

Formats the value using the given formatter. Read more

impl Clone for Cell
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> From<&'a CellID> for Cell
[src]

Performs the conversion.

impl From<CellID> for Cell
[src]

Performs the conversion.

impl<'a> From<&'a Point> for Cell
[src]

Performs the conversion.

impl From<Point> for Cell
[src]

Performs the conversion.

impl<'a> From<&'a LatLng> for Cell
[src]

Performs the conversion.

impl From<LatLng> for Cell
[src]

Performs the conversion.

impl<'a> From<&'a Cell> for CellID
[src]

Performs the conversion.

impl From<Cell> for CellID
[src]

Performs the conversion.

impl Region for Cell
[src]

cap_bound returns the bounding cap of this cell.

intersects_cell reports whether the intersection of this cell and the other cell is not nil.

contains_cell reports whether this cell contains the other cell.

rect_bound returns a bounding latitude-longitude rectangle that contains the region. The bounds are not guaranteed to be tight. Read more

Auto Trait Implementations

impl Send for Cell

impl Sync for Cell