-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.54..v0.2.55 changeset CookieCutter.cpp
Garret Voltz edited this page Aug 14, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/CookieCutter.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/CookieCutter.cpp
index 32f5a7c..6068c3f 100644
--- a/hoot-core/src/main/cpp/hoot/core/conflate/CookieCutter.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/conflate/CookieCutter.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 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
*/
#include "CookieCutter.h"
@@ -45,11 +45,12 @@ namespace hoot
{
CookieCutter::CookieCutter(bool crop, double outputBuffer, bool keepEntireFeaturesCrossingBounds,
- bool keepOnlyFeaturesInsideBounds) :
+ bool keepOnlyFeaturesInsideBounds, bool removeMissingElements) :
_crop(crop),
_outputBuffer(outputBuffer),
_keepEntireFeaturesCrossingBounds(keepEntireFeaturesCrossingBounds),
-_keepOnlyFeaturesInsideBounds(keepOnlyFeaturesInsideBounds)
+_keepOnlyFeaturesInsideBounds(keepOnlyFeaturesInsideBounds),
+_removeMissingElements(removeMissingElements)
{
}
@@ -96,15 +97,11 @@ void CookieCutter::cut(OsmMapPtr& cutterShapeOutlineMap, OsmMapPtr& doughMap)
cropper.setKeepEntireFeaturesCrossingBounds(_keepEntireFeaturesCrossingBounds);
cropper.setKeepOnlyFeaturesInsideBounds(_keepOnlyFeaturesInsideBounds);
cropper.setInvert(!_crop);
+ cropper.setRemoveSuperflousFeatures(true);
+ cropper.setRemoveMissingElements(_removeMissingElements);
cropper.apply(doughMap);
OsmMapPtr cookieCutMap = doughMap;
-
- // clean up any ugly bits left over
- // TODO: This can be removed now, since its already happening in MapCropper, right?
- SuperfluousWayRemover::removeWays(cookieCutMap);
- SuperfluousNodeRemover::removeNodes(cookieCutMap);
-
LOG_VARD(cookieCutMap->getNodes().size());
LOG_VARD(MapProjector::toWkt(cookieCutMap->getProjection()));
OsmMapWriterFactory::writeDebugMap(cookieCutMap, "cookie-cutter-cookie-cut-map");