| 43 | } |
| 44 | |
| 45 | void MultiLineString::append(const OGRGeometry* geom) { |
| 46 | if (wkbFlatten(geom->getGeometryType()) == |
| 47 | OGRwkbGeometryType::wkbLineString) { |
| 48 | if (!geom->IsEmpty()) { |
| 49 | data_->addGeometry(geom); |
| 50 | } |
| 51 | } else if (wkbFlatten(geom->getGeometryType()) == |
| 52 | OGRwkbGeometryType::wkbMultiLineString) { |
| 53 | for (auto&& line : *geom->toMultiLineString()) { |
| 54 | data_->addGeometry(line); |
| 55 | } |
| 56 | } else if (wkbFlatten(geom->getGeometryType()) == |
| 57 | OGRwkbGeometryType::wkbPolygon) { |
| 58 | for (auto&& ring : *geom->toPolygon()) { |
| 59 | data_->addGeometry(ring); |
| 60 | } |
| 61 | } else if (wkbFlatten(geom->getGeometryType()) == |
| 62 | OGRwkbGeometryType::wkbMultiPolygon) { |
| 63 | for (auto&& poly : *geom->toMultiPolygon()) { |
| 64 | for (auto&& ring : poly) { |
| 65 | data_->addGeometry(ring); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | void MultiLineString::getGeometry(size_t i, LineString& line) { |
| 72 | if (i >= this->size()) { |
no test coverage detected