From 6c7d9ce19206f4cc3a36f27a2e73a415df79637d Mon Sep 17 00:00:00 2001 From: Brandon Witham Date: Wed, 6 Mar 2019 12:18:37 -0500 Subject: [PATCH] Assorted maintenance and minor features - 3/5/19 (#3034) * Move existing OsmMapOperation classes into the ops folder * Refactor some other namespaces * Fix SmallWayMergerTest (wasn't checking against any known output) * Turn WayCleaner into an ElementOsmVisitor * Info command fixes and additions: * 'hoot info --matchers' --> 'hoot info --match-creators' * 'hoot info --mergers' --> 'hoot info --merger-creators' * Correctly implement 'hoot info --matchers' and 'hoot info --mergers' --- docs/commands/info.asciidoc | 42 +++++- docs/user/CommandLineExamples.asciidoc | 30 ++-- .../PoiPolygonAddressScoreExtractorTest.cpp | 4 +- ...PolygonAlphaShapeDistanceExtractorTest.cpp | 4 +- .../PoiPolygonDistanceExtractorTest.cpp | 4 +- .../PoiPolygonNameScoreExtractorTest.cpp | 2 +- ...oiPolygonPhoneNumberScoreExtractorTest.cpp | 4 +- .../PoiPolygonTypeScoreExtractorTest.cpp | 4 +- .../rubber-sheet/RubberSheetTest.cpp | 4 +- .../conflate/SearchRadiusCalculatorTest.cpp | 2 +- .../matching/GreedyConstrainedMatchesTest.cpp | 10 +- .../core/conflate/matching/MatchGraphTest.cpp | 4 +- .../OptimalConstrainedMatchesTest.cpp | 6 +- .../PoiPolygonPoiCriterionTest.cpp | 4 +- .../PoiPolygonPolyCriterionTest.cpp | 4 +- .../NodeReplacementsTest.cpp | 10 +- .../cpp/hoot/core/ops/CookieCutterOpTest.cpp | 4 +- .../cleaning => ops}/MapCleanerTest.cpp | 4 +- .../merging => ops}/SmallWayMergerTest.cpp | 14 +- .../test/cpp/hoot/core/ops/TrivialOpTest.cpp | 4 +- .../scoring/MatchFeatureExtractorTest.cpp | 4 +- .../cleaning => visitors}/WayCleanerTest.cpp | 49 +++--- .../PoiPolygonMatchVisitorTest.cpp | 2 +- .../cpp/hoot/core/algorithms/WayJoiner1.cpp | 2 +- .../cpp/hoot/core/algorithms/WayJoiner2.cpp | 2 +- .../PoiPolygonAddressScoreExtractor.cpp | 2 +- .../PoiPolygonAddressScoreExtractor.h | 2 +- .../PoiPolygonAlphaShapeDistanceExtractor.cpp | 0 .../PoiPolygonAlphaShapeDistanceExtractor.h | 2 +- .../PoiPolygonDistanceExtractor.cpp | 0 .../PoiPolygonDistanceExtractor.h | 2 +- .../PoiPolygonNameScoreExtractor.cpp | 2 +- .../PoiPolygonNameScoreExtractor.h | 2 +- .../PoiPolygonPhoneNumberScoreExtractor.cpp | 2 +- .../PoiPolygonPhoneNumberScoreExtractor.h | 0 .../PoiPolygonTypeScoreExtractor.cpp | 4 +- .../PoiPolygonTypeScoreExtractor.h | 0 .../algorithms/rubber-sheet/RubberSheet.cpp | 2 +- .../rubber-sheet/RubberSheetApplier.cpp | 4 +- .../rubber-sheet/RubberSheetDeriver.cpp | 4 +- .../algorithms/rubber-sheet/RubberSheeter.cpp | 4 +- .../algorithms/splitter/LargeWaySplitter.cpp | 2 +- .../src/main/cpp/hoot/core/cmd/CleanCmd.cpp | 4 +- .../src/main/cpp/hoot/core/cmd/InfoCmd.cpp | 2 + .../hoot/core/conflate/cleaning/WayCleaner.h | 114 -------------- .../core/conflate/highway/HighwayMatch.cpp | 7 + .../hoot/core/conflate/highway/HighwayMatch.h | 6 + .../conflate/highway/HighwayMatchCreator.cpp | 5 +- .../highway/HighwayMergerAbstract.cpp | 2 +- .../conflate/highway/HighwayMergerCreator.cpp | 3 +- .../conflate/highway/HighwaySnapMerger.cpp | 10 +- .../core/conflate/highway/HighwaySnapMerger.h | 3 + .../conflate/highway/HighwayTagOnlyMerger.cpp | 8 + .../conflate/highway/HighwayTagOnlyMerger.h | 4 + .../conflate/highway/ImpliedDividedMarker.cpp | 4 +- .../hoot/core/conflate/highway/Roundabout.cpp | 2 +- .../cpp/hoot/core/conflate/matching/Match.cpp | 7 +- .../cpp/hoot/core/conflate/matching/Match.h | 10 +- .../core/conflate/matching/MatchCreator.h | 2 +- .../core/conflate/matching/NodeMatcher.cpp | 2 +- .../conflate/merging/MarkForReviewMerger.cpp | 9 +- .../conflate/merging/MarkForReviewMerger.h | 12 +- .../merging/MarkForReviewMergerCreator.cpp | 1 + .../merging/MarkForReviewMergerCreator.h | 1 - .../cpp/hoot/core/conflate/merging/Merger.h | 7 +- .../hoot/core/conflate/merging/MergerBase.cpp | 8 + .../hoot/core/conflate/merging/MergerBase.h | 5 +- .../core/conflate/network/NetworkMatch.cpp | 10 +- .../hoot/core/conflate/network/NetworkMatch.h | 5 + .../conflate/network/NetworkMatchCreator.cpp | 2 +- .../core/conflate/network/NetworkMerger.cpp | 10 +- .../core/conflate/network/NetworkMerger.h | 8 +- .../conflate/network/NetworkMergerCreator.cpp | 6 +- .../conflate/network/PartialNetworkMerger.cpp | 10 +- .../conflate/network/PartialNetworkMerger.h | 5 + .../poi-polygon/PoiPolygonAdvancedMatcher.cpp | 4 +- .../conflate/poi-polygon/PoiPolygonMatch.cpp | 11 +- .../conflate/poi-polygon/PoiPolygonMatch.h | 17 ++- .../poi-polygon/PoiPolygonMatchCreator.cpp | 4 +- .../poi-polygon/PoiPolygonMatchCreator.h | 6 +- .../conflate/poi-polygon/PoiPolygonMerger.cpp | 12 +- .../conflate/poi-polygon/PoiPolygonMerger.h | 3 + .../poi-polygon/PoiPolygonMergerCreator.cpp | 5 +- .../poi-polygon/PoiPolygonMergerCreator.h | 6 +- .../poi-polygon/PoiPolygonReviewReducer.cpp | 6 +- .../poi-polygon/PoiPolygonRfClassifier.cpp | 12 +- .../core/conflate/polygon/BuildingMatch.cpp | 10 +- .../core/conflate/polygon/BuildingMatch.h | 7 +- .../conflate/polygon/BuildingMatchCreator.cpp | 3 +- .../core/conflate/polygon/BuildingMerger.cpp | 8 + .../core/conflate/polygon/BuildingMerger.h | 5 + .../polygon/BuildingMergerCreator.cpp | 5 +- .../criterion/BuildingWayNodeCriterion.cpp | 4 +- .../HighwayIntersectionCriterion.cpp | 4 +- .../criterion/UselessElementCriterion.cpp | 4 +- .../poi-polygon}/PoiPolygonPoiCriterion.cpp | 0 .../poi-polygon}/PoiPolygonPoiCriterion.h | 0 .../poi-polygon}/PoiPolygonPolyCriterion.cpp | 0 .../poi-polygon}/PoiPolygonPolyCriterion.h | 0 .../NodeReplacements.cpp | 2 +- .../{conflate => elements}/NodeReplacements.h | 0 .../{conflate => elements}/NodeToWayMap.cpp | 2 +- .../{conflate => elements}/NodeToWayMap.h | 0 .../main/cpp/hoot/core/elements/OsmMap.cpp | 2 +- .../main/cpp/hoot/core/elements/OsmUtils.cpp | 4 +- .../main/cpp/hoot/core/index/OsmMapIndex.cpp | 2 +- .../hoot/core/info/ApiEntityDisplayInfo.cpp | 36 +++-- .../cpp/hoot/core/info/CreatorDescription.cpp | 4 +- .../hoot/core/ops/BuildingOutlineRemoveOp.cpp | 4 +- .../hoot/core/ops/BuildingOutlineUpdateOp.cpp | 2 +- .../cpp/hoot/core/ops/BuildingPartMergeOp.cpp | 2 +- .../cpp/hoot/core/ops/CalculateStatsOp.cpp | 4 +- .../cpp/hoot/core/ops/DuplicateWayRemover.cpp | 4 +- .../core/ops/FindHighwayIntersectionsOp.cpp | 2 +- .../HighwayReviewCleanerOp.cpp | 2 +- .../highway => ops}/HighwayReviewCleanerOp.h | 2 +- .../{conflate/cleaning => ops}/MapCleaner.cpp | 2 +- .../{conflate/cleaning => ops}/MapCleaner.h | 0 .../src/main/cpp/hoot/core/ops/MapCropper.cpp | 2 +- .../main/cpp/hoot/core/ops/RemoveNodeOp.cpp | 2 +- .../cpp/hoot/core/ops/RemoveRelationOp.cpp | 2 +- .../highway => ops}/RemoveRoundabouts.cpp | 2 +- .../highway => ops}/RemoveRoundabouts.h | 0 .../main/cpp/hoot/core/ops/RemoveWayOp.cpp | 2 +- .../highway => ops}/ReplaceRoundabouts.cpp | 2 +- .../highway => ops}/ReplaceRoundabouts.h | 0 .../hoot/core/ops/SearchRadiusCalculator.cpp | 2 +- .../merging => ops}/SmallWayMerger.cpp | 2 +- .../merging => ops}/SmallWayMerger.h | 0 .../core/ops/UnlikelyIntersectionRemover.cpp | 2 +- .../core/scoring/RandomForestModelBuilder.cpp | 2 +- .../FindHighwayIntersectionsVisitor.cpp | 4 +- .../visitors/ImplicitPoiPolygonTypeTagger.h | 4 +- .../core/visitors/ImplicitTypeTaggerBase.cpp | 2 +- .../core/visitors/IndexElementsVisitor.cpp | 4 +- .../core/visitors/RemoveElementsVisitor.cpp | 2 +- .../cleaning => visitors}/WayCleaner.cpp | 142 ++++++++++-------- .../main/cpp/hoot/core/visitors/WayCleaner.h | 135 +++++++++++++++++ .../poi-polygon}/PoiPolygonMatchVisitor.cpp | 0 .../poi-polygon}/PoiPolygonMatchVisitor.h | 4 +- .../hoot/js/conflate/matching/ScriptMatch.cpp | 8 + .../hoot/js/conflate/matching/ScriptMatch.h | 7 +- .../conflate/matching/ScriptMatchCreator.cpp | 3 - .../js/conflate/merging/ElementMergerJs.cpp | 4 +- .../hoot/js/conflate/merging/ScriptMerger.cpp | 8 + .../hoot/js/conflate/merging/ScriptMerger.h | 4 + .../conflate/merging/ScriptMergerCreator.cpp | 2 +- .../conflate/multiary/MultiaryPoiMerger.cpp | 11 +- .../rnd/conflate/multiary/MultiaryPoiMerger.h | 8 +- .../multiary/MultiaryPoiMergerCreator.cpp | 5 +- .../multiary/MultiaryPoiMergerCreator.h | 1 + .../cpp/hoot/rnd/perty/PertyMatchScorer.cpp | 2 +- .../rnd/scoring/MatchScoringMapPreparer.cpp | 4 +- .../network/IterativeNetworkMatcherTest.cpp | 2 +- .../network/SingleSidedNetworkMatcherTest.cpp | 2 +- .../network/VagabondNetworkMatcherTest.cpp | 2 +- test-files/cmd/slow/InfoCmdTest.sh | 30 +++- test-files/cmd/slow/InfoCmdTest.sh.stdout | 22 ++- .../SmallWayMerger}/SmallWayMergerInput1.osm | 0 .../SmallWayMerger}/SmallWayMergerInput2.osm | 0 .../SmallWayMerger/SmallWayMergerOutput1.osm | 106 +++++++++++++ .../WayCleanerTest/DuplicateCoordsTest.osm | 0 .../WayCleanerTest/DuplicateNodesTest.osm | 0 163 files changed, 885 insertions(+), 426 deletions(-) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonAddressScoreExtractorTest.cpp (99%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonAlphaShapeDistanceExtractorTest.cpp (92%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonDistanceExtractorTest.cpp (92%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonNameScoreExtractorTest.cpp (97%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonPhoneNumberScoreExtractorTest.cpp (97%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonTypeScoreExtractorTest.cpp (95%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/filters => criterion/poi-polygon}/PoiPolygonPoiCriterionTest.cpp (93%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/filters => criterion/poi-polygon}/PoiPolygonPolyCriterionTest.cpp (94%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate => elements}/NodeReplacementsTest.cpp (87%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/cleaning => ops}/MapCleanerTest.cpp (94%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/merging => ops}/SmallWayMergerTest.cpp (78%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/cleaning => visitors}/WayCleanerTest.cpp (62%) rename hoot-core-test/src/test/cpp/hoot/core/{conflate/poi-polygon/visitors => visitors/poi-polygon}/PoiPolygonMatchVisitorTest.cpp (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonAddressScoreExtractor.cpp (98%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonAddressScoreExtractor.h (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonAlphaShapeDistanceExtractor.cpp (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonAlphaShapeDistanceExtractor.h (95%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonDistanceExtractor.cpp (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonDistanceExtractor.h (95%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonNameScoreExtractor.cpp (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonNameScoreExtractor.h (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonPhoneNumberScoreExtractor.cpp (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonPhoneNumberScoreExtractor.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonTypeScoreExtractor.cpp (99%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/extractors => algorithms/extractors/poi-polygon}/PoiPolygonTypeScoreExtractor.h (100%) delete mode 100644 hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.h rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/criterion => criterion/poi-polygon}/PoiPolygonPoiCriterion.cpp (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/criterion => criterion/poi-polygon}/PoiPolygonPoiCriterion.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/criterion => criterion/poi-polygon}/PoiPolygonPolyCriterion.cpp (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/criterion => criterion/poi-polygon}/PoiPolygonPolyCriterion.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate => elements}/NodeReplacements.cpp (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate => elements}/NodeReplacements.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate => elements}/NodeToWayMap.cpp (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate => elements}/NodeToWayMap.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/highway => ops}/HighwayReviewCleanerOp.cpp (96%) rename hoot-core/src/main/cpp/hoot/core/{conflate/highway => ops}/HighwayReviewCleanerOp.h (95%) rename hoot-core/src/main/cpp/hoot/core/{conflate/cleaning => ops}/MapCleaner.cpp (93%) rename hoot-core/src/main/cpp/hoot/core/{conflate/cleaning => ops}/MapCleaner.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/highway => ops}/RemoveRoundabouts.cpp (97%) rename hoot-core/src/main/cpp/hoot/core/{conflate/highway => ops}/RemoveRoundabouts.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/highway => ops}/ReplaceRoundabouts.cpp (96%) rename hoot-core/src/main/cpp/hoot/core/{conflate/highway => ops}/ReplaceRoundabouts.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/merging => ops}/SmallWayMerger.cpp (99%) rename hoot-core/src/main/cpp/hoot/core/{conflate/merging => ops}/SmallWayMerger.h (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/cleaning => visitors}/WayCleaner.cpp (85%) create mode 100644 hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.h rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/visitors => visitors/poi-polygon}/PoiPolygonMatchVisitor.cpp (100%) rename hoot-core/src/main/cpp/hoot/core/{conflate/poi-polygon/visitors => visitors/poi-polygon}/PoiPolygonMatchVisitor.h (96%) rename test-files/{conflate => ops/SmallWayMerger}/SmallWayMergerInput1.osm (100%) rename test-files/{conflate => ops/SmallWayMerger}/SmallWayMergerInput2.osm (100%) create mode 100644 test-files/ops/SmallWayMerger/SmallWayMergerOutput1.osm rename test-files/{conflate => visitors}/WayCleanerTest/DuplicateCoordsTest.osm (100%) rename test-files/{conflate => visitors}/WayCleanerTest/DuplicateNodesTest.osm (100%) diff --git a/docs/commands/info.asciidoc b/docs/commands/info.asciidoc index 352eb9ec6d..1bc4656ff6 100644 --- a/docs/commands/info.asciidoc +++ b/docs/commands/info.asciidoc @@ -17,7 +17,9 @@ Only one of the following options can be passed to the command: * +--formats+ - Displays supported data input/output formats * +--languages+ - Displays information about translatable/detectable spoken languages * +--matchers+ - Displays available feature matchers used during conflation +* +--match-creators+ - Displays available feature match creators used during conflation * +--mergers+ - Displays available feature mergers used during conflation +* +--merger-creators+ - Displays available feature merger creators used during conflation * +--operators+ - Displays available inline operators that can be applied to map datasets * +--string-comparators+ - Displays available string comparators * +--subline-matchers+ - Displays available subline matchers @@ -236,7 +238,8 @@ hoot info --languages --translatable === Matchers -The +--matchers+ option prints out available conflate matchers that may be applied when conflating data. +The +--matchers+ option prints out available conflate matchers that may be applied when conflating data. Matchers contain the criteria to match +a specific pair of features ==== Usage @@ -250,9 +253,27 @@ info --matchers hoot info --matchers -------------------------------------- +=== Match Creators + +The +--match-creators+ option prints out available conflate match creators that may be applied when conflating data. Match Creators are +responsible for spawning matchers. + +==== Usage + +-------------------------------------- +info --match-creators +-------------------------------------- + +==== Example + +-------------------------------------- +hoot info --match-creators +-------------------------------------- + === Mergers -The +--mergers+ option prints out available conflate mergers that may be applied when conflating data. +The +--mergers+ option prints out available conflate mergers that may be applied when conflating data. Mergers are created to merge a feature +pair supported by a corresponding matcher. ==== Usage @@ -266,6 +287,23 @@ info --mergers hoot info --mergers -------------------------------------- +=== Merger Creators + +The +--merger-creators+ option prints out available conflate merger creators that may be applied when conflating data. Merger Creators are +responsible for spawning mergers. + +==== Usage + +-------------------------------------- +info --merger-creators +-------------------------------------- + +==== Example + +-------------------------------------- +hoot info --merger-creators +-------------------------------------- + === Operators The +--operators+ option prints out available inline operators that can be applied to map data in a Hootenanny command. Map operators diff --git a/docs/user/CommandLineExamples.asciidoc b/docs/user/CommandLineExamples.asciidoc index 3b1b29a05b..5b6ced1ee1 100644 --- a/docs/user/CommandLineExamples.asciidoc +++ b/docs/user/CommandLineExamples.asciidoc @@ -481,18 +481,6 @@ Requires language translation server installation. See the Hootenanny Install G # List all available feature extractors hoot info --feature-extractors - # List all available feature matchers - hoot info --matchers - - # List all available feature mergers - hoot info --mergers - - # List all available data operators - hoot info --operators - - # List all available tag mergers - hoot info --tag-mergers - # List all available language detectors hoot info --languages --detectors @@ -505,6 +493,21 @@ Requires language translation server installation. See the Hootenanny Install G # List all translatable languages hoot info --languages --translatable + # List all available feature matchers + hoot info --matchers + + # List all available feature match creators + hoot info --match-creators + + # List all available feature mergers + hoot info --mergers + + # List all available feature merger creators + hoot info --merger-creators + + # List all available data operators + hoot info --operators + # List all available string comparators hoot info --string-comparators @@ -516,5 +519,8 @@ Requires language translation server installation. See the Hootenanny Install G # List all available subline string matchers hoot info --subline-string-matchers + + # List all available tag mergers + hoot info --tag-mergers ----- diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractorTest.cpp similarity index 99% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractorTest.cpp index 4fa68c2320..3c3433d005 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractorTest.cpp @@ -22,14 +22,14 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include #include -#include +#include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractorTest.cpp similarity index 92% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractorTest.cpp index cb2b0b35d5..b60ee3dae4 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractorTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include // CPP Unit diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractorTest.cpp similarity index 92% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractorTest.cpp index ecf838738e..e012a404c1 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractorTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractorTest.cpp similarity index 97% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractorTest.cpp index 737c8e88c9..d6b2212f3c 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractorTest.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractorTest.cpp similarity index 97% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractorTest.cpp index 4947ed6bb3..f9686b5211 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractorTest.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include // CPP Unit diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractorTest.cpp similarity index 95% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractorTest.cpp index c189a6f7e2..dd5a51692e 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractorTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include // CPP Unit diff --git a/hoot-core-test/src/test/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetTest.cpp index 9fed3b414e..4eed8ecc95 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetTest.cpp @@ -22,12 +22,12 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2013, 2014, 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2013, 2014, 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/SearchRadiusCalculatorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/conflate/SearchRadiusCalculatorTest.cpp index c8a355809b..3d926a39f5 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/SearchRadiusCalculatorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/conflate/SearchRadiusCalculatorTest.cpp @@ -27,7 +27,7 @@ // Hoot #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/GreedyConstrainedMatchesTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/GreedyConstrainedMatchesTest.cpp index 1242d0083d..791f270eea 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/GreedyConstrainedMatchesTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/GreedyConstrainedMatchesTest.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2014, 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2014, 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot @@ -57,8 +57,8 @@ namespace hoot class ConstrainedFakeMatch : public Match { public: - ConstrainedFakeMatch() : Match(MatchThresholdPtr()) {} + ConstrainedFakeMatch() : Match(MatchThresholdPtr()) {} ConstrainedFakeMatch(ElementId eid1, ElementId eid2, double p, ConstMatchThresholdPtr threshold) : Match(threshold), @@ -98,9 +98,9 @@ class ConstrainedFakeMatch : public Match } } - virtual set< pair > getMatchPairs() const + virtual set> getMatchPairs() const { - set< pair > result; + set> result; result.insert(pair(_eid1, _eid2)); return result; } @@ -124,6 +124,8 @@ class ConstrainedFakeMatch : public Match MatchType getType() const { return _threshold->getType(*this); } + virtual QString getDescription() const { return ""; } + private: mutable MatchClassification _c; diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/MatchGraphTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/MatchGraphTest.cpp index e64763a672..5b3c19d6e6 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/MatchGraphTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/MatchGraphTest.cpp @@ -69,8 +69,8 @@ namespace hoot class FakeMatch : public Match { public: - FakeMatch() : Match(boost::shared_ptr()) {} + FakeMatch() : Match(boost::shared_ptr()) {} FakeMatch(ElementId eid1, ElementId eid2, double p, const boost::shared_ptr mt) : Match(mt), _eid1(eid1), @@ -120,6 +120,8 @@ class FakeMatch : public Match MatchType getType() const { return _threshold->getType(*this); } + virtual QString getDescription() const { return ""; } + private: mutable MatchClassification _c; diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/OptimalConstrainedMatchesTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/OptimalConstrainedMatchesTest.cpp index b1ae2e2dc3..41070e186f 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/OptimalConstrainedMatchesTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/conflate/matching/OptimalConstrainedMatchesTest.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2014, 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2014, 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot @@ -57,8 +57,8 @@ namespace hoot class ConstrainedFakeMatch : public Match { public: - ConstrainedFakeMatch() : Match(boost::shared_ptr()) {} + ConstrainedFakeMatch() : Match(boost::shared_ptr()) {} ConstrainedFakeMatch(ElementId eid1, ElementId eid2, double p, ConstMatchThresholdPtr threshold) : Match(threshold), @@ -124,6 +124,8 @@ class ConstrainedFakeMatch : public Match MatchType getType() const { return _threshold->getType(*this); } + virtual QString getDescription() const { return ""; } + private: mutable MatchClassification _c; diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/filters/PoiPolygonPoiCriterionTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterionTest.cpp similarity index 93% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/filters/PoiPolygonPoiCriterionTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterionTest.cpp index 7e53839d46..779cafde82 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/filters/PoiPolygonPoiCriterionTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterionTest.cpp @@ -22,12 +22,12 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include -#include +#include using namespace geos::geom; diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/filters/PoiPolygonPolyCriterionTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterionTest.cpp similarity index 94% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/filters/PoiPolygonPolyCriterionTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterionTest.cpp index cd8e3d916e..86bceb0640 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/filters/PoiPolygonPolyCriterionTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterionTest.cpp @@ -22,12 +22,12 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include -#include +#include using namespace geos::geom; diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/NodeReplacementsTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/elements/NodeReplacementsTest.cpp similarity index 87% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/NodeReplacementsTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/elements/NodeReplacementsTest.cpp index 56deab9303..5847756dbb 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/NodeReplacementsTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/elements/NodeReplacementsTest.cpp @@ -22,12 +22,12 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include -#include +#include #include #include @@ -51,7 +51,7 @@ class NodeReplacementsTest : public HootTestFixture NodeReplacementsTest() { - TestUtils::mkpath("test-output/conflate"); + TestUtils::mkpath("test-output/elements"); } void runIoTest() @@ -63,10 +63,10 @@ class NodeReplacementsTest : public HootTestFixture m[1] = 2; m[2] = 3; - uut.write("test-output/conflate/Node.replacements"); + uut.write("test-output/elements/Node.replacements"); NodeReplacements uut2; - uut2.read("test-output/conflate/Node.replacements"); + uut2.read("test-output/elements/Node.replacements"); CPPUNIT_ASSERT_EQUAL(std::string("0 : 3\n1 : 3\n2 : 3\n"), uut2.toString().toStdString()); } diff --git a/hoot-core-test/src/test/cpp/hoot/core/ops/CookieCutterOpTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/ops/CookieCutterOpTest.cpp index bed67eb312..cb74164f52 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/ops/CookieCutterOpTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/ops/CookieCutterOpTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/cleaning/MapCleanerTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/ops/MapCleanerTest.cpp similarity index 94% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/cleaning/MapCleanerTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/ops/MapCleanerTest.cpp index 8d80bd7dcb..c3266755ee 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/cleaning/MapCleanerTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/ops/MapCleanerTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/merging/SmallWayMergerTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/ops/SmallWayMergerTest.cpp similarity index 78% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/merging/SmallWayMergerTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/ops/SmallWayMergerTest.cpp index 4bccd294c4..531992375f 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/merging/SmallWayMergerTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/ops/SmallWayMergerTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2012, 2013, 2014, 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include #include #include @@ -53,7 +53,8 @@ class SmallWayMergerTest : public HootTestFixture SmallWayMergerTest() { - TestUtils::mkpath("test-output/conflate"); + setResetType(ResetBasic); + TestUtils::mkpath("test-output/ops/SmallWayMerger"); } void runBasicTest() @@ -62,15 +63,16 @@ class SmallWayMergerTest : public HootTestFixture OsmMapPtr map(new OsmMap()); reader.setDefaultStatus(Status::Unknown1); - reader.read("test-files/conflate/SmallWayMergerInput1.osm", map); + reader.read("test-files/ops/SmallWayMerger/SmallWayMergerInput1.osm", map); MapProjector::projectToPlanar(map); SmallWayMerger::mergeWays(map, 15.0); MapProjector::projectToWgs84(map); OsmXmlWriter writer; - writer.write(map, "test-output/conflate/SmallWayMergerOutput1.osm"); - + writer.write(map, "test-output/ops/SmallWayMerger/SmallWayMergerOutput1.osm"); + HOOT_FILE_EQUALS("test-files/ops/SmallWayMerger/SmallWayMergerOutput1.osm", + "test-output/ops/SmallWayMerger/SmallWayMergerOutput1.osm"); } }; diff --git a/hoot-core-test/src/test/cpp/hoot/core/ops/TrivialOpTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/ops/TrivialOpTest.cpp index f7688e3c0a..8369c574b3 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/ops/TrivialOpTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/ops/TrivialOpTest.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2013, 2014, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2013, 2014, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/scoring/MatchFeatureExtractorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/scoring/MatchFeatureExtractorTest.cpp index 8bd8be28fa..934e1ec1c4 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/scoring/MatchFeatureExtractorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/scoring/MatchFeatureExtractorTest.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2014, 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2014, 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // CPP Unit @@ -34,7 +34,7 @@ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/cleaning/WayCleanerTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/visitors/WayCleanerTest.cpp similarity index 62% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/cleaning/WayCleanerTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/visitors/WayCleanerTest.cpp index 9d5d31f673..bf40c62e0a 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/cleaning/WayCleanerTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/visitors/WayCleanerTest.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 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // CPP Unit @@ -36,7 +36,7 @@ // Hoot #include -#include +#include #include #include @@ -62,25 +62,30 @@ class WayCleanerTest : public HootTestFixture OsmXmlReader reader; OsmMapPtr map(new OsmMap()); reader.setDefaultStatus(Status::Unknown1); - reader.read("test-files/conflate/WayCleanerTest/DuplicateNodesTest.osm", map); + reader.read("test-files/visitors/WayCleanerTest/DuplicateNodesTest.osm", map); - WayPtr cleanedWay(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "1")[0]).get())); + WayPtr cleanedWay( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "1")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateNodes(cleanedWay)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateNodes(cleanedWay)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "2")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "2")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateNodes(cleanedWay)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateNodes(cleanedWay)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "3")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "3")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateNodes(cleanedWay)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateNodes(cleanedWay)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "4")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "4")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateNodes(cleanedWay)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateNodes(cleanedWay)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "5")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "5")[0]).get())); QString exceptionMsg = ""; try { @@ -98,21 +103,25 @@ class WayCleanerTest : public HootTestFixture OsmXmlReader reader; OsmMapPtr map(new OsmMap()); reader.setDefaultStatus(Status::Unknown1); - reader.read("test-files/conflate/WayCleanerTest/DuplicateCoordsTest.osm", map); + reader.read("test-files/visitors/WayCleanerTest/DuplicateCoordsTest.osm", map); - WayPtr cleanedWay(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "1")[0]).get())); + WayPtr cleanedWay( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "1")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateCoords(cleanedWay, *map)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateCoords(cleanedWay, *map)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "2")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "2")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateCoords(cleanedWay, *map)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateCoords(cleanedWay, *map)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "3")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "3")[0]).get())); WayCleaner::cleanWay(cleanedWay, map); - CPPUNIT_ASSERT(!WayCleaner::hasDuplicateCoords(cleanedWay, *map)); + CPPUNIT_ASSERT(!WayCleaner::_hasDuplicateCoords(cleanedWay, *map)); - cleanedWay.reset(new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "4")[0]).get())); + cleanedWay.reset( + new Way(*map->getWay(FindWaysVisitor::findWaysByTag(map, "note", "4")[0]).get())); QString exceptionMsg = ""; try { diff --git a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitorTest.cpp b/hoot-core-test/src/test/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitorTest.cpp similarity index 97% rename from hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitorTest.cpp rename to hoot-core-test/src/test/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitorTest.cpp index ccdce2d58a..8ce5c13b1d 100644 --- a/hoot-core-test/src/test/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitorTest.cpp +++ b/hoot-core-test/src/test/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitorTest.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner1.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner1.cpp index 2ba71b452b..027cb9f8c9 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner1.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner1.cpp @@ -28,7 +28,7 @@ #include "WayJoiner1.h" // Hoot -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner2.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner2.cpp index 191086c086..dcf0b1c145 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner2.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/WayJoiner2.cpp @@ -28,7 +28,7 @@ #include "WayJoiner2.h" // Hoot -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractor.cpp similarity index 98% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.cpp rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractor.cpp index 160e502989..a8f3f0e9d5 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractor.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "PoiPolygonAddressScoreExtractor.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.h b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractor.h similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.h rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractor.h index dfc2766eda..543a8a0f13 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.h +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAddressScoreExtractor.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef POIPOLYGONADDRESSSCOREEXTRACTOR_H #define POIPOLYGONADDRESSSCOREEXTRACTOR_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractor.cpp similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractor.cpp rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractor.cpp diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractor.h b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractor.h similarity index 95% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractor.h rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractor.h index 46d6cf5c52..bcbad43249 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractor.h +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonAlphaShapeDistanceExtractor.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef POIPOLYGONALPHASHAPEDISTANCEEXTRACTOR_H #define POIPOLYGONALPHASHAPEDISTANCEEXTRACTOR_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractor.cpp similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractor.cpp rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractor.cpp diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractor.h b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractor.h similarity index 95% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractor.h rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractor.h index 6e7b94e6a7..4dcf852c1c 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractor.h +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractor.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef POIPOLYGONDISTANCEEXTRACTOR_H #define POIPOLYGONDISTANCEEXTRACTOR_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.cpp similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.cpp rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.cpp index d7eb6cc8ce..d65a4c4574 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "PoiPolygonNameScoreExtractor.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.h b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.h similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.h rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.h index a40a0bc6c1..ee7cda8264 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.h +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef POIPOLYGONNAMESCOREEXTRACTOR_H #define POIPOLYGONNAMESCOREEXTRACTOR_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractor.cpp similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractor.cpp rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractor.cpp index ccbde14446..3dabe90a86 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractor.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "PoiPolygonPhoneNumberScoreExtractor.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractor.h b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractor.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractor.h rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractor.h diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractor.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp similarity index 99% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractor.cpp rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp index c4f990eacc..46af68bfdb 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.cpp @@ -28,8 +28,8 @@ // hoot #include -#include -#include +#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractor.h b/hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractor.h rename to hoot-core/src/main/cpp/hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.h diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheet.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheet.cpp index 25e1dd89b7..3e08a48e2e 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheet.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheet.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetApplier.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetApplier.cpp index 3b94a0f75b..38f691a5f0 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetApplier.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetApplier.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "RubberSheetApplier.h" @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include // Qt diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetDeriver.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetDeriver.cpp index 5450ab69bf..707bee3b5e 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetDeriver.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheetDeriver.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "RubberSheetDeriver.h" @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include // Qt diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheeter.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheeter.cpp index 5ca2619679..2fb868eddf 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheeter.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/rubber-sheet/RubberSheeter.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "RubberSheeter.h" @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include namespace hoot diff --git a/hoot-core/src/main/cpp/hoot/core/algorithms/splitter/LargeWaySplitter.cpp b/hoot-core/src/main/cpp/hoot/core/algorithms/splitter/LargeWaySplitter.cpp index 749044efe9..8d8f98e08e 100644 --- a/hoot-core/src/main/cpp/hoot/core/algorithms/splitter/LargeWaySplitter.cpp +++ b/hoot-core/src/main/cpp/hoot/core/algorithms/splitter/LargeWaySplitter.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/cmd/CleanCmd.cpp b/hoot-core/src/main/cpp/hoot/core/cmd/CleanCmd.cpp index 63c3b2634e..d29e10d53a 100644 --- a/hoot-core/src/main/cpp/hoot/core/cmd/CleanCmd.cpp +++ b/hoot-core/src/main/cpp/hoot/core/cmd/CleanCmd.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/cmd/InfoCmd.cpp b/hoot-core/src/main/cpp/hoot/core/cmd/InfoCmd.cpp index 4f236bc364..a7ff2a4e2e 100644 --- a/hoot-core/src/main/cpp/hoot/core/cmd/InfoCmd.cpp +++ b/hoot-core/src/main/cpp/hoot/core/cmd/InfoCmd.cpp @@ -307,7 +307,9 @@ class InfoCmd : public BaseCommand options.append("--formats"); options.append("--languages"); options.append("--matchers"); + options.append("--match-creators"); options.append("--mergers"); + options.append("--merger-creators"); options.append("--operators"); options.append("--string-comparators"); options.append("--subline-matchers"); diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.h b/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.h deleted file mode 100644 index bd3e9c654a..0000000000 --- a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * This file is part of Hootenanny. - * - * Hootenanny is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * -------------------------------------------------------------------- - * - * The following copyright notices are generated automatically. If you - * have a new notice to add, please use the format: - * " * @copyright Copyright ..." - * This will properly maintain the copyright information. DigitalGlobe - * copyrights will be updated automatically. - * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) - */ -#ifndef WAYCLEANER_H -#define WAYCLEANER_H - -#include - -namespace hoot -{ - -/** - * Cleans ways - */ -class WayCleaner -{ - public: - - static std::string className() { return "hoot::WayCleaner"; } - - static unsigned int logWarnCount; - - /** - * Determines whether a way has more than one node with the same coordinate (nodes with - * different ID's and having the same exact coordinate). - * - * @param way the way to be examined for duplicate coordinates - * @param map the map owning the way being examined - * @param logDetails if true, details about the duplicate coordinates are logged - * @return true if the way has coordinates; false otherwise - */ - static bool hasDuplicateCoords(ConstWayPtr way, const OsmMap& map, - const bool logDetails = false); - - /** - * Determines whether a way has more than one node with the same coordinate (nodes with - * different ID's and having the same exact coordinate). - * - * @param way the way to be examined for duplicate nodes - * @param logDetails if true, details about the duplicate nodes are logged - * @return true if the way has duplicate nodes; false otherwise - */ - static bool hasDuplicateNodes(ConstWayPtr way, const bool logDetails = false); - - /** - * Determines whether a way is of zero length - * - * Only returns true for ways of size two. - * - * @param way way to be examined - * @param map the map owning the way to be examined - * @return true if the way is of zero length; false otherwise - */ - static bool isZeroLengthWay(ConstWayPtr way, const ConstOsmMapPtr& map); - - /** - * Removes duplicate nodes and coordinates from a way - * - * @param way the way to be cleaned - * @param map the map owning the way to be cleaned - */ - static void cleanWay(WayPtr way, const ConstOsmMapPtr& map); - - /** - * Cleans an unmodifiable way by removing duplicate nodes and coordinate from a copy of it - * and returning the copy. - * - * @param way the way to be cleaned; will be copied - * @pdddaram map the map owning the way to be cleaned - * @return an unmodifiable cleaned way - * @see cleanWay - */ - static ConstWayPtr cleanWay(ConstWayPtr way, const ConstOsmMapPtr& map); - - /** - * Cleans unmodifiable ways by removing duplicate nodes and coordinate from copies of them and - * returning the copies - * - * Zero length ways are removed. It copies the input way and returns unmodifiable way to allow - * the method to be used inside conflation methods expecting const ways. - * - * @param ways the ways to be cleaned; will be copied - * @param map the map owning the ways to be cleaned - * @return a collection of unmodifiable cleaned ways - */ - static std::vector cleanWays(const std::vector& ways, const ConstOsmMapPtr& map); -}; - -} - -#endif // WAYCLEANER_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.cpp index 46e4a7aae0..2f602b1d6a 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.cpp @@ -47,15 +47,22 @@ #include #include #include +#include using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Match, HighwayMatch) + QString HighwayMatch::_noMatchingSubline = "No valid matching subline found."; QString HighwayMatch::_matchName = "Highway"; +HighwayMatch::HighwayMatch() : Match() +{ +} + HighwayMatch::HighwayMatch(const boost::shared_ptr& classifier, const boost::shared_ptr& sublineMatcher, const ConstOsmMapPtr& map, const ElementId& eid1, const ElementId& eid2, diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.h b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.h index 6be0bdc4c7..f03ff606fd 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatch.h @@ -55,6 +55,9 @@ class HighwayMatch : public Match, public MatchDetails { public: + static std::string className() { return "hoot::HighwayMatch"; } + + HighwayMatch(); HighwayMatch(const boost::shared_ptr& classifier, const boost::shared_ptr& sublineMatcher, const ConstOsmMapPtr& map, const ElementId& eid1, const ElementId& eid2, @@ -87,6 +90,9 @@ class HighwayMatch : public Match, public MatchDetails virtual QString toString() const; + virtual QString getDescription() const + { return "Matches roads with the 2nd Generation (Unifying) Algorithm"; } + private: boost::shared_ptr _classifier; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatchCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatchCreator.cpp index 03e93a8a93..7127a375d5 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatchCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMatchCreator.cpp @@ -335,8 +335,9 @@ vector HighwayMatchCreator::getAllCreators() const vector result; result.push_back( CreatorDescription( - className(), "Matches roads with the 2nd generation algorithm", CreatorDescription::Highway, - false)); + className(), + "Generates matchers that match roads with the 2nd Generation (Unifying) Algorithm", + CreatorDescription::Highway, false)); return result; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerAbstract.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerAbstract.cpp index 6400b0954b..d9f0e6e878 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerAbstract.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerAbstract.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerCreator.cpp index f44447bfbc..b6b83ff282 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayMergerCreator.cpp @@ -102,7 +102,8 @@ vector HighwayMergerCreator::getAllCreators() const { vector result; result.push_back( - CreatorDescription(className(), "Merges roads conflated with the non-greedy algorithm", false)); + CreatorDescription(className(), + "Generates mergers that merge roads with the 2nd Generation (Unifying) Algorithm", false)); return result; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.cpp index 1d3ce41e71..59d256611e 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,6 +53,7 @@ #include #include #include +#include // Qt #include @@ -63,8 +64,15 @@ using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, HighwaySnapMerger) + unsigned int HighwaySnapMerger::logWarnCount = 0; +HighwaySnapMerger::HighwaySnapMerger() : +HighwayMergerAbstract() +{ +} + HighwaySnapMerger::HighwaySnapMerger( const set>& pairs, const boost::shared_ptr& sublineMatcher) : diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.h index f4b1752e19..22a2b2a495 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwaySnapMerger.h @@ -49,6 +49,7 @@ class HighwaySnapMerger : public HighwayMergerAbstract static unsigned int logWarnCount; + HighwaySnapMerger(); HighwaySnapMerger( const std::set>& pairs, const boost::shared_ptr& sublineMatcher); @@ -64,6 +65,8 @@ class HighwaySnapMerger : public HighwayMergerAbstract virtual bool _mergePair(const OsmMapPtr& map, ElementId eid1, ElementId eid2, std::vector>& replaced); + virtual QString getDescription() const { return "Merges both road geometries and tags"; } + private: boost::shared_ptr _sublineMatcher; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.cpp index 02c2d3ad5e..7f31e19993 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.cpp @@ -35,10 +35,18 @@ #include #include #include +#include namespace hoot { +HOOT_FACTORY_REGISTER(Merger, HighwayTagOnlyMerger) + +HighwayTagOnlyMerger::HighwayTagOnlyMerger() : +HighwaySnapMerger() +{ +} + HighwayTagOnlyMerger::HighwayTagOnlyMerger(const std::set>& pairs) : HighwaySnapMerger(pairs, boost::shared_ptr()), _performBridgeGeometryMerging(false) diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.h index 5bd89bf668..f396bbf0cb 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayTagOnlyMerger.h @@ -46,11 +46,15 @@ class HighwayTagOnlyMerger : public HighwaySnapMerger static std::string className() { return "hoot::HighwayTagOnlyMerger"; } + HighwayTagOnlyMerger(); HighwayTagOnlyMerger(const std::set>& pairs); HighwayTagOnlyMerger(const std::set>& pairs, const boost::shared_ptr& sublineMatcher); ~HighwayTagOnlyMerger(); + virtual QString getDescription() const + { return "Merges road tags only (some geometry exceptions)"; } + protected: virtual bool _mergePair( diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/ImpliedDividedMarker.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/ImpliedDividedMarker.cpp index 801c12c6e1..e6b2fd7c17 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/ImpliedDividedMarker.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/ImpliedDividedMarker.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 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "ImpliedDividedMarker.h" @@ -35,7 +35,7 @@ #include #include #include -#include +#include // Standard #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/Roundabout.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/highway/Roundabout.cpp index e5d2f316f5..8f9cbce517 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/Roundabout.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/highway/Roundabout.cpp @@ -28,7 +28,7 @@ #include "Roundabout.h" #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.cpp index 9a1562dfa2..6aa56d97f6 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "Match.h" @@ -37,9 +37,12 @@ namespace hoot long Match::_orderCount = 0; -Match::~Match() +Match::Match() { +} +Match::~Match() +{ } QString Match::explain() const diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.h b/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.h index 8ce5bd16a1..fedca46240 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/matching/Match.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef MATCH_H #define MATCH_H @@ -30,6 +30,7 @@ // hoot #include #include +#include // Standard #include @@ -48,10 +49,13 @@ class MatchClassification; * * This class is not re-entrant or thread safe. */ -class Match +class Match : public ApiEntityInfo { public: + static std::string className() { return "hoot::Match"; } + + Match(); virtual ~Match(); virtual QString explain() const; @@ -134,6 +138,8 @@ class Match */ virtual MatchType getType() const; + virtual QString getDescription() const = 0; + protected: /* diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchCreator.h b/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchCreator.h index 9fc34a9d16..740c59db02 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchCreator.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/matching/MatchCreator.h @@ -87,7 +87,7 @@ class MatchCreator */ virtual void setArguments(QStringList /*args*/) { - throw HootException("This match creator takes no argument."); + throw HootException("This match creator takes no arguments."); } /* diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/matching/NodeMatcher.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/matching/NodeMatcher.cpp index 1da6a690b3..5aad8a4300 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/matching/NodeMatcher.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/matching/NodeMatcher.cpp @@ -29,7 +29,7 @@ // Hoot #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.cpp index ef3522bc70..78f311c5a2 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.cpp @@ -22,19 +22,26 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "MarkForReviewMerger.h" // hoot #include #include +#include using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, MarkForReviewMerger) + +MarkForReviewMerger::MarkForReviewMerger() +{ +} + MarkForReviewMerger::MarkForReviewMerger(const set< pair >& pairs, QString note, QString reviewType, double score) : _pairs(pairs), diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.h index 847a695b92..f962093a2f 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMerger.h @@ -36,11 +36,16 @@ namespace hoot /** * Marks all the specified pairs with review tags using ReviewMarker. + * + * @todo Should this inherit MergerBase instead? */ class MarkForReviewMerger : public Merger { public: + static std::string className() { return "hoot::MarkForReviewMerger"; } + + MarkForReviewMerger(); /** * Constructed with a set of element matching pairs. The pairs are generally Unknown1 as first * and Unknown2 as second. @@ -55,7 +60,8 @@ class MarkForReviewMerger : public Merger MarkForReviewMerger(const std::set& eids, QString note, QString reviewType, double score); - virtual void apply(const OsmMapPtr& map, std::vector< std::pair >& replaced) override; + virtual void apply(const OsmMapPtr& map, + std::vector>& replaced) override; virtual std::set getImpactedElementIds() const override; @@ -65,6 +71,9 @@ class MarkForReviewMerger : public Merger virtual QString toString() const override; + virtual QString getDescription() const + { return "Marks elements as needing review before merging"; } + private: std::set _eids; @@ -73,7 +82,6 @@ class MarkForReviewMerger : public Merger QString _reviewType; double _score; ReviewMarker _reviewMarker; - }; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.cpp index c411d2d782..07470f71fc 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.cpp @@ -103,6 +103,7 @@ bool MarkForReviewMergerCreator::createMergers(const MatchSet& matches, vector MarkForReviewMergerCreator::getAllCreators() const { // don't provide this as an option in the UI. This will be added automatically in the right place. + // TODO: How do we get a description back for this one? return vector(); } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.h b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.h index c491c36875..13d6f90f76 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MarkForReviewMergerCreator.h @@ -49,7 +49,6 @@ class MarkForReviewMergerCreator : public MergerCreator virtual std::vector getAllCreators() const override; virtual bool isConflicting(const ConstOsmMapPtr& map, const Match* m1, const Match* m2) const; - }; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/Merger.h b/hoot-core/src/main/cpp/hoot/core/conflate/merging/Merger.h index 4589a1b34c..0471b480e8 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/Merger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/Merger.h @@ -30,6 +30,7 @@ // hoot #include #include +#include // Standard #include @@ -40,10 +41,12 @@ namespace hoot /** * Mergers are created by the MergerFactory. */ -class Merger +class Merger : public ApiEntityInfo { public: + static std::string className() { return "hoot::Merger"; } + virtual ~Merger() {} /** @@ -74,6 +77,8 @@ class Merger virtual void replace(ElementId oldEid, ElementId newEid) = 0; virtual QString toString() const = 0; + + virtual QString getDescription() const = 0; }; typedef boost::shared_ptr MergerPtr; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.cpp index f7e0869552..23ff26f5f3 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.cpp @@ -31,6 +31,14 @@ using namespace std; namespace hoot { +MergerBase::MergerBase() +{ +} + +MergerBase::~MergerBase() +{ +} + set MergerBase::getImpactedElementIds() const { set result; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.h b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.h index 5b37034bb2..764aa629d7 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/merging/MergerBase.h @@ -40,9 +40,8 @@ class MergerBase : public Merger typedef std::set> PairsSet; - MergerBase() {} - - virtual ~MergerBase() {} + MergerBase(); + virtual ~MergerBase(); virtual std::set getImpactedElementIds() const override; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.cpp index 6434d029ae..fc065dd626 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.cpp @@ -22,12 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "NetworkMatch.h" // hoot #include +#include // Standard #include @@ -37,6 +38,13 @@ using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Match, NetworkMatch) + +NetworkMatch::NetworkMatch() : +Match() +{ +} + NetworkMatch::NetworkMatch(const ConstNetworkDetailsPtr &details, ConstEdgeMatchPtr edgeMatch, double score, ConstMatchThresholdPtr mt) : diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.h b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.h index 47f877cd0f..a2c5c9fb65 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatch.h @@ -44,6 +44,9 @@ class NetworkMatch : public Match { public: + static std::string className() { return "hoot::NetworkMatch"; } + + NetworkMatch(); NetworkMatch(const ConstNetworkDetailsPtr& details, ConstEdgeMatchPtr edgeMatch, double score, ConstMatchThresholdPtr mt); @@ -106,6 +109,8 @@ class NetworkMatch : public Match bool contains(const NetworkMatch* other) const; + virtual QString getDescription() const { return "Matches roads with the Network Algorithm"; } + protected: void _discoverWayPairs(ConstOsmMapPtr map, ConstEdgeMatchPtr edgeMatch); diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatchCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatchCreator.cpp index e1d0b817b7..2636210f84 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatchCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMatchCreator.cpp @@ -190,7 +190,7 @@ vector NetworkMatchCreator::getAllCreators() const vector result; result.push_back( CreatorDescription( - className(), "Matches roads with the 3rd generation network based algorithm", + className(), "Generates matchers that match roads with the Network Algorithm", CreatorDescription::BaseFeatureType::Highway, false)); return result; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.cpp index b3a3de6df6..1150e1d249 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,12 +39,20 @@ #include #include #include +#include using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, NetworkMerger) + +NetworkMerger::NetworkMerger() : +MergerBase() +{ +} + NetworkMerger::NetworkMerger(const set< pair >& pairs, ConstEdgeMatchPtr edgeMatch, ConstNetworkDetailsPtr details) : _pairs(pairs), diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.h index e93793db92..603dccc128 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMerger.h @@ -45,6 +45,9 @@ class NetworkMerger : public MergerBase { public: + static std::string className() { return "hoot::NetworkMerger"; } + + NetworkMerger(); /** * Constructed with a set of element matching pairs. The pairs are generally Unknown1 as first * and Unknown2 as second. @@ -52,10 +55,13 @@ class NetworkMerger : public MergerBase NetworkMerger(const std::set>& pairs, ConstEdgeMatchPtr edgeMatch, ConstNetworkDetailsPtr details); - virtual void apply(const OsmMapPtr& map, std::vector>& replaced) override; + virtual void apply(const OsmMapPtr& map, + std::vector>& replaced) override; virtual QString toString() const override; + virtual QString getDescription() const { return "Merges roads matched by the Network Algorithm"; } + protected: virtual PairsSet& _getPairs() override { return _pairs; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMergerCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMergerCreator.cpp index 80014df279..51a2c56f08 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMergerCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/NetworkMergerCreator.cpp @@ -207,7 +207,9 @@ vector NetworkMergerCreator::getAllCreators() const { vector result; result.push_back( - CreatorDescription(className(), "Merges roads conflated with the network algorithm", false)); + CreatorDescription( + className(), "Generates mergers that merge roads conflated with the Network Algorithm", + false)); return result; } @@ -233,7 +235,7 @@ bool NetworkMergerCreator::_containsOverlap(const MatchSet& matches) const LOG_VART(*it); LOG_VART(*jt); throw UnsupportedException( - "If one match is a network match they should all be network matches."); + "If one match is a network match they should all be network matches."); } if (nmi->getEdgeMatch()->overlaps(nmj->getEdgeMatch())) diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.cpp index 03ca5e027f..a1f0aaa2ac 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -39,12 +39,20 @@ #include #include #include +#include using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, PartialNetworkMerger) + +PartialNetworkMerger::PartialNetworkMerger() : +MergerBase() +{ +} + PartialNetworkMerger::PartialNetworkMerger(const set< pair >& pairs, QSet edgeMatches, ConstNetworkDetailsPtr details) : diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.h index 59ca8aebe7..838f959837 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/network/PartialNetworkMerger.h @@ -45,6 +45,9 @@ class PartialNetworkMerger : public MergerBase, public EidMapper { public: + static std::string className() { return "hoot::PartialNetworkMerger"; } + + PartialNetworkMerger(); /** * Constructed with a set of element matching pairs. The pairs are generally Unknown1 as first * and Unknown2 as second. @@ -64,6 +67,8 @@ class PartialNetworkMerger : public MergerBase, public EidMapper virtual QString toString() const; + virtual QString getDescription() const { return "Merges roads matched by the Network Algorithm"; } + protected: virtual PairsSet& _getPairs() { return _pairs; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonAdvancedMatcher.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonAdvancedMatcher.cpp index b47343c6cd..3eead402e8 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonAdvancedMatcher.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonAdvancedMatcher.cpp @@ -33,8 +33,8 @@ // hoot #include -#include -#include +#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.cpp index 03e5068342..1079b14c3e 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.cpp @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -47,6 +47,8 @@ using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Match, PoiPolygonMatch) + QString PoiPolygonMatch::_matchName = "POI to Polygon"; boost::shared_ptr PoiPolygonMatch::_translator; @@ -65,6 +67,11 @@ long PoiPolygonMatch::phoneNumbersProcesed = 0; long PoiPolygonMatch::phoneNumberMatchCandidates = 0; long PoiPolygonMatch::convexPolyDistanceMatches = 0; +PoiPolygonMatch::PoiPolygonMatch() : +Match() +{ +} + PoiPolygonMatch::PoiPolygonMatch(const ConstOsmMapPtr& map, ConstMatchThresholdPtr threshold, boost::shared_ptr rf, const set& polyNeighborIds, diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.h b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.h index 2da8d5799e..c15e8dfcae 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatch.h @@ -35,14 +35,14 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include namespace hoot { @@ -58,6 +58,9 @@ class PoiPolygonMatch : public Match, public MatchDetails, public Configurable public: + static std::string className() { return "hoot::PoiPolygonMatch"; } + + PoiPolygonMatch(); PoiPolygonMatch(const ConstOsmMapPtr& map, ConstMatchThresholdPtr threshold, boost::shared_ptr rf, const std::set& polyNeighborIds = std::set(), @@ -98,6 +101,8 @@ class PoiPolygonMatch : public Match, public MatchDetails, public Configurable virtual QString explain() const { return _explainText; } + virtual QString getDescription() const { return "Matches POIs with polygons"; } + void setMatchDistanceThreshold(const double distance); void setReviewDistanceThreshold(const double distance); void setNameScoreThreshold(const double threshold); diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.cpp index ff879a28f0..f51b149954 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -111,7 +111,7 @@ std::vector PoiPolygonMatchCreator::getAllCreators() const result.push_back( CreatorDescription( className(), - "Matches POIs to polygons", + "Generates matchers that match POIs to polygons", //this match creator has two conflatable types, so arbitrarily just picking one of them as //the base feature type; stats class will handle the logic to deal with both poi and polygon //input types diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.h b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.h index 8c85fec979..7f6ad21d47 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMatchCreator.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef POIPOLYGONMATCHCREATOR_H #define POIPOLYGONMATCHCREATOR_H @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include namespace hoot { diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.cpp index 51add57b02..d507347087 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.cpp @@ -33,21 +33,29 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include #include +#include using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, PoiPolygonMerger) + unsigned int PoiPolygonMerger::logWarnCount = 0; +PoiPolygonMerger::PoiPolygonMerger() : +MergerBase() +{ +} + PoiPolygonMerger::PoiPolygonMerger(const set< pair >& pairs) : _pairs(pairs), _autoMergeManyPoiToOnePolyMatches(ConfigOptions().getPoiPolygonAutoMergeManyPoiToOnePolyMatches()) diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.h index edcdcc5616..f435f4f68a 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMerger.h @@ -55,6 +55,7 @@ class PoiPolygonMerger : public MergerBase static unsigned int logWarnCount; + PoiPolygonMerger(); /** * Constructed with a set of element matching pairs. The pairs are generally Unknown1 as first * and Unknown2 as second. @@ -75,6 +76,8 @@ class PoiPolygonMerger : public MergerBase */ static ElementId mergePoiAndPolygon(OsmMapPtr map); + virtual QString getDescription() const { return "Merges POIs into polygons"; } + protected: virtual PairsSet& _getPairs() override { return _pairs; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.cpp index 5a6b1b1b9a..0db04feba5 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "PoiPolygonMergerCreator.h" @@ -139,7 +139,8 @@ bool PoiPolygonMergerCreator::createMergers(const MatchSet& matches, vector PoiPolygonMergerCreator::getAllCreators() const { vector result; - result.push_back(CreatorDescription(className(), "Merges POIs into polygons", false)); + result.push_back( + CreatorDescription(className(), "Generates mergers that merge POIs into polygons", false)); return result; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.h b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.h index edd552831b..23a4904bfb 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonMergerCreator.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef POIPOLYGONMERGERCREATOR_H #define POIPOLYGONMERGERCREATOR_H @@ -30,8 +30,8 @@ // hoot #include #include -#include -#include +#include +#include namespace hoot { diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp index baf50c95ff..d85e43e6f4 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonReviewReducer.cpp @@ -35,9 +35,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonRfClassifier.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonRfClassifier.cpp index 845f135303..1927e0fcc2 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonRfClassifier.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/PoiPolygonRfClassifier.cpp @@ -22,16 +22,16 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "PoiPolygonRfClassifier.h" // hoot -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include using namespace std; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.cpp index a48973a9e4..74311ca6c4 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.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 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "BuildingMatch.h" @@ -34,6 +34,7 @@ #include #include #include +#include // Qt #include @@ -43,8 +44,15 @@ using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Match, BuildingMatch) + QString BuildingMatch::_matchName = "Building"; +BuildingMatch::BuildingMatch() : +Match() +{ +} + BuildingMatch::BuildingMatch(const ConstOsmMapPtr& map, boost::shared_ptr rf, const ElementId& eid1, const ElementId& eid2, diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.h b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.h index 6588efe579..11da111570 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatch.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef BUILDINGMATCH_H #define BUILDINGMATCH_H @@ -50,6 +50,9 @@ class BuildingMatch : public Match, public MatchDetails { public: + static std::string className() { return "hoot::BuildingMatch"; } + + BuildingMatch(); BuildingMatch(const ConstOsmMapPtr& map, boost::shared_ptr rf, const ElementId& eid1, const ElementId& eid2, ConstMatchThresholdPtr mt, bool reviewIfSecondaryFeatureNewer, QString dateTagKey, QString dateFormat); @@ -79,6 +82,8 @@ class BuildingMatch : public Match, public MatchDetails virtual QString explain() const { return _explainText; } virtual void setExplain(const QString explainText) { _explainText = explainText; } + virtual QString getDescription() const { return "Matches buildings"; } + private: ElementId _eid1, _eid2; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatchCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatchCreator.cpp index 3b828b3668..4486599c97 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatchCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMatchCreator.cpp @@ -336,7 +336,8 @@ std::vector BuildingMatchCreator::getAllCreators() const { std::vector result; result.push_back( - CreatorDescription(className(), "Matches buildings", CreatorDescription::Building, false)); + CreatorDescription( + className(), "Generates matchers that match buildings", CreatorDescription::Building, false)); return result; } 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 e932c0c8f0..943281434c 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 @@ -43,12 +43,15 @@ #include #include #include +#include using namespace std; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, BuildingMerger) + class DeletableBuildingCriterion : public ElementCriterion { @@ -88,6 +91,11 @@ class DeletableBuildingCriterion : public ElementCriterion unsigned int BuildingMerger::logWarnCount = 0; +BuildingMerger::BuildingMerger() : +MergerBase() +{ +} + BuildingMerger::BuildingMerger(const set< pair >& pairs) : _pairs(pairs), _keepMoreComplexGeometryWhenAutoMerging( diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.h b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.h index 41cd9f4691..e38a9b8826 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.h +++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMerger.h @@ -43,8 +43,11 @@ class BuildingMerger : public MergerBase { public: + static std::string className() { return "hoot::BuildingMerger"; } + static unsigned int logWarnCount; + BuildingMerger(); /** * Constructed with a set of element matching pairs. The pairs are generally Unknown1 as first * and Unknown2 as second. @@ -71,6 +74,8 @@ class BuildingMerger : public MergerBase void setKeepMoreComplexGeometryWhenAutoMerging(bool keepMoreComplex) { _keepMoreComplexGeometryWhenAutoMerging = keepMoreComplex; } + virtual QString getDescription() const { return "Merges buildings"; } + protected: virtual PairsSet& _getPairs() override { return _pairs; } diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp index 83a9333e20..58d3225f4d 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/conflate/polygon/BuildingMergerCreator.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "BuildingMergerCreator.h" @@ -86,7 +86,8 @@ bool BuildingMergerCreator::createMergers(const MatchSet& matches, vector BuildingMergerCreator::getAllCreators() const { vector result; - result.push_back(CreatorDescription(className(), "Merges buildings together", false)); + result.push_back( + CreatorDescription(className(), "Generates mergers that merge buildings together", false)); return result; } diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/BuildingWayNodeCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/BuildingWayNodeCriterion.cpp index a6b632d3de..a6a9df8e68 100644 --- a/hoot-core/src/main/cpp/hoot/core/criterion/BuildingWayNodeCriterion.cpp +++ b/hoot-core/src/main/cpp/hoot/core/criterion/BuildingWayNodeCriterion.cpp @@ -22,14 +22,14 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "BuildingWayNodeCriterion.h" // hoot #include #include -#include +#include #include using namespace std; diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/HighwayIntersectionCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/HighwayIntersectionCriterion.cpp index b8263d1d8a..ddb01d9b0b 100644 --- a/hoot-core/src/main/cpp/hoot/core/criterion/HighwayIntersectionCriterion.cpp +++ b/hoot-core/src/main/cpp/hoot/core/criterion/HighwayIntersectionCriterion.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "HighwayIntersectionCriterion.h" // hoot #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/UselessElementCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/UselessElementCriterion.cpp index b514bb11c5..3f4e3055eb 100644 --- a/hoot-core/src/main/cpp/hoot/core/criterion/UselessElementCriterion.cpp +++ b/hoot-core/src/main/cpp/hoot/core/criterion/UselessElementCriterion.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "UselessElementCriterion.h" @@ -33,7 +33,7 @@ #include #include #include -#include +#include namespace hoot { diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPoiCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.cpp similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPoiCriterion.cpp rename to hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.cpp diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPoiCriterion.h b/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPoiCriterion.h rename to hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.h diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPolyCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterion.cpp similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPolyCriterion.cpp rename to hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterion.cpp diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPolyCriterion.h b/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterion.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/criterion/PoiPolygonPolyCriterion.h rename to hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterion.h diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/NodeReplacements.cpp b/hoot-core/src/main/cpp/hoot/core/elements/NodeReplacements.cpp similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/NodeReplacements.cpp rename to hoot-core/src/main/cpp/hoot/core/elements/NodeReplacements.cpp index 8fbcf1852a..60ba16397a 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/NodeReplacements.cpp +++ b/hoot-core/src/main/cpp/hoot/core/elements/NodeReplacements.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "NodeReplacements.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/NodeReplacements.h b/hoot-core/src/main/cpp/hoot/core/elements/NodeReplacements.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/NodeReplacements.h rename to hoot-core/src/main/cpp/hoot/core/elements/NodeReplacements.h diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/NodeToWayMap.cpp b/hoot-core/src/main/cpp/hoot/core/elements/NodeToWayMap.cpp similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/NodeToWayMap.cpp rename to hoot-core/src/main/cpp/hoot/core/elements/NodeToWayMap.cpp index c1821eae88..95af7d9a7c 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/NodeToWayMap.cpp +++ b/hoot-core/src/main/cpp/hoot/core/elements/NodeToWayMap.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "NodeToWayMap.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/NodeToWayMap.h b/hoot-core/src/main/cpp/hoot/core/elements/NodeToWayMap.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/NodeToWayMap.h rename to hoot-core/src/main/cpp/hoot/core/elements/NodeToWayMap.h diff --git a/hoot-core/src/main/cpp/hoot/core/elements/OsmMap.cpp b/hoot-core/src/main/cpp/hoot/core/elements/OsmMap.cpp index d1c5341ee5..c5c0276c24 100644 --- a/hoot-core/src/main/cpp/hoot/core/elements/OsmMap.cpp +++ b/hoot-core/src/main/cpp/hoot/core/elements/OsmMap.cpp @@ -37,7 +37,7 @@ using namespace boost; #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.cpp b/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.cpp index 56d0c984fd..35ca2e68ec 100644 --- a/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.cpp +++ b/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.cpp @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include //Qt diff --git a/hoot-core/src/main/cpp/hoot/core/index/OsmMapIndex.cpp b/hoot-core/src/main/cpp/hoot/core/index/OsmMapIndex.cpp index b316e38335..a94b7783e6 100644 --- a/hoot-core/src/main/cpp/hoot/core/index/OsmMapIndex.cpp +++ b/hoot-core/src/main/cpp/hoot/core/index/OsmMapIndex.cpp @@ -35,7 +35,7 @@ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp b/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp index 2345fef4a8..063ffce95e 100644 --- a/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp +++ b/hoot-core/src/main/cpp/hoot/core/info/ApiEntityDisplayInfo.cpp @@ -44,6 +44,8 @@ #include #include #include +#include +#include // Qt #include @@ -71,10 +73,10 @@ static const int MAX_TYPE_SIZE = 18; template QString getApiEntities(const std::string& apiEntityBaseClassName, const QString apiEntityType, - const bool displayType, - //the size of the longest names plus a 3 space buffer; the value passed in - //here by callers may have to be adjusted over time for some entity types - const int maxNameSize) + const bool displayType, + //the size of the longest names plus a 3 space buffer; the value passed in + //here by callers may have to be adjusted over time for some entity types + const int maxNameSize) { LOG_VARD(apiEntityBaseClassName); std::vector classNames = @@ -135,8 +137,8 @@ QString getApiEntities(const std::string& apiEntityBaseClassName, const QString return ts.readAll(); } -//matchers/mergers have a more roundabout way to get at the description, so we'll create a new -//display method for them +// match/merger creators have a more roundabout way to get at the description, so we'll create a new +// display method for them template QString getApiEntities2(const std::string& apiEntityClassName) { @@ -303,14 +305,30 @@ QString ApiEntityDisplayInfo::getDisplayInfo(const QString apiEntityType) else if (apiEntityType == "matchers") { msg += "):"; - msg.prepend("Conflate Matchers"); + msg.prepend("Matchers"); ts << msg << endl; - ts << getApiEntities2(MatchCreator::className()); + ts << getApiEntities( + Match::className(), "matcher", false, MAX_NAME_SIZE); } else if (apiEntityType == "mergers") { msg += "):"; - msg.prepend("Conflate Mergers"); + msg.prepend("Mergers"); + ts << msg << endl; + ts << getApiEntities( + Merger::className(), "merger", false, MAX_NAME_SIZE); + } + else if (apiEntityType == "match-creators") + { + msg += "):"; + msg.prepend("Conflate Match Creators"); + ts << msg << endl; + ts << getApiEntities2(MatchCreator::className()); + } + else if (apiEntityType == "merger-creators") + { + msg += "):"; + msg.prepend("Conflate Merger Creators"); ts << msg << endl; ts << getApiEntities2(MergerCreator::className()); } diff --git a/hoot-core/src/main/cpp/hoot/core/info/CreatorDescription.cpp b/hoot-core/src/main/cpp/hoot/core/info/CreatorDescription.cpp index ede8fd7a5e..333ba3c9f7 100644 --- a/hoot-core/src/main/cpp/hoot/core/info/CreatorDescription.cpp +++ b/hoot-core/src/main/cpp/hoot/core/info/CreatorDescription.cpp @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineRemoveOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineRemoveOp.cpp index 41068206ab..7e2463f246 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineRemoveOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineRemoveOp.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "BuildingOutlineRemoveOp.h" @@ -34,7 +34,7 @@ // hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineUpdateOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineUpdateOp.cpp index e536bfd514..e424726516 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineUpdateOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/BuildingOutlineUpdateOp.cpp @@ -36,7 +36,7 @@ // hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/BuildingPartMergeOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/BuildingPartMergeOp.cpp index 7e61c64b4a..2389234bf1 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/BuildingPartMergeOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/BuildingPartMergeOp.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/CalculateStatsOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/CalculateStatsOp.cpp index 36a03b0af0..f47f1bb0b4 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/CalculateStatsOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/CalculateStatsOp.cpp @@ -63,8 +63,8 @@ #include #include #include -#include -#include +#include +#include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/DuplicateWayRemover.cpp b/hoot-core/src/main/cpp/hoot/core/ops/DuplicateWayRemover.cpp index 6b658d32b2..18ad4b95d0 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/DuplicateWayRemover.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/DuplicateWayRemover.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 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "DuplicateWayRemover.h" @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/FindHighwayIntersectionsOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/FindHighwayIntersectionsOp.cpp index b3c02f2874..07deaa3f9d 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/FindHighwayIntersectionsOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/FindHighwayIntersectionsOp.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayReviewCleanerOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/HighwayReviewCleanerOp.cpp similarity index 96% rename from hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayReviewCleanerOp.cpp rename to hoot-core/src/main/cpp/hoot/core/ops/HighwayReviewCleanerOp.cpp index 911d3998de..b6d3c534b7 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayReviewCleanerOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/HighwayReviewCleanerOp.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 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "HighwayReviewCleanerOp.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayReviewCleanerOp.h b/hoot-core/src/main/cpp/hoot/core/ops/HighwayReviewCleanerOp.h similarity index 95% rename from hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayReviewCleanerOp.h rename to hoot-core/src/main/cpp/hoot/core/ops/HighwayReviewCleanerOp.h index db7bb5bf94..25d587f9a9 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/HighwayReviewCleanerOp.h +++ b/hoot-core/src/main/cpp/hoot/core/ops/HighwayReviewCleanerOp.h @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef HIGHWAYREVIEWCLEANEROP_H #define HIGHWAYREVIEWCLEANEROP_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/MapCleaner.cpp b/hoot-core/src/main/cpp/hoot/core/ops/MapCleaner.cpp similarity index 93% rename from hoot-core/src/main/cpp/hoot/core/conflate/cleaning/MapCleaner.cpp rename to hoot-core/src/main/cpp/hoot/core/ops/MapCleaner.cpp index 3ee09fe9a7..dd71bfd7d6 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/MapCleaner.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/MapCleaner.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 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "MapCleaner.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/MapCleaner.h b/hoot-core/src/main/cpp/hoot/core/ops/MapCleaner.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/cleaning/MapCleaner.h rename to hoot-core/src/main/cpp/hoot/core/ops/MapCleaner.h diff --git a/hoot-core/src/main/cpp/hoot/core/ops/MapCropper.cpp b/hoot-core/src/main/cpp/hoot/core/ops/MapCropper.cpp index d269c59f0c..fa409a11fc 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/MapCropper.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/MapCropper.cpp @@ -39,7 +39,7 @@ // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/ops/RemoveNodeOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/RemoveNodeOp.cpp index 760946a490..be28f1e7ce 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/RemoveNodeOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/RemoveNodeOp.cpp @@ -29,7 +29,7 @@ // hoot #include #include -#include +#include #include using namespace std; diff --git a/hoot-core/src/main/cpp/hoot/core/ops/RemoveRelationOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/RemoveRelationOp.cpp index cb83f0fe78..769e8abc88 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/RemoveRelationOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/RemoveRelationOp.cpp @@ -29,7 +29,7 @@ // hoot #include #include -#include +#include #include using namespace std; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/RemoveRoundabouts.cpp b/hoot-core/src/main/cpp/hoot/core/ops/RemoveRoundabouts.cpp similarity index 97% rename from hoot-core/src/main/cpp/hoot/core/conflate/highway/RemoveRoundabouts.cpp rename to hoot-core/src/main/cpp/hoot/core/ops/RemoveRoundabouts.cpp index e2e741e048..552f78fa5a 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/RemoveRoundabouts.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/RemoveRoundabouts.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "RemoveRoundabouts.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/RemoveRoundabouts.h b/hoot-core/src/main/cpp/hoot/core/ops/RemoveRoundabouts.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/highway/RemoveRoundabouts.h rename to hoot-core/src/main/cpp/hoot/core/ops/RemoveRoundabouts.h diff --git a/hoot-core/src/main/cpp/hoot/core/ops/RemoveWayOp.cpp b/hoot-core/src/main/cpp/hoot/core/ops/RemoveWayOp.cpp index 60645bb661..7ed737aa1f 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/RemoveWayOp.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/RemoveWayOp.cpp @@ -29,7 +29,7 @@ // hoot #include #include -#include +#include #include using namespace std; diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/ReplaceRoundabouts.cpp b/hoot-core/src/main/cpp/hoot/core/ops/ReplaceRoundabouts.cpp similarity index 96% rename from hoot-core/src/main/cpp/hoot/core/conflate/highway/ReplaceRoundabouts.cpp rename to hoot-core/src/main/cpp/hoot/core/ops/ReplaceRoundabouts.cpp index cb765299e8..9492580467 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/highway/ReplaceRoundabouts.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/ReplaceRoundabouts.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "ReplaceRoundabouts.h" diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/highway/ReplaceRoundabouts.h b/hoot-core/src/main/cpp/hoot/core/ops/ReplaceRoundabouts.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/highway/ReplaceRoundabouts.h rename to hoot-core/src/main/cpp/hoot/core/ops/ReplaceRoundabouts.h diff --git a/hoot-core/src/main/cpp/hoot/core/ops/SearchRadiusCalculator.cpp b/hoot-core/src/main/cpp/hoot/core/ops/SearchRadiusCalculator.cpp index 1543991a6e..c6e81528b5 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/SearchRadiusCalculator.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/SearchRadiusCalculator.cpp @@ -29,7 +29,7 @@ // Hoot #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/SmallWayMerger.cpp b/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp similarity index 99% rename from hoot-core/src/main/cpp/hoot/core/conflate/merging/SmallWayMerger.cpp rename to hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp index 08c39f04ea..42af43f94c 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/merging/SmallWayMerger.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/merging/SmallWayMerger.h b/hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.h similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/merging/SmallWayMerger.h rename to hoot-core/src/main/cpp/hoot/core/ops/SmallWayMerger.h diff --git a/hoot-core/src/main/cpp/hoot/core/ops/UnlikelyIntersectionRemover.cpp b/hoot-core/src/main/cpp/hoot/core/ops/UnlikelyIntersectionRemover.cpp index c0849939d9..1bb9a4926a 100644 --- a/hoot-core/src/main/cpp/hoot/core/ops/UnlikelyIntersectionRemover.cpp +++ b/hoot-core/src/main/cpp/hoot/core/ops/UnlikelyIntersectionRemover.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include // Standard #include diff --git a/hoot-core/src/main/cpp/hoot/core/scoring/RandomForestModelBuilder.cpp b/hoot-core/src/main/cpp/hoot/core/scoring/RandomForestModelBuilder.cpp index 5c2689d682..9645985f56 100644 --- a/hoot-core/src/main/cpp/hoot/core/scoring/RandomForestModelBuilder.cpp +++ b/hoot-core/src/main/cpp/hoot/core/scoring/RandomForestModelBuilder.cpp @@ -28,7 +28,7 @@ #include "RandomForestModelBuilder.h" // Hoot -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/FindHighwayIntersectionsVisitor.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/FindHighwayIntersectionsVisitor.cpp index ede25c6eff..b02274f132 100644 --- a/hoot-core/src/main/cpp/hoot/core/visitors/FindHighwayIntersectionsVisitor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/visitors/FindHighwayIntersectionsVisitor.cpp @@ -22,13 +22,13 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "FindHighwayIntersectionsVisitor.h" #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitPoiPolygonTypeTagger.h b/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitPoiPolygonTypeTagger.h index 59fd40f896..a921958dec 100644 --- a/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitPoiPolygonTypeTagger.h +++ b/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitPoiPolygonTypeTagger.h @@ -22,14 +22,14 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #ifndef IMPLICIT_POI_POLYGON_TYPE_TAGGER_H #define IMPLICIT_POI_POLYGON_TYPE_TAGGER_H // hoot #include -#include +#include namespace hoot { diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp index 64055de529..a7c73b1e65 100644 --- a/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp +++ b/hoot-core/src/main/cpp/hoot/core/visitors/ImplicitTypeTaggerBase.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include // Qt diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/IndexElementsVisitor.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/IndexElementsVisitor.cpp index cf22b984be..d31d49518c 100644 --- a/hoot-core/src/main/cpp/hoot/core/visitors/IndexElementsVisitor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/visitors/IndexElementsVisitor.cpp @@ -22,14 +22,14 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2016, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2016, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "IndexElementsVisitor.h" // Hoot #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/RemoveElementsVisitor.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/RemoveElementsVisitor.cpp index 1e2f59b229..aa4202af6b 100644 --- a/hoot-core/src/main/cpp/hoot/core/visitors/RemoveElementsVisitor.cpp +++ b/hoot-core/src/main/cpp/hoot/core/visitors/RemoveElementsVisitor.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.cpp similarity index 85% rename from hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.cpp rename to hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.cpp index a047fe21de..60cd78c141 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/cleaning/WayCleaner.cpp +++ b/hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "WayCleaner.h" @@ -36,7 +36,73 @@ namespace hoot unsigned int WayCleaner::logWarnCount = 0; -bool WayCleaner::hasDuplicateCoords(ConstWayPtr way, const OsmMap& map, const bool logDetails) +WayCleaner::WayCleaner() +{ +} + +void WayCleaner::visit(const boost::shared_ptr& e) +{ + WayPtr way = boost::dynamic_pointer_cast(e); + const vector nodeIds = way->getNodeIds(); + + if (_isZeroLengthWay(way, *_map)) + { + throw HootException("Cannot clean zero length way."); + } + + QList modifiedNodeIds = QVector::fromStdVector(nodeIds).toList(); + QList nodeIdsTemp; + QList coords; + for (size_t i = 0; i < nodeIds.size(); i++) + { + bool found = false; + if (nodeIdsTemp.contains(nodeIds[i])) + { + //the only duplicated nodes allowed are the first and last for a closed way + if (i == (nodeIds.size() - 1) && nodeIds[0] == nodeIds[i]) + { + } + else + { + found = true; + } + } + else + { + nodeIdsTemp.append(nodeIds[i]); + } + + const Coordinate coord = _map->getNode(nodeIds[i])->toCoordinate(); + if (coords.contains(coord)) + { + //the only duplicated coords allowed are the first and last for a closed way, if the node ID's + //match + if (i == (nodeIds.size() - 1) && nodeIds[0] == nodeIds[i]) + { + } + else + { + found = true; + } + } + else + { + coords.append(coord); + } + + if (found) + { + modifiedNodeIds.removeAt(i); + } + } + + way->setNodes(modifiedNodeIds.toVector().toStdVector()); + + _numAffected++; +} + +bool WayCleaner::_hasDuplicateCoords(ConstWayPtr way, const OsmMap& map, + const bool logDetails) { const vector nodeIds = way->getNodeIds(); @@ -110,7 +176,7 @@ bool WayCleaner::hasDuplicateCoords(ConstWayPtr way, const OsmMap& map, const bo return found; } -bool WayCleaner::hasDuplicateNodes(ConstWayPtr way, const bool logDetails) +bool WayCleaner::_hasDuplicateNodes(ConstWayPtr way, const bool logDetails) { const vector nodeIds = way->getNodeIds(); @@ -179,83 +245,33 @@ bool WayCleaner::hasDuplicateNodes(ConstWayPtr way, const bool logDetails) return found; } -bool WayCleaner::isZeroLengthWay(ConstWayPtr way, const ConstOsmMapPtr& map) +bool WayCleaner::_isZeroLengthWay(ConstWayPtr way, const OsmMap& map) { - return way->getNodeCount() == 2 && (hasDuplicateNodes(way) || hasDuplicateCoords(way, *map)); + return way->getNodeCount() == 2 && (_hasDuplicateNodes(way) || _hasDuplicateCoords(way, map)); } -void WayCleaner::cleanWay(WayPtr way, const ConstOsmMapPtr& map) +void WayCleaner::cleanWay(WayPtr way, const OsmMapPtr& map) { - const vector nodeIds = way->getNodeIds(); - - if (isZeroLengthWay(way, map)) - { - throw HootException("Cannot clean zero length way."); - } - - QList modifiedNodeIds = QVector::fromStdVector(nodeIds).toList(); - QList nodeIdsTemp; - QList coords; - for (size_t i = 0; i < nodeIds.size(); i++) - { - bool found = false; - if (nodeIdsTemp.contains(nodeIds[i])) - { - //the only duplicated nodes allowed are the first and last for a closed way - if (i == (nodeIds.size() - 1) && nodeIds[0] == nodeIds[i]) - { - } - else - { - found = true; - } - } - else - { - nodeIdsTemp.append(nodeIds[i]); - } - - const Coordinate coord = map->getNode(nodeIds[i])->toCoordinate(); - if (coords.contains(coord)) - { - //the only duplicated coords allowed are the first and last for a closed way, if the node ID's - //match - if (i == (nodeIds.size() - 1) && nodeIds[0] == nodeIds[i]) - { - } - else - { - found = true; - } - } - else - { - coords.append(coord); - } - - if (found) - { - modifiedNodeIds.removeAt(i); - } - } - - way->setNodes(modifiedNodeIds.toVector().toStdVector()); + WayCleaner wayCleaner; + wayCleaner.setOsmMap(map.get()); + wayCleaner.visit(way); } -ConstWayPtr WayCleaner::cleanWay(ConstWayPtr way, const ConstOsmMapPtr& map) +ConstWayPtr WayCleaner::cleanWay(ConstWayPtr way, const OsmMapPtr& map) { WayPtr cleanedWay(new Way(*way.get())); WayCleaner::cleanWay(cleanedWay, map); return cleanedWay; } -vector WayCleaner::cleanWays(const vector& ways, const ConstOsmMapPtr& map) +vector WayCleaner::cleanWays(const vector& ways, + const OsmMapPtr& map) { vector cleanedWays; for (vector::const_iterator it = ways.begin(); it != ways.end(); ++it) { ConstWayPtr way = *it; - if (!isZeroLengthWay(way, map)) + if (!_isZeroLengthWay(way, *map.get())) { cleanedWays.push_back(cleanWay(way, map)); } diff --git a/hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.h b/hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.h new file mode 100644 index 0000000000..4db60fcc5c --- /dev/null +++ b/hoot-core/src/main/cpp/hoot/core/visitors/WayCleaner.h @@ -0,0 +1,135 @@ +/* + * This file is part of Hootenanny. + * + * Hootenanny is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * -------------------------------------------------------------------- + * + * The following copyright notices are generated automatically. If you + * have a new notice to add, please use the format: + * " * @copyright Copyright ..." + * 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/) + */ +#ifndef WAYCLEANER_H +#define WAYCLEANER_H + +#include +#include +#include + +namespace hoot +{ + +/** + * Cleans ways + * + * @todo should probably check to see if this class is redundant with other cleaning, as it + * doesn't appear to be used anywhere + */ +class WayCleaner : public ElementOsmMapVisitor, public OperationStatusInfo +{ +public: + + static std::string className() { return "hoot::WayCleaner"; } + + static unsigned int logWarnCount; + + WayCleaner(); + + virtual void visit(const boost::shared_ptr& e); + + virtual QString getDescription() const { return "Cleans ways"; } + + virtual QString getInitStatusMessage() const + { return "Cleaning ways..."; } + + virtual QString getCompletedStatusMessage() const + { return "Cleaned " + QString::number(_numAffected) + " ways"; } + + /** + * Removes duplicate nodes and coordinates from a way + * + * @param way the way to be cleaned + * @param map the map owning the way to be cleaned + */ + static void cleanWay(WayPtr way, const OsmMapPtr& map); + + /** + * Cleans an unmodifiable way by removing duplicate nodes and coordinate from a copy of it + * and returning the copy. + * + * @param way the way to be cleaned; will be copied + * @pdddaram map the map owning the way to be cleaned + * @return an unmodifiable cleaned way + * @see cleanWay + */ + static ConstWayPtr cleanWay(ConstWayPtr way, const OsmMapPtr& map); + + /** + * Cleans unmodifiable ways by removing duplicate nodes and coordinate from copies of them and + * returning the copies + * + * Zero length ways are removed. It copies the input way and returns unmodifiable way to allow + * the method to be used inside conflation methods expecting const ways. + * + * @param ways the ways to be cleaned; will be copied + * @param map the map owning the ways to be cleaned + * @return a collection of unmodifiable cleaned ways + */ + static std::vector cleanWays(const std::vector& ways, + const OsmMapPtr& map); + +private: + + friend class WayCleanerTest; + + /** + * Determines whether a way has more than one node with the same coordinate (nodes with + * different ID's and having the same exact coordinate). + * + * @param way the way to be examined for duplicate coordinates + * @param map the map owning the way being examined + * @param logDetails if true, details about the duplicate coordinates are logged + * @return true if the way has coordinates; false otherwise + */ + static bool _hasDuplicateCoords(ConstWayPtr way, const OsmMap& map, const bool logDetails = false); + + /** + * Determines whether a way has more than one node with the same coordinate (nodes with + * different ID's and having the same exact coordinate). + * + * @param way the way to be examined for duplicate nodes + * @param logDetails if true, details about the duplicate nodes are logged + * @return true if the way has duplicate nodes; false otherwise + */ + static bool _hasDuplicateNodes(ConstWayPtr way, const bool logDetails = false); + + /** + * Determines whether a way is of zero length + * + * Only returns true for ways of size two. + * + * @param way way to be examined + * @param map the map owning the way to be examined + * @return true if the way is of zero length; false otherwise + */ + static bool _isZeroLengthWay(ConstWayPtr way, const OsmMap& map); +}; + +} + +#endif // WAYCLEANER_H diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitor.cpp b/hoot-core/src/main/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitor.cpp similarity index 100% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitor.cpp rename to hoot-core/src/main/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitor.cpp diff --git a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitor.h b/hoot-core/src/main/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitor.h similarity index 96% rename from hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitor.h rename to hoot-core/src/main/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitor.h index 7b72e3418b..ae13257eb6 100644 --- a/hoot-core/src/main/cpp/hoot/core/conflate/poi-polygon/visitors/PoiPolygonMatchVisitor.h +++ b/hoot-core/src/main/cpp/hoot/core/visitors/poi-polygon/PoiPolygonMatchVisitor.h @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include // tgs #include diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.cpp b/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.cpp index aa922d0130..9d1d8e2b62 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.cpp +++ b/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.cpp @@ -36,6 +36,7 @@ #include #include #include +#include // Qt #include @@ -50,8 +51,15 @@ using namespace v8; namespace hoot { +HOOT_FACTORY_REGISTER(Match, ScriptMatch) + unsigned int ScriptMatch::logWarnCount = 0; +ScriptMatch::ScriptMatch() : +Match() +{ +} + ScriptMatch::ScriptMatch(boost::shared_ptr script, const Persistent& plugin, const ConstOsmMapPtr& map, Handle mapObj, const ElementId& eid1, const ElementId& eid2, ConstMatchThresholdPtr mt) : diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.h b/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.h index 57aedac4a2..ff8948cbba 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.h +++ b/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatch.h @@ -51,6 +51,7 @@ class ScriptMatch : public Match, public MatchDetails static unsigned int logWarnCount; + ScriptMatch(); /** * @param mapObj This could be derived from the map, but destructing an OsmMapJs object is quite * expensive due to the amount of memory cleanup we must do in the general case. @@ -67,9 +68,6 @@ class ScriptMatch : public Match, public MatchDetails virtual double getProbability() const; - /** - * - */ virtual bool isConflicting(const Match& other, const ConstOsmMapPtr& map) const; virtual bool isWholeGroup() const { return _isWholeGroup; } @@ -80,7 +78,6 @@ class ScriptMatch : public Match, public MatchDetails virtual std::set< std::pair > getMatchPairs() const; v8::Local getPlugin() const { return ToLocal(&_plugin); } -// v8::Persistent getPlugin() const { return _plugin; } boost::shared_ptr getScript() const { return _script; } @@ -88,6 +85,8 @@ class ScriptMatch : public Match, public MatchDetails virtual std::map getFeatures(const ConstOsmMapPtr& map) const; + virtual QString getDescription() const { return "Matches elements with Generic Conflation"; } + private: ElementId _eid1, _eid2; diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatchCreator.cpp b/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatchCreator.cpp index 798a69c395..27de9484fc 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatchCreator.cpp +++ b/hoot-js/src/main/cpp/hoot/js/conflate/matching/ScriptMatchCreator.cpp @@ -560,9 +560,6 @@ void ScriptMatchCreator::createMatches(const ConstOsmMapPtr& map, vectorvisitRo(v); -// LOG_INFO( -// "Found " << v.getNumMatchCandidatesFound() << " " << -// scriptFileInfo.fileName().replace(".js", "") << " match candidates."); LOG_INFO( "Found " << v.getNumMatchCandidatesFound() << " " << CreatorDescription::baseFeatureTypeToString( diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ElementMergerJs.cpp b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ElementMergerJs.cpp index 4b55475972..25c38c55e7 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ElementMergerJs.cpp +++ b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ElementMergerJs.cpp @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.cpp b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.cpp index 050ffb8c80..8c376a5fbe 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.cpp +++ b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.cpp @@ -35,6 +35,7 @@ #include #include #include +#include // node.js #include @@ -46,8 +47,15 @@ using namespace v8; namespace hoot { +HOOT_FACTORY_REGISTER(Merger, ScriptMerger) + unsigned int ScriptMerger::logWarnCount = 0; +ScriptMerger::ScriptMerger() : +MergerBase() +{ +} + ScriptMerger::ScriptMerger(boost::shared_ptr script, Persistent& plugin, const set>& pairs) : _pairs(pairs), diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.h b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.h index a78d24d549..9981c1192e 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.h +++ b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMerger.h @@ -45,6 +45,7 @@ class ScriptMerger : public MergerBase static unsigned int logWarnCount; + ScriptMerger(); ScriptMerger(boost::shared_ptr script, v8::Persistent& plugin, const std::set>& pairs); @@ -57,6 +58,9 @@ class ScriptMerger : public MergerBase virtual QString toString() const override { return QString("ScriptMerger"); } + virtual QString getDescription() const + { return "Merges elements matched with Generic Conflation"; } + protected: PairsSet _pairs; diff --git a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMergerCreator.cpp b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMergerCreator.cpp index f3c98f1bf0..44a3ff58bb 100644 --- a/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMergerCreator.cpp +++ b/hoot-js/src/main/cpp/hoot/js/conflate/merging/ScriptMergerCreator.cpp @@ -130,7 +130,7 @@ vector ScriptMergerCreator::getAllCreators() const { CreatorDescription d; d.className = className(); - d.description = "Script merge creator required by all script match creators"; + d.description = "Generates mergers used in Generic Conflation"; d.experimental = false; vector result; result.push_back(d); diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.cpp b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.cpp index 6ec1c152c2..12f97fa7af 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.cpp +++ b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "MultiaryPoiMerger.h" @@ -39,8 +39,15 @@ namespace hoot { +HOOT_FACTORY_REGISTER(Merger, MultiaryPoiMerger) + +MultiaryPoiMerger::MultiaryPoiMerger() : +MergerBase() +{ +} + MultiaryPoiMerger::MultiaryPoiMerger(std::set< std::pair >& pairs) : - _pairs(pairs) +_pairs(pairs) { } diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.h b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.h index b95e495947..9fb872edd4 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.h +++ b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMerger.h @@ -36,7 +36,7 @@ namespace hoot { /** - * Merger operation for idenifying clusters of elements within the provided pairs and only merging + * Merger operation for identifying clusters of elements within the provided pairs and only merging * the clustered elements. This is most useful when conflating large numbers of input sources or * intradataset conflation where there could be n-elements that represent the same object. */ @@ -44,6 +44,9 @@ class MultiaryPoiMerger : public MergerBase { public: + static std::string className() { return "hoot::MultiaryPoiMerger"; } + + MultiaryPoiMerger(); /** * Construct with a subgraph of pairs. The links in the set of pairs are used to determine links * between elements so it is important that the pairs are represenetative of the matches. @@ -58,6 +61,9 @@ class MultiaryPoiMerger : public MergerBase virtual QString toString() const { return "MultiaryPoiMerger"; } + virtual QString getDescription() const + { return "Merges POIs matched with Multiary Conflation (experimental)"; } + protected: virtual PairsSet& _getPairs() { return _pairs; } diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.cpp b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.cpp index 6daa3b8f18..ffafca4abd 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.cpp +++ b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.cpp @@ -22,7 +22,7 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "MultiaryPoiMergerCreator.h" @@ -70,7 +70,8 @@ std::vector MultiaryPoiMergerCreator::getAllCreators() const { CreatorDescription d; d.className = className(); - d.description = "identifies clusters within a match set and merges each cluster."; + d.description = + "Generates mergers that identify Multiary POI clusters within a match set and merges each cluster."; d.experimental = true; vector result; result.push_back(d); diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.h b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.h index a4acb9eb36..01e3ecd73d 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.h +++ b/hoot-rnd/src/main/cpp/hoot/rnd/conflate/multiary/MultiaryPoiMergerCreator.h @@ -50,6 +50,7 @@ namespace hoot * between elements. These reviews are a relevant aspect of the clustering. * * @sa MultiaryPoiMerger + * @todo Should this inherit from MergerBase instead? */ class MultiaryPoiMergerCreator : public MergerCreator { diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/perty/PertyMatchScorer.cpp b/hoot-rnd/src/main/cpp/hoot/rnd/perty/PertyMatchScorer.cpp index 0fa4ffca7c..8f3b667aa0 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/perty/PertyMatchScorer.cpp +++ b/hoot-rnd/src/main/cpp/hoot/rnd/perty/PertyMatchScorer.cpp @@ -28,7 +28,7 @@ // hoot #include -#include +#include #include #include #include diff --git a/hoot-rnd/src/main/cpp/hoot/rnd/scoring/MatchScoringMapPreparer.cpp b/hoot-rnd/src/main/cpp/hoot/rnd/scoring/MatchScoringMapPreparer.cpp index 96dfddf54c..dccb168c2d 100644 --- a/hoot-rnd/src/main/cpp/hoot/rnd/scoring/MatchScoringMapPreparer.cpp +++ b/hoot-rnd/src/main/cpp/hoot/rnd/scoring/MatchScoringMapPreparer.cpp @@ -22,12 +22,12 @@ * This will properly maintain the copyright information. DigitalGlobe * copyrights will be updated automatically. * - * @copyright Copyright (C) 2015, 2017, 2018 DigitalGlobe (http://www.digitalglobe.com/) + * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/) */ #include "MatchScoringMapPreparer.h" // hoot -#include +#include #include #include #include diff --git a/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/IterativeNetworkMatcherTest.cpp b/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/IterativeNetworkMatcherTest.cpp index beb3b79549..4e468493a9 100644 --- a/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/IterativeNetworkMatcherTest.cpp +++ b/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/IterativeNetworkMatcherTest.cpp @@ -27,7 +27,7 @@ // Hoot #include -#include +#include #include #include #include diff --git a/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/SingleSidedNetworkMatcherTest.cpp b/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/SingleSidedNetworkMatcherTest.cpp index f47a1c4681..6f1b83595c 100644 --- a/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/SingleSidedNetworkMatcherTest.cpp +++ b/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/SingleSidedNetworkMatcherTest.cpp @@ -27,7 +27,7 @@ // Hoot #include -#include +#include #include #include #include diff --git a/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/VagabondNetworkMatcherTest.cpp b/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/VagabondNetworkMatcherTest.cpp index 68c6392fd8..cbf598d339 100644 --- a/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/VagabondNetworkMatcherTest.cpp +++ b/hoot-rnd/src/test/cpp/hoot/rnd/conflate/network/VagabondNetworkMatcherTest.cpp @@ -28,7 +28,7 @@ // Hoot #include #include -#include +#include #include #include #include diff --git a/test-files/cmd/slow/InfoCmdTest.sh b/test-files/cmd/slow/InfoCmdTest.sh index 1aaf7d8bac..d513a99158 100755 --- a/test-files/cmd/slow/InfoCmdTest.sh +++ b/test-files/cmd/slow/InfoCmdTest.sh @@ -64,24 +64,44 @@ echo "" hoot info -D language.info.provider=hoot::HootServicesLanguageInfoMockClient --languages --translators echo "" -# MATCHERS +# MATCH CREATORS echo "Listing a match creator..." echo "" -hoot info --matchers | grep "HighwayMatchCreator" +hoot info --match-creators | grep "HighwayMatchCreator" echo "" echo "Listing a script match creator..." echo "" -hoot info --matchers | grep "ScriptMatchCreator,PoiGeneric.js" +hoot info --match-creators | grep "ScriptMatchCreator,PoiGeneric.js" +echo "" + +# MERGER CREATORS +echo "Listing a merger creator..." +echo "" +hoot info --merger-creators | grep "PoiPolygonMergerCreator" +echo "" +echo "Listing a script merger creator..." +echo "" +hoot info --merger-creators | grep "ScriptMergerCreator" +echo "" + +# MATCHERS +echo "Listing a matcher..." +echo "" +hoot info --matchers | grep "HighwayMatch" +echo "" +echo "Listing a script matcher..." +echo "" +hoot info --matchers | grep "ScriptMatch" echo "" # MERGERS echo "Listing a merger..." echo "" -hoot info --mergers | grep "PoiPolygonMergerCreator" +hoot info --mergers | grep "PoiPolygonMerger" echo "" echo "Listing a script merger..." echo "" -hoot info --mergers | grep "ScriptMergerCreator" +hoot info --mergers | grep "ScriptMerger" echo "" # OPERATORS diff --git a/test-files/cmd/slow/InfoCmdTest.sh.stdout b/test-files/cmd/slow/InfoCmdTest.sh.stdout index e8879f1fa2..c1c697bdc4 100644 --- a/test-files/cmd/slow/InfoCmdTest.sh.stdout +++ b/test-files/cmd/slow/InfoCmdTest.sh.stdout @@ -3673,19 +3673,35 @@ URL: N/A Listing a match creator... - HighwayMatchCreator Matches roads with the 2nd generation algorithm + HighwayMatchCreator Generates matchers that match roads with the 2nd Generation (Unifying) Algorithm Listing a script match creator... ScriptMatchCreator,PoiGeneric.js Matches POIs +Listing a merger creator... + + PoiPolygonMergerCreator Generates mergers that merge POIs into polygons + +Listing a script merger creator... + + ScriptMergerCreator Generates mergers used in Generic Conflation + +Listing a matcher... + + HighwayMatch Matches roads with the 2nd Generation (Unifying) Algorithm + +Listing a script matcher... + + ScriptMatch Matches elements with Generic Conflation + Listing a merger... - PoiPolygonMergerCreator Merges POIs into polygons + PoiPolygonMerger Merges POIs into polygons Listing a script merger... - ScriptMergerCreator Script merge creator required by all script match creators + ScriptMerger Merges elements matched with Generic Conflation Listing an op... diff --git a/test-files/conflate/SmallWayMergerInput1.osm b/test-files/ops/SmallWayMerger/SmallWayMergerInput1.osm similarity index 100% rename from test-files/conflate/SmallWayMergerInput1.osm rename to test-files/ops/SmallWayMerger/SmallWayMergerInput1.osm diff --git a/test-files/conflate/SmallWayMergerInput2.osm b/test-files/ops/SmallWayMerger/SmallWayMergerInput2.osm similarity index 100% rename from test-files/conflate/SmallWayMergerInput2.osm rename to test-files/ops/SmallWayMerger/SmallWayMergerInput2.osm diff --git a/test-files/ops/SmallWayMerger/SmallWayMergerOutput1.osm b/test-files/ops/SmallWayMerger/SmallWayMergerOutput1.osm new file mode 100644 index 0000000000..f952ff9cc0 --- /dev/null +++ b/test-files/ops/SmallWayMerger/SmallWayMergerOutput1.osm @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-files/conflate/WayCleanerTest/DuplicateCoordsTest.osm b/test-files/visitors/WayCleanerTest/DuplicateCoordsTest.osm similarity index 100% rename from test-files/conflate/WayCleanerTest/DuplicateCoordsTest.osm rename to test-files/visitors/WayCleanerTest/DuplicateCoordsTest.osm diff --git a/test-files/conflate/WayCleanerTest/DuplicateNodesTest.osm b/test-files/visitors/WayCleanerTest/DuplicateNodesTest.osm similarity index 100% rename from test-files/conflate/WayCleanerTest/DuplicateNodesTest.osm rename to test-files/visitors/WayCleanerTest/DuplicateNodesTest.osm