diff --git a/hoot-core-test/src/test/cpp/hoot/core/TestUtils.h b/hoot-core-test/src/test/cpp/hoot/core/TestUtils.h index 6630d6d3e5..43bdeab094 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/TestUtils.h +++ b/hoot-core-test/src/test/cpp/hoot/core/TestUtils.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef TESTUTILS_H @@ -263,10 +263,12 @@ class HootTestFixture : public CppUnit::TestFixture ResetAll }; - /** Constructor to set the paths, default reset to none, and create the output path if needed */ + /** Constructor to set the paths to begin with $HOOT_HOME if used, default reset to none, + * and create the output path if needed + */ HootTestFixture(const QString& inputPath = UNUSED_PATH, const QString& outputPath = UNUSED_PATH) - : _inputPath(inputPath), - _outputPath(outputPath), + : _inputPath((inputPath != UNUSED_PATH) ? ConfPath::getHootHome() + "/" + inputPath : inputPath), + _outputPath((outputPath != UNUSED_PATH) ? ConfPath::getHootHome() + "/" + outputPath : outputPath), _reset(ResetNone) { if (outputPath != UNUSED_PATH) diff --git a/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp index 9f12eb88cd..17d0dc873a 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/schema/OsmSchemaTest.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot @@ -247,8 +247,6 @@ class OsmSchemaTest : public HootTestFixture */ void loadTest() { - QString hootHome(getenv("HOOT_HOME")); - OsmSchema& uut = OsmSchema::getInstance(); QFile fp("tmp/schema.dot"); diff --git a/hoot-core/src/main/cpp/hoot/core/Hoot.cpp b/hoot-core/src/main/cpp/hoot/core/Hoot.cpp index ed229ba93c..8ce7c286f4 100644 --- a/hoot-core/src/main/cpp/hoot/core/Hoot.cpp +++ b/hoot-core/src/main/cpp/hoot/core/Hoot.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "Hoot.h" @@ -36,8 +36,9 @@ #include // hoot -#include #include +#include +#include #include #include #include @@ -85,7 +86,7 @@ void Hoot::_init() # ifdef TGS_HAVE_LIBSTXXL // initialize the environment variable for loading STXXL configuration. If the environment // variable has already been set then don't overwrite it (that is the 0 at the end). - QString stxxlConf = QString(getenv("HOOT_HOME")) + "/conf/core/stxxl.conf"; + QString stxxlConf = ConfPath::getHootHome() + "/conf/core/stxxl.conf"; Tgs::Stxxl::getInstance().setConfig(stxxlConf); # endif diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/WayAverager.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/WayAverager.cpp index af9b4fc3ef..a2727704b4 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/WayAverager.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/WayAverager.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "WayAverager.h" @@ -51,7 +51,15 @@ namespace hoot { WayAverager::WayAverager(OsmMapPtr map, WayPtr w1, WayPtr w2) : - _map(*map) + _map(*map), + _meanMovement1(0.0), + _meanMovement2(0.0), + _sumMovement1(0.0), + _sumMovement2(0.0), + _maxMovement1(0.0), + _maxMovement2(0.0), + _moveCount1(0), + _moveCount2(0) { if (w1->getStatus() == Status::Unknown2 && w2->getStatus() == Status::Unknown1) { diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetTaskGridReplacer.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetTaskGridReplacer.cpp index 80f77c616b..5b7a29c78d 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetTaskGridReplacer.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetTaskGridReplacer.cpp @@ -111,7 +111,8 @@ OsmMapPtr ChangesetTaskGridReplacer::replace( } else { - throw e; + // Rethrow original exception + throw; } } diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/AttributeScoreExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/AttributeScoreExtractor.cpp index ed3b03936c..f8338594bc 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/AttributeScoreExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/AttributeScoreExtractor.cpp @@ -23,7 +23,7 @@ * copyrights will be updated automatically. * * @copyright Copyright (C) 2005 VividSolutions (http://www.vividsolutions.com/) - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "AttributeScoreExtractor.h" @@ -64,8 +64,8 @@ void AttributeScoreExtractor::setConfiguration(const Settings& conf) double AttributeScoreExtractor::_extract(const OsmMap& /*map*/, const ConstWayPtr& w1, const ConstWayPtr& w2) const { - double score; - double weight; + double score = 1.0; + double weight = 0.0; TagComparator::getInstance().compareEnumeratedTags(w1->getTags(), w2->getTags(), score, weight); if (_useWeight) { diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/EdgeDistanceExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/EdgeDistanceExtractor.cpp index b53aa9a67b..25c1b44fd6 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/EdgeDistanceExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/EdgeDistanceExtractor.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "EdgeDistanceExtractor.h" @@ -163,8 +163,7 @@ double EdgeDistanceExtractor::_oneDistance(const OsmMap& map, return -1; } - const double result = _aggregator->aggregate(distances); - return result; + return _aggregator->aggregate(distances); } std::shared_ptr EdgeDistanceExtractor::_toLines(const OsmMap& map, diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp index 3b6c4424ff..9444e1f9cb 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "PoiPolygonTypeScoreExtractor.h" @@ -141,7 +141,8 @@ void PoiPolygonTypeScoreExtractor::_translateTagValue(const QString& tagKey, QSt LOG_VART(tagValue); //don't care about urls - if (tagValue.toLower().startsWith("http://")) + if (tagValue.toLower().startsWith("http://") || + tagValue.toLower().startsWith("https://")) { return; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchGraph.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchGraph.cpp index f66c9bfc15..5cd6f7945c 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchGraph.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchGraph.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "MatchGraph.h" @@ -67,15 +67,16 @@ class MatchEdge { public: - MatchEdge() : match(0) {} - MatchEdge(ConstMatchPtr m) : match(m) {} - typedef enum { AssociatedWith, - MatchWith + MatchWith, + InvalidMatch } MatchType; + MatchEdge() : match(0), type(InvalidMatch) {} + MatchEdge(ConstMatchPtr m, MatchType t) : match(m), type(t) {} + ConstMatchPtr match; MatchType type; }; @@ -254,8 +255,7 @@ class MatchGraphInternal void _addMatchWith(ConstMatchPtr m) { - MatchEdge matchWith(m); - matchWith.type = MatchEdge::MatchWith; + MatchEdge matchWith(m, MatchEdge::MatchWith); // add an edge for each of the match pairs (typically just one match pair) set> eids = m->getMatchPairs(); diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.cpp index 0e54fd9e28..74661d06ee 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "BuildingMerger.h" @@ -760,11 +760,11 @@ void BuildingMerger::_fixStatuses(OsmMapPtr map) { if (secondElement->getStatus() == Status::Unknown1) { - firstElement->getStatus() == Status::Unknown2; + firstElement->setStatus(Status::Unknown2); } else if (secondElement->getStatus() == Status::Unknown2) { - firstElement->getStatus() == Status::Unknown1; + firstElement->setStatus(Status::Unknown1); } } else if (secondElement->getStatus() == Status::Conflated && @@ -772,11 +772,11 @@ void BuildingMerger::_fixStatuses(OsmMapPtr map) { if (firstElement->getStatus() == Status::Unknown1) { - secondElement->getStatus() == Status::Unknown2; + secondElement->setStatus(Status::Unknown2); } else if (firstElement->getStatus() == Status::Unknown2) { - secondElement->getStatus() == Status::Unknown1; + secondElement->setStatus(Status::Unknown1); } } } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.cpp index e661e4706f..7a7975c629 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/tile/NodeDensityTileBoundsCalculator.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "NodeDensityTileBoundsCalculator.h" @@ -147,7 +147,8 @@ void NodeDensityTileBoundsCalculator::calculateTiles(const ConstOsmMapPtr& map) { msg += " Aborting calculation."; LOG_ERROR(msg); - throw e; + // Rethrow original exception + throw; } else { diff --git a/hoot-core/src/main/cpp/hoot/core/schema/PythonSchemaTranslator.cpp b/hoot-core/src/main/cpp/hoot/core/schema/PythonSchemaTranslator.cpp index cac6478b74..ab4dc32efe 100644 --- a/hoot-core/src/main/cpp/hoot/core/schema/PythonSchemaTranslator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/schema/PythonSchemaTranslator.cpp @@ -40,9 +40,10 @@ #include "PythonSchemaTranslator.h" // hoot +#include +#include #include #include -#include #include // Qt @@ -70,7 +71,7 @@ void PythonSchemaTranslator::_init() { LOG_DEBUG("Initializing Python"); - QString hootHome(getenv("HOOT_HOME")); + QString hootHome = ConfPath::getHootHome(); QStringList pythonPath; QString moduleName; diff --git a/hoot-core/src/main/cpp/hoot/core/schema/TagInfo.cpp b/hoot-core/src/main/cpp/hoot/core/schema/TagInfo.cpp index cc84919c39..13ca8d642e 100644 --- a/hoot-core/src/main/cpp/hoot/core/schema/TagInfo.cpp +++ b/hoot-core/src/main/cpp/hoot/core/schema/TagInfo.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "TagInfo.h" @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -97,7 +98,7 @@ QString TagInfo::_getInfo(const QString& input) std::shared_ptr ogrReader = std::dynamic_pointer_cast(reader); if (ogrReader.get()) { - ogrReader->setSchemaTranslationScript(QString(getenv("HOOT_HOME")) + "/translations/quick.js"); + ogrReader->setSchemaTranslationScript(ConfPath::getHootHome() + "/translations/quick.js"); QStringList layers; if (inputInfo.contains(";")) diff --git a/hoot-core/src/main/cpp/hoot/core/scoring/BaseComparator.cpp b/hoot-core/src/main/cpp/hoot/core/scoring/BaseComparator.cpp index 7e048221d5..3ace795c78 100644 --- a/hoot-core/src/main/cpp/hoot/core/scoring/BaseComparator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/scoring/BaseComparator.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "BaseComparator.h" @@ -197,7 +197,7 @@ void BaseComparator::_saveImage(cv::Mat& image, QString path, double max, bool g QImage qImage(_width, _height, QImage::Format_ARGB32); - QRgb rgb; + QRgb rgb = 0; if (max > 0.0) { for (int y = 0; y < _height; y++) diff --git a/hoot-core/src/main/cpp/hoot/core/scoring/DirectedGraph.cpp b/hoot-core/src/main/cpp/hoot/core/scoring/DirectedGraph.cpp index d164dec088..5dd6b19ecb 100644 --- a/hoot-core/src/main/cpp/hoot/core/scoring/DirectedGraph.cpp +++ b/hoot-core/src/main/cpp/hoot/core/scoring/DirectedGraph.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "DirectedGraph.h" @@ -56,41 +56,23 @@ double DirectedGraph::determineCost(const std::shared_ptr& way) // TODO: move to config if (highway == "motorway") - { mph = 65; - } - if (highway == "trunk") - { + else if (highway == "trunk") mph = 45; - } - if (highway == "primary") - { + else if (highway == "primary") mph = 30; - } - if (highway == "secondary") - { + else if (highway == "secondary") mph = 25; - } - if (highway == "tertiary") - { + else if (highway == "tertiary") mph = 22; - } - if (highway == "residential" || highway == "unclassified") - { + else if (highway == "residential" || highway == "unclassified") mph = 15; - } - if (highway == "living_street") - { + else if (highway == "living_street") mph = 10; - } - if (highway == "track") - { + else if (highway == "track") mph = 10; - } - if (highway == "path") - { + else if (highway == "path") mph = 5; - } return _mphToSecondsPerMeter(mph); } diff --git a/hoot-js/src/main/cpp/hoot/js/util/RequireJs.cpp b/hoot-js/src/main/cpp/hoot/js/util/RequireJs.cpp index 790e33319d..b236926390 100644 --- a/hoot-js/src/main/cpp/hoot/js/util/RequireJs.cpp +++ b/hoot-js/src/main/cpp/hoot/js/util/RequireJs.cpp @@ -22,13 +22,14 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "RequireJs.h" // hoot -#include #include +#include +#include #include #include #include @@ -69,7 +70,7 @@ void RequireJs::jsRequire(const FunctionCallbackInfo& args) The new Hoot "include" files are all under $HOOT_HOME/translations & $HOOT_HOME/translations_local */ - const QString hootHome = QString(getenv("HOOT_HOME")); + const QString hootHome = ConfPath::getHootHome(); if (hootHome.isEmpty()) { throw HootException("$HOOT_HOME is empty."); diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/cmd/MultiaryScorePoiMatchesCmd.cpp b/hoot-rnd/src/main/cpp/hoot/rnd/cmd/MultiaryScorePoiMatchesCmd.cpp index 325e8fc7a7..43bd502e26 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/cmd/MultiaryScorePoiMatchesCmd.cpp +++ b/hoot-rnd/src/main/cpp/hoot/rnd/cmd/MultiaryScorePoiMatchesCmd.cpp @@ -22,25 +22,26 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include #include +#include +#include #include #include #include #include -#include +#include #include #include -#include -#include -#include -#include #include +#include +#include +#include // Qt #include @@ -177,7 +178,7 @@ class MultiaryScorePoiMatchesCmd : public BaseCommand hashVisitor.setIncludeCircularError(true); map->visitRw(hashVisitor); - OsmMapWriterFactory::write(map, "/tmp/score-matches-after-prep.osm"); + OsmMapWriterFactory::write(map, ConfPath::getHootHome() + "/tmp/score-matches-after-prep.osm"); MapProjector::projectToPlanar(map); std::shared_ptr mt; diff --git a/hoot-test/src/main/cpp/hoot/test/ScriptTestSuite.cpp b/hoot-test/src/main/cpp/hoot/test/ScriptTestSuite.cpp index 6221a72abf..d6a19f6465 100644 --- a/hoot-test/src/main/cpp/hoot/test/ScriptTestSuite.cpp +++ b/hoot-test/src/main/cpp/hoot/test/ScriptTestSuite.cpp @@ -22,13 +22,14 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "ScriptTestSuite.h" // hoot -#include #include +#include +#include // Qt #include @@ -39,9 +40,9 @@ namespace hoot ScriptTestSuite::ScriptTestSuite(QString dir, bool printDiff, double waitTimeSec, bool hideDisableTests, bool suppressFailureDetail) : -TestSuite(dir.toStdString()) +TestSuite((ConfPath::getHootHome() + "/" + dir).toStdString()) { - QDir d(dir); + QDir d(ConfPath::getHootHome() + "/" + dir); QStringList files = d.entryList(QDir::Files); QStringList ignorePrefix; diff --git a/tgs/src/main/cpp/tgs/RStarTree/HilbertRTree.cpp b/tgs/src/main/cpp/tgs/RStarTree/HilbertRTree.cpp index ab031c1c29..2ab302a8bc 100644 --- a/tgs/src/main/cpp/tgs/RStarTree/HilbertRTree.cpp +++ b/tgs/src/main/cpp/tgs/RStarTree/HilbertRTree.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "HilbertRTree.h" @@ -95,7 +95,7 @@ void HilbertRTree::_calculateHilbertValues(const std::vector& boxes, bounds.expand(boxes[i]); } - double boundsWidth[Box::MAX_DIMENSIONS]; + double boundsWidth[Box::MAX_DIMENSIONS] = { 0.0 }; for (int i = 0; i < bounds.getDimensions(); i++) { boundsWidth[i] = bounds.getUpperBoundRaw(i) - bounds.getLowerBoundRaw(i); @@ -367,7 +367,7 @@ int HilbertRTree::_splitBoxes(BoxVector& boxes) { bounds.expand(boxes[i].box); } - double boundsWidth[Box::MAX_DIMENSIONS]; + double boundsWidth[Box::MAX_DIMENSIONS] = { 0.0 }; for (int i = 0; i < bounds.getDimensions(); i++) { boundsWidth[i] = bounds.getUpperBoundRaw(i) - bounds.getLowerBoundRaw(i); diff --git a/tgs/src/main/cpp/tgs/RStarTree/RStarTreePrinter.cpp b/tgs/src/main/cpp/tgs/RStarTree/RStarTreePrinter.cpp index 4b3db5184e..a424a3d30e 100644 --- a/tgs/src/main/cpp/tgs/RStarTree/RStarTreePrinter.cpp +++ b/tgs/src/main/cpp/tgs/RStarTree/RStarTreePrinter.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2021 DigitalGlobe (http://www.digitalglobe.com/) */ #include "RStarTreePrinter.h" @@ -36,8 +36,9 @@ namespace Tgs { RStarTreePrinter::RStarTreePrinter(const std::shared_ptr& tree) + : _tree(tree), + _indent(0) { - _tree = tree; } string RStarTreePrinter::_indentStr(int size)