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

turf.intersect returns polygon with null geometry instead of undefined #961

Closed
colllin opened this issue Sep 22, 2017 · 4 comments
Closed

Comments

@colllin
Copy link

colllin commented Sep 22, 2017

The docs say that turf.intersect will return undefined in the case where the geometries do not intersect. I'm currently seeing (v4.7.3) that it returns a polygon with geometry: null when the geometries do not intersect.

Update: To be clear, the bug I'm seeing is that it returns a Polygon object with geometry: null, and previously we were expecting it to return just undefined rather than any kind of Polygon object.

@colllin
Copy link
Author

colllin commented Sep 22, 2017

Looks like this may already be fixed? df481ca#diff-4db71116796d555a0638cd247cafeffe

@DenisCarriere
Copy link
Member

👍 Thanks for reporting this, yes this has been fixed in #952

The change from undefined to null is because undefined would define it as missing, null indicates that you did apply the intersect method but it returned an empty result, making the difference between both is useful.

I'll update a patch release for this instead of waiting for the next official release.

@DenisCarriere
Copy link
Member

Published a new patch release for @turf/intersect & @turf/difference at v4.7.4.

@colllin
Copy link
Author

colllin commented Sep 23, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants