You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionisMultiPointInPoly(multiPoint: MultiPoint,polygon: Polygon){varoutput=true;varoneInside=false;varisInside=false;for(vari=0;i<multiPoint.coordinates.length;i++){isInside=booleanPointInPolygon(multiPoint.coordinates[i],polygon);if(!isInside){output=false;break;}if(!oneInside){// this variables Should be oneInside ???isInside=booleanPointInPolygon(multiPoint.coordinates[i],polygon,{ignoreBoundary: true,});}}returnoutput&&isInside;}
this code variable oneInside Whether it is not used。
The text was updated successfully, but these errors were encountered:
Looking at this I agree that the code path seems slightly illogical in that !oneInside will always run as the variable is never reassigned. I'd need to probably look at the PR / gitblame / unit tests to understand the intent.
Took a look at the git blame for this. The variable has been in there since day 1, and (though not conclusive) even Typescript reckons oneInside can only be false, meaning the code will always run:
I will remove the if() altogether and commit as a code prettification task in another PR.
turf/packages/turf-boolean-within
/index.ts
The following code:
this code variable oneInside Whether it is not used。
The text was updated successfully, but these errors were encountered: