v0.2.54..v0.2.55 changeset MultiaryUtilities.cpp
Garret Voltz edited this page Aug 14, 2020
·
1 revision
diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryUtilities.cpp b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryUtilities.cpp
index 2d7d696..40be732 100644
--- a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryUtilities.cpp
+++ b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryUtilities.cpp
@@ -35,15 +35,13 @@
#include <hoot/core/io/OsmPbfWriter.h>
#include <hoot/core/util/Log.h>
#include <hoot/core/util/MapProjector.h>
-#include <hoot/core/visitors/CalculateHashVisitor.h>
+#include <hoot/rnd/visitors/MultiaryPoiHashVisitor.h>
#include <hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.h>
namespace hoot
{
-std::shared_ptr<MultiaryUtilities> MultiaryUtilities::_theInstance;
-
void MultiaryUtilities::conflate(OsmMapPtr map)
{
MatchFactory& matchFactory = MatchFactory::getInstance();
@@ -104,7 +102,8 @@ QList<MultiaryElement> MultiaryUtilities::conflateCluster(QList<QByteArray> pbfE
conflate(map);
MapProjector::projectToWgs84(map);
- CalculateHashVisitor hashVisitor;
+ MultiaryPoiHashVisitor hashVisitor;
+ hashVisitor.setIncludeCircularError(true);
map->visitRw(hashVisitor);
for (NodeMap::const_iterator it = map->getNodes().begin(); it != map->getNodes().end(); ++it)
@@ -206,11 +205,9 @@ SearchBoundsCalculatorPtr MultiaryUtilities::getBoundsCalculator()
MultiaryUtilities& MultiaryUtilities::getInstance()
{
- if (_theInstance.get() == 0)
- {
- _theInstance.reset(new MultiaryUtilities());
- }
- return *_theInstance;
+ // Local static singleton instance
+ static MultiaryUtilities instance;
+ return instance;
}
}