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

Fix MinimumDiameter getMinimumRectangle for flat input #616

Merged
merged 2 commits into from
May 26, 2022

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented May 26, 2022

Fixes MinimumDiameter.getMinimumRectangle to avoid an infinite loop for flat input.

Fixes bug reported in PostGIS-5163.

@dr-jts dr-jts added the Bug label May 26, 2022
@dr-jts dr-jts self-assigned this May 26, 2022
@dr-jts dr-jts changed the title Fix MinimumDiameter rectangle for flat input Fix MinimumDiameter getMinimumRectangle for flat input May 26, 2022

std::size_t const n = pts->getSize();
for(std::size_t i = 1; i < n; ++i) {
Coordinate p = pts->getAt(i);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Coordinate p = pts->getAt(i);
const Coordinate& p = pts->getAt(i);

Copy link
Contributor Author

@dr-jts dr-jts May 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! So much to remember...

@dr-jts dr-jts merged commit 6180a48 into libgeos:main May 26, 2022
@dr-jts dr-jts deleted the fix-minrotrect-flat branch May 26, 2022 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants