Skip to content

Commit

Permalink
Assorted maintenance and minor features - 3/5/19 (#3034)
Browse files Browse the repository at this point in the history
* 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'
  • Loading branch information
bwitham authored Mar 6, 2019
1 parent 1216818 commit 6c7d9ce
Show file tree
Hide file tree
Showing 163 changed files with 885 additions and 426 deletions.
42 changes: 40 additions & 2 deletions docs/commands/info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down
30 changes: 18 additions & 12 deletions docs/user/CommandLineExamples.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
-----

Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/elements/OsmMap.h>
#include <hoot/core/TestUtils.h>
#include <hoot/core/elements/Way.h>
#include <hoot/core/conflate/poi-polygon/extractors/PoiPolygonAddressScoreExtractor.h>
#include <hoot/core/algorithms/extractors//poi-polygon/PoiPolygonAddressScoreExtractor.h>
#include <hoot/core/language/DictionaryTranslator.h>
#include <hoot/core/conflate/address/AddressTagKeys.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/elements/OsmMap.h>
#include <hoot/core/TestUtils.h>
#include <hoot/core/conflate/poi-polygon/extractors/PoiPolygonAlphaShapeDistanceExtractor.h>
#include <hoot/core/algorithms/extractors//poi-polygon/PoiPolygonAlphaShapeDistanceExtractor.h>
#include <hoot/core/io/OsmMapReaderFactory.h>

// CPP Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/elements/OsmMap.h>
#include <hoot/core/TestUtils.h>
#include <hoot/core/conflate/poi-polygon/extractors/PoiPolygonDistanceExtractor.h>
#include <hoot/core/algorithms/extractors/poi-polygon/PoiPolygonDistanceExtractor.h>
#include <hoot/core/elements/Way.h>
#include <hoot/core/io/OsmXmlReader.h>
#include <hoot/core/io/OsmXmlWriter.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <hoot/core/elements/OsmMap.h>
#include <hoot/core/TestUtils.h>
#include <hoot/core/elements/Way.h>
#include <hoot/core/conflate/poi-polygon/extractors/PoiPolygonNameScoreExtractor.h>
#include <hoot/core/algorithms/extractors/poi-polygon/PoiPolygonNameScoreExtractor.h>
#include <hoot/core/schema/OsmSchema.h>
#include <hoot/core/util/Log.h>
#include <hoot/core/language/DictionaryTranslator.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
* 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/)
*/


// Hoot
#include <hoot/core/elements/OsmMap.h>
#include <hoot/core/TestUtils.h>
#include <hoot/core/elements/Way.h>
#include <hoot/core/conflate/poi-polygon/extractors/PoiPolygonPhoneNumberScoreExtractor.h>
#include <hoot/core/algorithms/extractors/poi-polygon/PoiPolygonPhoneNumberScoreExtractor.h>
#include <hoot/core/util/Log.h>

// CPP Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/elements/OsmMap.h>
#include <hoot/core/TestUtils.h>
#include <hoot/core/conflate/poi-polygon/extractors/PoiPolygonTypeScoreExtractor.h>
#include <hoot/core/algorithms/extractors/poi-polygon/PoiPolygonTypeScoreExtractor.h>
#include <hoot/core/elements/Way.h>

// CPP Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/TestUtils.h>
#include <hoot/core/conflate/cleaning/MapCleaner.h>
#include <hoot/core/ops/MapCleaner.h>
#include <hoot/core/algorithms/rubber-sheet/RubberSheet.h>
#include <hoot/core/io/OsmXmlReader.h>
#include <hoot/core/io/OsmXmlWriter.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

// Hoot
#include <hoot/core/TestUtils.h>
#include <hoot/core/conflate/cleaning/MapCleaner.h>
#include <hoot/core/ops/MapCleaner.h>
#include <hoot/core/ops/SearchRadiusCalculator.h>
#include <hoot/core/io/OsmXmlReader.h>
#include <hoot/core/io/OsmXmlWriter.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -98,9 +98,9 @@ class ConstrainedFakeMatch : public Match
}
}

virtual set< pair<ElementId, ElementId> > getMatchPairs() const
virtual set<pair<ElementId, ElementId>> getMatchPairs() const
{
set< pair<ElementId, ElementId> > result;
set<pair<ElementId, ElementId>> result;
result.insert(pair<ElementId, ElementId>(_eid1, _eid2));
return result;
}
Expand All @@ -124,6 +124,8 @@ class ConstrainedFakeMatch : public Match

MatchType getType() const { return _threshold->getType(*this); }

virtual QString getDescription() const { return ""; }

private:

mutable MatchClassification _c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ namespace hoot
class FakeMatch : public Match
{
public:
FakeMatch() : Match(boost::shared_ptr<MatchThreshold>()) {}

FakeMatch() : Match(boost::shared_ptr<MatchThreshold>()) {}
FakeMatch(ElementId eid1, ElementId eid2, double p, const boost::shared_ptr<const MatchThreshold> mt) :
Match(mt),
_eid1(eid1),
Expand Down Expand Up @@ -120,6 +120,8 @@ class FakeMatch : public Match

MatchType getType() const { return _threshold->getType(*this); }

virtual QString getDescription() const { return ""; }

private:

mutable MatchClassification _c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,8 +57,8 @@ namespace hoot
class ConstrainedFakeMatch : public Match
{
public:
ConstrainedFakeMatch() : Match(boost::shared_ptr<MatchThreshold>()) {}

ConstrainedFakeMatch() : Match(boost::shared_ptr<MatchThreshold>()) {}
ConstrainedFakeMatch(ElementId eid1, ElementId eid2, double p,
ConstMatchThresholdPtr threshold) :
Match(threshold),
Expand Down Expand Up @@ -124,6 +124,8 @@ class ConstrainedFakeMatch : public Match

MatchType getType() const { return _threshold->getType(*this); }

virtual QString getDescription() const { return ""; }

private:

mutable MatchClassification _c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/TestUtils.h>
#include <hoot/core/conflate/poi-polygon/criterion/PoiPolygonPoiCriterion.h>
#include <hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.h>

using namespace geos::geom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/TestUtils.h>
#include <hoot/core/conflate/poi-polygon/criterion/PoiPolygonPolyCriterion.h>
#include <hoot/core/criterion/poi-polygon/PoiPolygonPolyCriterion.h>

using namespace geos::geom;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hoot/core/TestUtils.h>
#include <hoot/core/conflate/NodeReplacements.h>
#include <hoot/core/elements/NodeReplacements.h>
#include <hoot/core/util/HootException.h>
#include <hoot/core/util/Log.h>

Expand All @@ -51,7 +51,7 @@ class NodeReplacementsTest : public HootTestFixture

NodeReplacementsTest()
{
TestUtils::mkpath("test-output/conflate");
TestUtils::mkpath("test-output/elements");
}

void runIoTest()
Expand All @@ -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());
}
Expand Down
Loading

0 comments on commit 6c7d9ce

Please sign in to comment.