Struct LineString

Inheritance Relationships

Base Type

Struct Documentation

struct LineString : public f2c::types::Geometries<LineString, OGRLineString, wkbLineString, Point>

Public Functions

LineString()
explicit LineString(const LinearRing &ring)
explicit LineString(const std::vector<Point> &ps)
explicit LineString(const Point &p1, const Point &p2)
explicit LineString(const std::initializer_list<Point> &ps)
void operator*=(double b)
double X(size_t i) const
double Y(size_t i) const
double Z(size_t i) const
double getX(size_t i) const
double getY(size_t i) const
double getZ(size_t i) const
double length() const
void reversePoints()
size_t size() const
void getGeometry(size_t i, Point &point)
void getGeometry(size_t i, Point &point) const
Point getGeometry(size_t i)
const Point getGeometry(size_t i) const
void setGeometry(size_t i, const Point &p)
void addPoint(double x, double y, double z = 0)
void addPoint(const Point &p)
void addGeometry(const Point &p)
const Point startPoint() const
double startAngle() const
const Point endPoint() const
double endAngle() const
Point closestPointTo(const Point &p) const
double area() const

Compute area of the geometry.

LineString clone() const
LineString simplify(double d_tol) const
Iterator begin()
ConstIterator begin() const
ConstIterator begin(const LineString *poSelf)
Iterator end()
ConstIterator end() const
ConstIterator end(const LineString *poSelf)
const Point operator[](int i) const
const Point at(int i) const
const Point back() const
LineString &append(const LineString &other)
std::shared_ptr<OGRLineString> operator->()
std::shared_ptr<const OGRLineString> operator->() const
OGRLineString *get()
const OGRLineString *get() const
bool operator!=(const Geometry<OGRLineString, R> &geom2) const
bool operator==(const Geometry<OGRLineString, 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 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.