12 data_ = std::shared_ptr<OGRMultiLineString>(
static_cast<OGRMultiLineString*
>(
13 OGRGeometryFactory::createGeometry(wkbMultiLineString)),
14 [](OGRMultiLineString* f) {OGRGeometryFactory::destroyGeometry(f);});
26 for (
auto&& line : ls) {
36 return this->
data_->get_Length();
40 for (
auto&& r : *
this) {
46 if (wkbFlatten(geom->getGeometryType()) ==
47 OGRwkbGeometryType::wkbLineString) {
48 if (!geom->IsEmpty()) {
49 data_->addGeometry(geom);
51 }
else if (wkbFlatten(geom->getGeometryType()) ==
52 OGRwkbGeometryType::wkbMultiLineString) {
53 for (
auto&& line : *geom->toMultiLineString()) {
54 data_->addGeometry(line);
56 }
else if (wkbFlatten(geom->getGeometryType()) ==
57 OGRwkbGeometryType::wkbPolygon) {
58 for (
auto&&
ring : *geom->toPolygon()) {
61 }
else if (wkbFlatten(geom->getGeometryType()) ==
62 OGRwkbGeometryType::wkbMultiPolygon) {
63 for (
auto&& poly : *geom->toMultiPolygon()) {
64 for (
auto&&
ring : poly) {
72 if (i >= this->
size()) {
73 throw std::out_of_range(
80 if (i >= this->
size()) {
81 throw std::out_of_range(
88 if (i >= this->
size()) {
89 throw std::out_of_range(
96 if (i >= this->
size()) {
97 throw std::out_of_range(
104 auto n = this->
size();
107 for (
size_t j = 0; j < n; ++j) {
113 for (
size_t j = n; j < i; ++j) {
121 this->
data_->addGeometry(line.
get());
125 for (
auto&& line :
lines) {
132 for (
size_t i = 0; i < line.
size()-1; ++i) {