Struct Cell

Inheritance Relationships

Base Type

Struct Documentation

struct Cell : public f2c::types::Geometries<Cell, OGRPolygon, wkbPolygon, LinearRing>

Public Functions

Cell()
explicit Cell(const OGRGeometry *geom)
explicit Cell(const f2c::types::LinearRing &ring)
~Cell() = default
void getGeometry(size_t i, LinearRing &ring)
void getGeometry(size_t i, LinearRing &ring) const
LinearRing getGeometry(size_t i)
const LinearRing getGeometry(size_t i) const
void setGeometry(size_t i, const LinearRing &ring)
size_t size() const
void operator*=(double b)

Scale this Cell by a scale factor.

Cell convexHull() const
void addRing(const LinearRing &ring)
void addGeometry(const LinearRing &ring)
const LinearRing getExteriorRing() const
const LinearRing getInteriorRing(size_t i_ring) const
bool isConvex() const

Check if the Cell is convex.

LineString createSemiLongLine(const Point &point, double angle) const

Get a line that starts from a custom point with a custom angle.

If the point is in this geometry, the line crosses the border.

LineString createStraightLongLine(const Point &point, double angle) const

Get a line that goes through a custom point with a custom angle.

If the point is in this geometry, the line also crosses it.

MultiLineString getLinesInside(const LineString &line) const

Compute the sections of a LineString that is inside this cell.

MultiLineString getLinesInside(const MultiLineString &lines) const

Compute the sections of a MultiLineString that is inside this cell.

bool isPointInBorder(const Point &p) const

Check if a point is in the border of this cell.

bool isPointIn(const Point &p) const

Check if a point is inside this cell.

LineString createLineUntilBorder(const Point &p, double ang) const

Generate a line from a point to the border of this cell.

Point closestPointOnBorderTo(const Point &p) const

Find the closest point from a point to the border of the field.

double area() const

Compute area of the geometry.

Cell clone() const
Cell simplify(double d_tol) const
Iterator begin()
ConstIterator begin() const
ConstIterator begin(const Cell *poSelf)
Iterator end()
ConstIterator end() const
ConstIterator end(const Cell *poSelf)
const LinearRing operator[](int i) const
const LinearRing at(int i) const
const LinearRing back() const
Cell &append(const Cell &other)
std::shared_ptr<OGRPolygon> operator->()
std::shared_ptr<const OGRPolygon> operator->() const
OGRPolygon *get()
const OGRPolygon *get() const
bool operator!=(const Geometry<OGRPolygon, R> &geom2) const
bool operator==(const Geometry<OGRPolygon, R> &geom2) const
double getDimMinX() const

Get the minimum x value of the geometry.

double getDimMaxX() const

Get the maximum x value of the geometry.

double getDimMinY() const

Get the minimum y value of the geometry.

double getDimMaxY() const

Get the maximum y value of the geometry.

double getHeight() const

Get the height of the geometry.

double getWidth() const

Get the width of the geometry.

double getMinSafeLength() const

Get the manhattan distance of the diagonal of the rectangle that cover the geometry.

A circle from any point of the geometry and with this distance as radius can be created and it will, at least, crosses the geometry.

double distance(const Geometry<T2, R2> &p) const

Compute shortest distance between this and another geometry.

bool disjoint(const Geometry<T2, R2> &geom) const

Check if this and another geometry are disjoint.

bool crosses(const Geometry<T2, R2> &geom) const

Check if this and another geometry cross.

bool touches(const Geometry<T2, R2> &geom) const

Check if this and another geometry touch each other.

bool within(const Geometry<T2, R2> &geom) const

Check if this geometry is inside another geometry.

bool intersects(const Geometry<T2, R2> &geom) const

Check if this and another geometry intersects.

bool isEmpty() const
std::string exportToWkt() const
void importFromWkt(const std::string &text)
std::string exportToGML() const
std::string exportToKML() const
std::string exportToJson() const
OGRGeometry *OGRBuffer(double dfDist, int side = 0) const

Public Static Functions

static Cell buffer(const Cell &geom, double width)
static Cell buffer(const LineString &geom, double width)
static Cell buffer(const LinearRing &ring, double width)
static Cell buffer(const Point &geom, double width)
template<class T, OGRwkbGeometryType R>
static Cell convexHull(const Geometry<T, R> &geom)
static double mod_2pi(double val)

Transform from \( [-\inf, \inf) \) to \( [0, 2\pi) \) applying \(2\pi\) modulus.

Returns:

value modulus in the range of \( [0, 2\pi) \)

static double mod(double a, double b)
static double getAngContinuity(double prev_val, double val)
static std::vector<double> getAngContinuity(const std::vector<double> &val)
static double getAngleDiffAbs(double a, double b)

Compute the smallest difference between two angles.

Parameters:
  • a – first angle

  • b – second angle

Returns:

difference between both angles

static double getAngleAvg(double a, double b)

Get the angle that is between a and b in the shortest direction.