Go to the documentation of this file.
13 this->
data_ = std::shared_ptr<OGRLinearRing>(
14 static_cast<OGRLinearRing*
>(
15 OGRGeometryFactory::createGeometry(wkbLinearRing)),
16 [](OGRLinearRing* f) {OGRGeometryFactory::destroyGeometry(f);});
32 for (
auto&& p : *
this) {
38 return this->
data_->getX(i);
42 return this->
data_->getY(i);
45 return this->
data_->getZ(i);
48 return this->
data_->get_Length();
52 this->
data_->reversePoints();
60 if (i >= this->
size()) {
61 throw std::out_of_range(
62 "Error getGeometry: LinearRing does not contain point " +
69 if (i >= this->
size()) {
70 throw std::out_of_range(
71 "Error getGeometry: LinearRing does not contain point " +
78 if (i >= this->
size()) {
79 throw std::out_of_range(
80 "Error getGeometry: LinearRing does not contain point " +
84 data_->getPoint(i, &point);
89 if (i >= this->
size()) {
90 throw std::out_of_range(
91 "Error getGeometry: LinearRing does not contain point " +
106 data_->addPoint(x, y, z);
122 return data_->isClockwise();
126 return data_->IsEmpty() ||
data_->get_IsClosed();
137 std::vector<double> dist;
138 std::vector<Point>
ps;
139 for (
size_t i = 0; i < this->
size() - 1; ++i) {
141 dist.emplace_back(
ps.back().distance(p));
143 return ps[std::min_element(dist.begin(), dist.end()) - dist.begin()];
double getX(size_t i) const
Types used by fields2cover library.
double getZ(size_t i) const
void setGeometry(size_t i, const Point &p)
double getY(size_t i) const
Point closestPointInSegment(const Point &seg_s, const Point &seg_e) const
void addPoint(double x, double y, double z=0)
const Point startPoint() const
void getGeometry(size_t i, Point &point)
void addGeometry(const Point &p)
Point closestPointTo(const Point &p) const
const Point endPoint() const
std::shared_ptr< OGRLinearRing > data_
void operator*=(double b)
std::string to_string(double d, const int precision=6)
fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31