Go to the documentation of this file.
12 data_ = std::shared_ptr<OGRLineString>(
13 static_cast<OGRLineString*
>(
14 OGRGeometryFactory::createGeometry(wkbLineString)),
15 [](OGRLineString* f) {OGRGeometryFactory::destroyGeometry(f);});
19 for (
auto&& p :
ring) {
55 if (i >= this->
size()) {
56 throw std::out_of_range(
57 "Error getGeometry: LinearString does not contain point " +
64 if (i >= this->
size()) {
65 throw std::out_of_range(
66 "Error getGeometry: LinearString does not contain point " +
73 if (i >= this->
size()) {
74 throw std::out_of_range(
75 "Error getGeometry: LinearString does not contain point " +
79 data_->getPoint(i, &point);
84 if (i >= this->
size()) {
85 throw std::out_of_range(
86 "Error getGeometry: LinearString does not contain point " +
102 for (
auto&& p : *
this) {
108 data_->addPoint(x, y, z);
131 std::vector<double> dist;
132 std::vector<Point>
ps;
133 for (
size_t i = 0; i < this->
size() - 1; ++i) {
135 dist.emplace_back(
ps.back().distance(p));
137 return ps[std::min_element(dist.begin(), dist.end()) - dist.begin()];
double getX(size_t i) const
Point closestPointTo(const Point &p) const
Types used by fields2cover library.
void getGeometry(size_t i, Point &point)
double startAngle() const
void setGeometry(size_t i, const Point &p)
Point closestPointInSegment(const Point &seg_s, const Point &seg_e) const
double getZ(size_t i) const
void operator*=(double b)
void addGeometry(const Point &p)
const Point startPoint() const
void addPoint(double x, double y, double z=0)
double getY(size_t i) const
const Point endPoint() const
std::shared_ptr< OGRLineString > data_
std::string to_string(double d, const int precision=6)
fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31