-
Notifications
You must be signed in to change notification settings - Fork 369
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
Fix overlay heuristic for GeometryCollections with empty elements #1229
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
void | ||
extractELements(const Geometry* g, std::vector<std::unique_ptr<Geometry>>& v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extractELements(const Geometry* g, std::vector<std::unique_ptr<Geometry>>& v) | |
extractElements(const Geometry* g, std::vector<std::unique_ptr<Geometry>>& v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
second letter of "elements"
const GeometryCollection* coll; | ||
if (nullptr != (coll = dynamic_cast<const GeometryCollection*>(g))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const GeometryCollection* coll; | |
if (nullptr != (coll = dynamic_cast<const GeometryCollection*>(g))) { | |
if (const auto* coll = dynamic_cast<const GeometryCollection*>(g))) { |
default: // only OverlayNG::INTERSECTION | ||
return s0.doIntersection(s1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default: // only OverlayNG::INTERSECTION | |
return s0.doIntersection(s1); | |
case OverlayNG::INTERSECTION: | |
return s0.doIntersection(s1); | |
default: | |
throw util::IllegalArgumentException("Invalid opcode"); |
@@ -178,6 +178,17 @@ tolower(std::string& str) | |||
); | |||
} | |||
|
|||
void | |||
toupper(std::string& str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already implemented in geos/util/string.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks
This fixes the behaviour of the "combine disjoint" overlay heuristic for GeometryCollections containing empty elements (which are now removed).
Fixes #1224
(Note: part of #1224 requires #1136 to be fixed as well).
The PR also:
HeuristicOverlay
(moving code fromGeometry
)HeuristicOverlay
codeHeuristicOverlay
XMLTester
to correctly handle operation A & B argument switching