[geos-commits] [SCM] GEOS branch master updated. fd9aa9062d9ec887a5a666faf95ae7fde12ff646
git at osgeo.org
git at osgeo.org
Wed Jan 13 09:44:14 PST 2021
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, master has been updated
via fd9aa9062d9ec887a5a666faf95ae7fde12ff646 (commit)
from 01b43da11c8a042b1b9e70a0283a6c1e3c73707a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fd9aa9062d9ec887a5a666faf95ae7fde12ff646
Author: Martin Davis <mtnclimb at gmail.com>
Date: Wed Jan 13 09:44:08 2021 -0800
Improve geosop number formatting
diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index 6472477..ce30bf7 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -157,7 +157,7 @@ GeosOp::GeosOp(GeosOpArgs& arg)
GeosOp::~GeosOp() {
}
-std::string timeFormatted(int n)
+std::string formatNum(int n)
{
auto fmt = std::to_string(n);
int insertPosition = static_cast<int>(fmt.length()) - 3;
@@ -165,7 +165,7 @@ std::string timeFormatted(int n)
fmt.insert(insertPosition, ",");
insertPosition-=3;
}
- return fmt + " usec";
+ return fmt ;
}
std::vector<std::unique_ptr<Geometry>> collect( std::vector<std::unique_ptr<Geometry>>& geoms ) {
@@ -282,8 +282,8 @@ GeosOp::readInput(std::string name, std::string src, int limit) {
}
std::string geomStats(int geomCount, int geomVertices) {
- return std::to_string(geomCount) + " geometries, "
- + std::to_string(geomVertices) + " vertices";
+ return formatNum( geomCount) + " geometries, "
+ + formatNum( geomVertices) + " vertices";
}
std::string summaryStats(std::vector<std::unique_ptr<Geometry>>& geoms) {
@@ -307,7 +307,7 @@ GeosOp::loadInput(std::string name, std::string src, int limit) {
auto geoms = readInput( name, src, limit );
sw.stop();
auto stats = summaryStats(geoms);
- log("Read " + stats + " -- " + timeFormatted( sw.getTot() ));
+ log("Read " + stats + " -- " + formatNum( sw.getTot() ) + " usec");
return geoms;
}
@@ -333,9 +333,9 @@ void GeosOp::run() {
if (args.isShowTime || args.isVerbose) {
std::cout
- << "Processed " << opCount << " " << args.opName << " ops ( "
- << vertexCount << " vertices)"
- << " -- " << timeFormatted( totalTime )
+ << "Processed " << formatNum( opCount ) << " " << args.opName << " ops ( "
+ << formatNum( vertexCount ) << " vertices)"
+ << " -- " << formatNum( totalTime ) << " usec"
<< " (GEOS " << geosversion() << ")"
<< std::endl;
}
@@ -431,7 +431,7 @@ Result* GeosOp::executeOp(GeomFunction * fun,
+ inputDesc("A", indexA, geomA) + " "
+ inputDesc("B", indexB, geomB)
+ " -> " + result->metadata()
- + " -- " + timeFormatted( time )
+ + " -- " + formatNum( time ) + " usec"
);
}
-----------------------------------------------------------------------
Summary of changes:
util/geosop/GeosOp.cpp | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list