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

[test] Add test case for geographic intersection for polygons touching North Pole #1320

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

vissarion
Copy link
Member

Adding test case from issue #480

boost::geometry::intersection(bigTileOn90,usa,out1);
boost::geometry::intersection(bigTile,usa,out2);
BOOST_CHECK(out1.size() == 1);
BOOST_CHECK(boost::geometry::area(out1) == boost::geometry::area(out2));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we use a floating-point check with epsilon?

Copy link
Member Author

@vissarion vissarion Oct 3, 2024

Choose a reason for hiding this comment

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

That should be OK without epsilon because the two computed polygons are exactly the same and thus their areas.


BOOST_AUTO_TEST_CASE(usaIntersectBigTile90) {
auto bigTileWKt = "POLYGON((-182.25 -2.25,-182.25 85,-90 85,4.5 85,4.5 -2.25,-90 -2.25,-182.25 -2.25))";
auto bigTileWKtOn90 = "POLYGON((-182.25 -2.25,-182.25 90,-90 90,4.5 90,4.5 -2.25,-90 -2.25,-182.25 -2.25))";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we never use this camelCase convention...
Also (minor), can be const

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks you are right, I was just copy-pasting here from the original issue. Fixed now.

Copy link
Collaborator

@barendgehrels barendgehrels left a comment

Choose a reason for hiding this comment

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

Minor comments but looks good to me

@vissarion vissarion merged commit 1ca9ac0 into boostorg:develop Oct 3, 2024
23 checks passed
@vissarion vissarion deleted the add_test_cases branch October 3, 2024 09:14
@vissarion vissarion changed the title [test] Add test case for goegrphic intersection for polygons touching North Pole [test] Add test case for geographic intersection for polygons touching North Pole Nov 27, 2024
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.

2 participants