Skip to content

Commit cf30555

Browse files
committed
removed comments, improved formatting
1 parent 047f3e0 commit cf30555

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed

src/geom-functions.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -378,51 +378,15 @@ double area(geometry_t const &geom)
378378
return std::abs(total);
379379
}
380380

381-
/*static double get_linestring_length(linestring_t const &linestring)
382-
{
383-
double total = 0.0;
384-
auto it = linestring.begin();
385-
auto prev = *it++;
386-
387-
while (it != linestring.end()) {
388-
auto const cur = *it;
389-
total += sqrt(pow(cur.x() - prev.x(), 2) + pow(cur.y() - prev.y(), 2));
390-
++it;
391-
}
392-
393-
return total;
394-
}*/
395-
396381
double length(geometry_t const &geom)
397382
{
398-
/* double total = 0.0;
399-
400-
if (geom.is_linestring()) {
401-
total = get_linestring_length(geom.get<linestring_t>());
402-
} else if (geom.is_multilinestring()) {
403-
for (auto const &linestring : geom.get<multilinestring_t>()) {
404-
total += get_linestring_length(linestring);
405-
}
406-
}
407-
408-
return total; */
409-
410383
return geom.visit(overloaded{
411384
[&](geom::nullgeom_t const & /*input*/) { return 0.0; },
412385
[&](geom::collection_t const &input) {
413386
double total = 0.0;
414-
/*auto it = input.begin();
415-
auto prev = *it++;
416-
while (it != input.end()) {
417-
auto const cur = *it;
418-
total += length(cur);
419-
++it;
420-
}*/
421-
422387
for (auto const &item : input) {
423388
total += length(item);
424389
}
425-
426390
return total;
427391
},
428392
[&](auto const &input) {

src/geom-functions.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ std::vector<geometry_t> split_multi(geometry_t &&geom, bool split_multi = true);
166166
* \param geom Input geometry.
167167
* \returns Length.
168168
**/
169-
170169
double length(geometry_t const &geom);
171170

172171
/**

0 commit comments

Comments
 (0)