File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/turf-boolean-within Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ function isLineInPoly(linestring: LineString, polygon: Polygon) {
173
173
}
174
174
var foundInsidePoint = false ;
175
175
176
- for ( var i = 0 ; i < linestring . coordinates . length - 1 ; i ++ ) {
176
+ for ( var i = 0 ; i < linestring . coordinates . length ; i ++ ) {
177
177
if ( ! booleanPointInPolygon ( linestring . coordinates [ i ] , polygon ) ) {
178
178
return false ;
179
179
}
@@ -184,7 +184,7 @@ function isLineInPoly(linestring: LineString, polygon: Polygon) {
184
184
{ ignoreBoundary : true }
185
185
) ;
186
186
}
187
- if ( ! foundInsidePoint ) {
187
+ if ( ! foundInsidePoint && i < linestring . coordinates . length - 1 ) {
188
188
var midpoint = getMidpoint (
189
189
linestring . coordinates [ i ] ,
190
190
linestring . coordinates [ i + 1 ]
You can’t perform that action at this time.
0 commit comments