Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute conflation changes building geometry #5395

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion conf/core/AttributeConflation.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"#": "Only add entries here that have different default values than the options in ConfigOptions.asciidoc",
"building.default.merger": "AttributeBuildingMerger",
"building.force.contained.match": "true",
"building.keep.more.complex.geometry.when.auto.merging": "false",
"building.merge.many.to.many.matches": "true",
"conflate.mark.merge.created.multilinestring.relations": "true",
"conflate.post.ops": "$(conflate.post.ops);IdSwapOp;RemoveElementsVisitor;RemoveUnknown2Visitor",
"conflate.post.ops": "$(conflate.post.ops);IdSwapOp;RemoveElementsVisitor;RemoveUnknown2Visitor;UpdateMeasurementTagsVisitor",
"duplicate.name.preserve.original.name": "true",
"geometry.linear.merger.default": "LinearTagOnlyMerger",
"hootapi.db.writer.preserve.version.on.insert": "true",
Expand Down
8 changes: 8 additions & 0 deletions conf/core/ConfigOptions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,14 @@ details.

Tag key used by the `building.review.if.secondary.newer` configuration option.

=== building.default.merger

* Data Type: string
* Default Value: `BuildingMerger`

The default merger for buildings is `BuildingMerger` but should be different when running Attribute conflation
which does not do any merging of buildings, just merging of tags

=== building.force.contained.match

* Data Type: bool
Expand Down
7 changes: 1 addition & 6 deletions hoot-core-test/src/test/cpp/hoot/core/TestUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ std::shared_ptr<TestUtils> TestUtils::_theInstance;

const QString HootTestFixture::UNUSED_PATH = "";

TestUtils::TestUtils()
{
}

bool TestUtils::compareMaps(const QString& refPath, const QString& testPath)
{
OsmXmlReader reader;
Expand Down Expand Up @@ -419,8 +415,7 @@ void TestUtils::runConflateOpReductionTest(const QStringList& matchCreators, con
// incorrectly, and we can update this list periodically if that's deemed important.
conf().set(ConfigOptions::getConflatePreOpsKey(), TestUtils::getConflateCmdSnapshotPreOps());
conf().set(ConfigOptions::getConflatePostOpsKey(), TestUtils::getConflateCmdSnapshotPostOps());
conf().set(
ConfigOptions::getMapCleanerTransformsKey(), TestUtils::getConflateCmdSnapshotCleaningOps());
conf().set(ConfigOptions::getMapCleanerTransformsKey(), TestUtils::getConflateCmdSnapshotCleaningOps());

SuperfluousConflateOpRemover::removeSuperfluousOps();

Expand Down
5 changes: 2 additions & 3 deletions hoot-core-test/src/test/cpp/hoot/core/TestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ class TestUtils
* Converts a string into a format that can be cut/paste into c++ code.
*/
static QString toQuotedString(QString str);
static void verifyStdMatchesOutputIgnoreDate(
const QString& stdFilePath, const QString& outFilePath);
static void verifyStdMatchesOutputIgnoreDate(const QString& stdFilePath, const QString& outFilePath);

/**
* Making the map optional here, as you don't always need a test node to belong to one.
Expand Down Expand Up @@ -210,7 +209,7 @@ class TestUtils

private:

TestUtils();
TestUtils() = default;

QList<RegisteredReset*> _resets;
static std::shared_ptr<TestUtils> _theInstance;
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. Maxar
* copyrights will be updated automatically.
*
* @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 Maxar (http://www.maxar.com/)
* @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Maxar (http://www.maxar.com/)
*/

// Hoot
Expand All @@ -49,10 +49,9 @@ class PoiPolygonTypeScoreExtractorTest : public HootTestFixture

public:

PoiPolygonTypeScoreExtractorTest() :
HootTestFixture(
"test-files/conflate/poi-polygon/PoiPolygonTypeScoreExtractorTest/",
"test-output/conflate/poi-polygon/PoiPolygonTypeScoreExtractorTest/")
PoiPolygonTypeScoreExtractorTest()
: HootTestFixture("test-files/conflate/poi-polygon/PoiPolygonTypeScoreExtractorTest/",
"test-output/conflate/poi-polygon/PoiPolygonTypeScoreExtractorTest/")
{
}

Expand Down Expand Up @@ -84,7 +83,7 @@ class PoiPolygonTypeScoreExtractorTest : public HootTestFixture
NodePtr node3 = std::make_shared<Node>(Status::Unknown1, -1, Coordinate(0.0, 0.0), 15.0);
node3->getTags().set("amenity", "drinking_water");
WayPtr way3 = std::make_shared<Way>(Status::Unknown2, -1, 15.0);
way3->getTags().set("building", "yes");
way3->getTags().set(MetadataTags::Building(), "yes");
uut.setFeatureDistance(5.1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, uut.extract(*map, node3, way3), 0.0);

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. Maxar
* copyrights will be updated automatically.
*
* @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021 Maxar (http://www.maxar.com/)
* @copyright Copyright (C) 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Maxar (http://www.maxar.com/)
*/

// Hoot
Expand Down Expand Up @@ -107,10 +107,10 @@ class PoiPolygonMatchCreatorTest : public HootTestFixture
Coordinate(0.0, 0.0),
Coordinate::getNull() };
WayPtr w1 = TestUtils::createWay(map, c1, "w1", Status::Unknown1, 5);
w1->getTags().set("building", true);
w1->getTags().set(MetadataTags::Building(), true);
w1->getTags().set("name", "foo");
WayPtr w2 = TestUtils::createWay(map, c1, "w2", Status::Unknown1, 5);
w2->getTags().set("area", true);
w2->getTags().set(MetadataTags::Area(), true);

NodePtr n1 = std::make_shared<Node>(Status::Unknown1, 1, 10, 10, 5);
n1->getTags().set("poi", true);
Expand Down
Loading