-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.54..v0.2.55 changeset ChangesetReplacementCreator.h
Garret Voltz edited this page Aug 14, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetReplacementCreator.h b/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetReplacementCreator.h
index fa5fac7..51a6581 100644
--- a/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetReplacementCreator.h
+++ b/hoot-core/src/main/cpp/hoot/core/algorithms/changeset/ChangesetReplacementCreator.h
@@ -110,10 +110,13 @@ public:
* Constructor
*
* @param printStats prints statistics for the output changeset
+ * @param outputStatsFile optional file to output the changeset statistics to
* @param osmApiDbUrl URL to an OSM API database used to calculate element IDs; required only if
* the output changeset is of type .osc.sql.
*/
- ChangesetReplacementCreator(const bool printStats = false, const QString osmApiDbUrl = "");
+ ChangesetReplacementCreator(
+ const bool printStats = false, const QString& statsOutputFile = "",
+ const QString osmApiDbUrl = "");
/**
* Creates a changeset that replaces features in the first input with features from the second
@@ -141,6 +144,7 @@ public:
void setRetainmentFilterOptions(const QStringList& optionKvps);
void setWaySnappingEnabled(const bool enabled) { _waySnappingEnabled = enabled; }
void setConflationEnabled(const bool enabled) { _conflationEnabled = enabled; }
+ void setCleaningEnabled(const bool enabled) { _cleaningEnabled = enabled; }
void setTagOobConnectedWays(const bool addTag) { _tagOobConnectedWays = addTag; }
private:
@@ -190,6 +194,9 @@ private:
// turn on/off conflation of cookie cut data being replaced with replacement data
bool _conflationEnabled;
+ // turn on/off cleaning of input data; cannot be disabled if conflation is enabled
+ bool _cleaningEnabled;
+
// Tagging out of bounds connected ways allows for preventing deletion of ways outside of the
// replacement bounds when lenient bounds interpretation is enabled. If false, the tags should
// added manually before performing the replacement.
@@ -205,16 +212,28 @@ private:
void _validateInputs(const QString& input1, const QString& input2);
+ QString _getJobDescription(
+ const QString& input1, const QString& input2, const QString& bounds,
+ const QString& output) const;
+
+ /*
+ * Returns the default geometry filters (point, line, poly) to use when no other geometry filters
+ * are specified
+ */
QMap<GeometryTypeCriterion::GeometryType, ElementCriterionPtr>
_getDefaultGeometryFilters() const;
+ bool _roadFilterExists() const;
+
void _setInputFilter(
std::shared_ptr<ChainCriterion>& inputFilter, const QStringList& filterClassNames,
const bool chainFilters);
void _setInputFilterOptions(Settings& opts, const QStringList& optionKvps);
- // Combines filters in _geometryTypeFilters with _replacementFilter.
+ /*
+ * Combines filters in _geometryTypeFilters with _replacementFilter.
+ */
QMap<GeometryTypeCriterion::GeometryType, ElementCriterionPtr> _getCombinedFilters(
std::shared_ptr<ChainCriterion> nonGeometryFilter);
@@ -230,6 +249,11 @@ private:
OsmMapPtr _loadSecMap(const QString& input);
/*
+ * Adds a custom tag to any element from the input with a missing child
+ */
+ void _markElementsWithMissingChildren(OsmMapPtr& map);
+
+ /*
* Keeps track of the changeset versions for features
*/
QMap<ElementId, long> _getIdToVersionMappings(const OsmMapPtr& map) const;
@@ -257,8 +281,14 @@ private:
* Combines two maps into one; throwOutDupes ignores any elements in the second map with the ID
* as an element in the first map
*/
- void _combineMaps(OsmMapPtr& map1, OsmMapPtr& map2, const bool throwOutDupes,
- const QString& debugFileName);
+ void _combineMaps(
+ OsmMapPtr& map1, OsmMapPtr& map2, const bool throwOutDupes, const QString& debugFileName);
+
+ /*
+ * Removes duplicates between one map and another, ignoring elemment IDs
+ */
+ void _dedupeMaps(const QList<OsmMapPtr>& maps);
+
/*
* Removes all ways from the map with both MetadataTags::HootConnectedWayOutsideBounds() and
* MetadataTags::HootSnapped()=snapped_way tags
@@ -266,6 +296,8 @@ private:
void _removeUnsnappedImmediatelyConnectedOutOfBoundsWays(OsmMapPtr& map);
void _conflate(OsmMapPtr& map, const bool lenientBounds);
+ void _removeConflateReviews(OsmMapPtr& map);
+ void _clean(OsmMapPtr& map);
void _snapUnconnectedWays(
OsmMapPtr& map, const QStringList& snapWayStatuses, const QStringList& snapToWayStatuses,
@@ -278,7 +310,7 @@ private:
*/
void _cropMapForChangesetDerivation(
OsmMapPtr& map, const geos::geom::Envelope& bounds, const bool keepEntireFeaturesCrossingBounds,
- const bool keepOnlyFeaturesInsideBounds, const bool isLinearMap, const QString& debugFileName);
+ const bool keepOnlyFeaturesInsideBounds, const QString& debugFileName);
/*
* Populates a reference and a conflated map based on the geometry type being replaced. The maps
@@ -291,7 +323,7 @@ private:
const GeometryTypeCriterion::GeometryType& geometryType,
const QStringList& linearFilterClassNames = QStringList());
- void _cleanupMissingElements(OsmMapPtr& map);
+ void _cleanup(OsmMapPtr& map);
};
}