MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / append

Method append

src/fields2cover/types/MultiLineString.cpp:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void 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
71void MultiLineString::getGeometry(size_t i, LineString& line) {
72 if (i >= this->size()) {

Callers 1

MultiLineStringMethod · 0.95

Calls 1

addGeometryMethod · 0.45

Tested by

no test coverage detected