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

POI to Polygon conflation of cemeteries doesn't work #5536

Merged
merged 1 commit into from
Dec 16, 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
7 changes: 2 additions & 5 deletions conf/schema/amenity.json
Original file line number Diff line number Diff line change
Expand Up @@ -755,15 +755,12 @@
"objectType": "tag"
},
{
"categories": [
"multiuse"
],
"isA": "amenity",
"name": "amenity=grave_yard",
"objectType": "tag",
"similarTo": [
{ "name": "amenity=cemetery", "weight": 0.6 },
{ "name": "landuse=cemetery", "weight": 0.6 }
{ "name": "amenity=cemetery", "weight": 0.8 },
{ "name": "landuse=cemetery", "weight": 0.8 }
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions conf/schema/landuse.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"isA": "landuse",
"name": "landuse=cemetery",
"objectType": "tag",
"similarTo": {
"name": "cemetery",
"weight": 0.8
}
"similarTo": [
{ "name": "cemetery", "weight": 0.8 },
{ "name": "amenity=cemetery", "weight": 0.8 }
]
},
{
"#": "TODO: This doesn't seem to exist in public OSM.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ bool PoiPolygonReviewReducer::triggersRule(ConstNodePtr poi, ConstElementPtr pol
{
LOG_TRACE("Checking review reduction rules...");
_triggeredRuleDescription = "";
//QElapsedTimer timer;
//const int timingThreshold = 1000000; //nanosec

const Tags& poiTags = poi->getTags();
const Tags& polyTags = poly->getTags();
Expand Down Expand Up @@ -409,7 +407,7 @@ bool PoiPolygonReviewReducer::triggersRule(ConstNodePtr poi, ConstElementPtr pol
// Don't review park poi's against large non-park polys.
ruleDescription = "#22: park poi/poly 1";
LOG_TRACE("Checking rule : " << ruleDescription << "...");
if (poiHasType && polyHasType && !_nameMatch && !polyIsPark &&
if (poiHasType && polyHasType && !_nameMatch && poiIsParkish && !polyIsPark &&
(((polyHasLanduse && !poiHasLanduse) ||
(polyIsNatural && !poiIsNatural) ||
polyLeisureVal == QLatin1String("common")) ||
Expand Down Expand Up @@ -451,6 +449,7 @@ bool PoiPolygonReviewReducer::triggersRule(ConstNodePtr poi, ConstElementPtr pol
// relation member.
if (numPolyAddresses < 2 && _infoCache->containsMember(poly, poi->getElementId()))
{
// Do nothing
}
else if (_addressScore < 0.8)
{
Expand Down Expand Up @@ -516,8 +515,7 @@ bool PoiPolygonReviewReducer::triggersRule(ConstNodePtr poi, ConstElementPtr pol
//timer.restart();
if (poiIsSport && _infoCache->isType(polyNeighbor, PoiPolygonSchemaType::Sport) &&
_infoCache->elementContains(polyNeighbor, poi) &&
PoiPolygonTypeScoreExtractor(_infoCache).extract(*_map, poi, polyNeighbor) >=
_typeScoreThreshold)
PoiPolygonTypeScoreExtractor(_infoCache).extract(*_map, poi, polyNeighbor) >= _typeScoreThreshold)
{
sportPoiOnOtherSportPolyWithTypeMatch = true;
}
Expand Down
7 changes: 7 additions & 0 deletions hoot-core/src/main/cpp/hoot/core/io/OsmXmlWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ void OsmXmlWriter::_writeRelations(ConstOsmMapPtr map)

void OsmXmlWriter::_writeBounds(const Envelope& bounds) const
{
// Validate the bounds before writing the "bounds" XML element
if (bounds.getMinX() == geos::DoubleNegInfinity || bounds.getMaxX() == geos::DoubleInfinity ||
bounds.getMinY() == geos::DoubleNegInfinity || bounds.getMaxY() == geos::DoubleInfinity ||
bounds.isNull())
{
return;
}
_writer->writeStartElement("bounds");
_writer->writeAttribute("minlat", QString::number(bounds.getMinY(), 'g', _precision));
_writer->writeAttribute("minlon", QString::number(bounds.getMinX(), 'g', _precision));
Expand Down