@turf/boolean-within 7.0.0-alpha.113 → 7.0.0-alpha.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -138,7 +138,7 @@ function isLineInPoly(linestring, polygon) {
138
138
  return false;
139
139
  }
140
140
  var foundInsidePoint = false;
141
- for (var i = 0; i < linestring.coordinates.length - 1; i++) {
141
+ for (var i = 0; i < linestring.coordinates.length; i++) {
142
142
  if (!_booleanpointinpolygon.booleanPointInPolygon.call(void 0, linestring.coordinates[i], polygon)) {
143
143
  return false;
144
144
  }
@@ -149,7 +149,7 @@ function isLineInPoly(linestring, polygon) {
149
149
  { ignoreBoundary: true }
150
150
  );
151
151
  }
152
- if (!foundInsidePoint) {
152
+ if (!foundInsidePoint && i < linestring.coordinates.length - 1) {
153
153
  var midpoint = getMidpoint(
154
154
  linestring.coordinates[i],
155
155
  linestring.coordinates[i + 1]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";;;;AAUA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,eAAe;AAmBxB,SAAS,cACP,UACA,UACS;AACT,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,MAAM;AAClB,MAAI,QAAQ,MAAM;AAElB,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,cAAQ,OAAO;AAAA,QACb,KAAK;AACH,iBAAO,oBAAoB,OAAO,KAAK;AAAA,QACzC,KAAK;AACH,iBAAO,mBAAmB,OAAO,OAAO,EAAE,mBAAmB,KAAK,CAAC;AAAA,QACrE,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,sBAAsB,OAAO,OAAO,EAAE,gBAAgB,KAAK,CAAC;AAAA,QACrE;AACE,gBAAM,IAAI,MAAM,cAAc,QAAQ,yBAAyB;AAAA,MACnE;AAAA,IACF,KAAK;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,MAAM,CAAC,MAAM,MAAM,CAAC;AACtD;AAFS;AAYT,SAAS,YAAY,OAAiB,OAAiB;AACrD,SAAO,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;AAC9D;AAFS;AAKT,IAAO,8BAAQ","sourcesContent":["import {\n BBox,\n Feature,\n Geometry,\n LineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { bbox as calcBbox } from \"@turf/bbox\";\nimport { booleanPointOnLine } from \"@turf/boolean-point-on-line\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { getGeom } from \"@turf/invariant\";\n\n/**\n * Boolean-within returns true if the first geometry is completely within the second geometry.\n * The interiors of both geometries must intersect and, the interior and boundary of the primary (geometry a)\n * must not intersect the exterior of the secondary (geometry b).\n * Boolean-within returns the exact opposite result of the `@turf/boolean-contains`.\n *\n * @name booleanWithin\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n * var point = turf.point([1, 2]);\n *\n * turf.booleanWithin(point, line);\n * //=true\n */\nfunction booleanWithin(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry\n): boolean {\n var geom1 = getGeom(feature1);\n var geom2 = getGeom(feature2);\n var type1 = geom1.type;\n var type2 = geom2.type;\n\n switch (type1) {\n case \"Point\":\n switch (type2) {\n case \"MultiPoint\":\n return isPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });\n case \"Polygon\":\n case \"MultiPolygon\":\n return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"MultiPoint\":\n switch (type2) {\n case \"MultiPoint\":\n return isMultiPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return isMultiPointOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isMultiPointInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"LineString\":\n switch (type2) {\n case \"LineString\":\n return isLineOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isLineInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"Polygon\":\n switch (type2) {\n case \"Polygon\":\n case \"MultiPolygon\":\n return isPolyInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n default:\n throw new Error(\"feature1 \" + type1 + \" geometry not supported\");\n }\n}\n\nfunction isPointInMultiPoint(point: Point, multiPoint: MultiPoint) {\n var i;\n var output = false;\n for (i = 0; i < multiPoint.coordinates.length; i++) {\n if (compareCoords(multiPoint.coordinates[i], point.coordinates)) {\n output = true;\n break;\n }\n }\n return output;\n}\n\nfunction isMultiPointInMultiPoint(\n multiPoint1: MultiPoint,\n multiPoint2: MultiPoint\n) {\n for (var i = 0; i < multiPoint1.coordinates.length; i++) {\n var anyMatch = false;\n for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {\n if (\n compareCoords(multiPoint1.coordinates[i], multiPoint2.coordinates[i2])\n ) {\n anyMatch = true;\n }\n }\n if (!anyMatch) {\n return false;\n }\n }\n return true;\n}\n\nfunction isMultiPointOnLine(multiPoint: MultiPoint, lineString: LineString) {\n var foundInsidePoint = false;\n\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n if (!booleanPointOnLine(multiPoint.coordinates[i], lineString)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointOnLine(\n multiPoint.coordinates[i],\n lineString,\n { ignoreEndVertices: true }\n );\n }\n }\n return foundInsidePoint;\n}\n\nfunction isMultiPointInPoly(multiPoint: MultiPoint, polygon: Polygon) {\n var output = true;\n var oneInside = false;\n var isInside = false;\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon);\n if (!isInside) {\n output = false;\n break;\n }\n if (!oneInside) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return output && isInside;\n}\n\nfunction isLineOnLine(lineString1: LineString, lineString2: LineString) {\n for (var i = 0; i < lineString1.coordinates.length; i++) {\n if (!booleanPointOnLine(lineString1.coordinates[i], lineString2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction isLineInPoly(linestring: LineString, polygon: Polygon) {\n var polyBbox = calcBbox(polygon);\n var lineBbox = calcBbox(linestring);\n if (!doBBoxOverlap(polyBbox, lineBbox)) {\n return false;\n }\n var foundInsidePoint = false;\n\n for (var i = 0; i < linestring.coordinates.length - 1; i++) {\n if (!booleanPointInPolygon(linestring.coordinates[i], polygon)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointInPolygon(\n linestring.coordinates[i],\n polygon,\n { ignoreBoundary: true }\n );\n }\n if (!foundInsidePoint) {\n var midpoint = getMidpoint(\n linestring.coordinates[i],\n linestring.coordinates[i + 1]\n );\n foundInsidePoint = booleanPointInPolygon(midpoint, polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return foundInsidePoint;\n}\n\n/**\n * Is Polygon2 in Polygon1\n * Only takes into account outer rings\n *\n * @private\n * @param {Polygon} geometry1\n * @param {Polygon|MultiPolygon} geometry2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(geometry1: Polygon, geometry2: Polygon | MultiPolygon) {\n var poly1Bbox = calcBbox(geometry1);\n var poly2Bbox = calcBbox(geometry2);\n if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {\n return false;\n }\n for (var i = 0; i < geometry1.coordinates[0].length; i++) {\n if (!booleanPointInPolygon(geometry1.coordinates[0][i], geometry2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction doBBoxOverlap(bbox1: BBox, bbox2: BBox) {\n if (bbox1[0] > bbox2[0]) return false;\n if (bbox1[2] < bbox2[2]) return false;\n if (bbox1[1] > bbox2[1]) return false;\n if (bbox1[3] < bbox2[3]) return false;\n return true;\n}\n\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1: number[], pair2: number[]) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n\n/**\n * getMidpoint\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {Position} midpoint of pair1 and pair2\n */\nfunction getMidpoint(pair1: number[], pair2: number[]) {\n return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];\n}\n\nexport { booleanWithin };\nexport default booleanWithin;\n"]}
1
+ {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";;;;AAUA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,eAAe;AAmBxB,SAAS,cACP,UACA,UACS;AACT,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,MAAM;AAClB,MAAI,QAAQ,MAAM;AAElB,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,cAAQ,OAAO;AAAA,QACb,KAAK;AACH,iBAAO,oBAAoB,OAAO,KAAK;AAAA,QACzC,KAAK;AACH,iBAAO,mBAAmB,OAAO,OAAO,EAAE,mBAAmB,KAAK,CAAC;AAAA,QACrE,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,sBAAsB,OAAO,OAAO,EAAE,gBAAgB,KAAK,CAAC;AAAA,QACrE;AACE,gBAAM,IAAI,MAAM,cAAc,QAAQ,yBAAyB;AAAA,MACnE;AAAA,I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MAAM,CAAC,MAAM,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,MAAM,CAAC;AACtD;AAFS;AAYT,SAAS,YAAY,OAAiB,OAAiB;AACrD,SAAO,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC;AAC9D;AAFS;AAKT,IAAO,8BAAQ","sourcesContent":["import {\n BBox,\n Feature,\n Geometry,\n LineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { bbox as calcBbox } from \"@turf/bbox\";\nimport { booleanPointOnLine } from \"@turf/boolean-point-on-line\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { getGeom } from \"@turf/invariant\";\n\n/**\n * Boolean-within returns true if the first geometry is completely within the second geometry.\n * The interiors of both geometries must intersect and, the interior and boundary of the primary (geometry a)\n * must not intersect the exterior of the secondary (geometry b).\n * Boolean-within returns the exact opposite result of the `@turf/boolean-contains`.\n *\n * @name booleanWithin\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n * var point = turf.point([1, 2]);\n *\n * turf.booleanWithin(point, line);\n * //=true\n */\nfunction booleanWithin(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry\n): boolean {\n var geom1 = getGeom(feature1);\n var geom2 = getGeom(feature2);\n var type1 = geom1.type;\n var type2 = geom2.type;\n\n switch (type1) {\n case \"Point\":\n switch (type2) {\n case \"MultiPoint\":\n return isPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });\n case \"Polygon\":\n case \"MultiPolygon\":\n return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"MultiPoint\":\n switch (type2) {\n case \"MultiPoint\":\n return isMultiPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return isMultiPointOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isMultiPointInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"LineString\":\n switch (type2) {\n case \"LineString\":\n return isLineOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isLineInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"Polygon\":\n switch (type2) {\n case \"Polygon\":\n case \"MultiPolygon\":\n return isPolyInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n default:\n throw new Error(\"feature1 \" + type1 + \" geometry not supported\");\n }\n}\n\nfunction isPointInMultiPoint(point: Point, multiPoint: MultiPoint) {\n var i;\n var output = false;\n for (i = 0; i < multiPoint.coordinates.length; i++) {\n if (compareCoords(multiPoint.coordinates[i], point.coordinates)) {\n output = true;\n break;\n }\n }\n return output;\n}\n\nfunction isMultiPointInMultiPoint(\n multiPoint1: MultiPoint,\n multiPoint2: MultiPoint\n) {\n for (var i = 0; i < multiPoint1.coordinates.length; i++) {\n var anyMatch = false;\n for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {\n if (\n compareCoords(multiPoint1.coordinates[i], multiPoint2.coordinates[i2])\n ) {\n anyMatch = true;\n }\n }\n if (!anyMatch) {\n return false;\n }\n }\n return true;\n}\n\nfunction isMultiPointOnLine(multiPoint: MultiPoint, lineString: LineString) {\n var foundInsidePoint = false;\n\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n if (!booleanPointOnLine(multiPoint.coordinates[i], lineString)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointOnLine(\n multiPoint.coordinates[i],\n lineString,\n { ignoreEndVertices: true }\n );\n }\n }\n return foundInsidePoint;\n}\n\nfunction isMultiPointInPoly(multiPoint: MultiPoint, polygon: Polygon) {\n var output = true;\n var oneInside = false;\n var isInside = false;\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon);\n if (!isInside) {\n output = false;\n break;\n }\n if (!oneInside) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return output && isInside;\n}\n\nfunction isLineOnLine(lineString1: LineString, lineString2: LineString) {\n for (var i = 0; i < lineString1.coordinates.length; i++) {\n if (!booleanPointOnLine(lineString1.coordinates[i], lineString2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction isLineInPoly(linestring: LineString, polygon: Polygon) {\n var polyBbox = calcBbox(polygon);\n var lineBbox = calcBbox(linestring);\n if (!doBBoxOverlap(polyBbox, lineBbox)) {\n return false;\n }\n var foundInsidePoint = false;\n\n for (var i = 0; i < linestring.coordinates.length; i++) {\n if (!booleanPointInPolygon(linestring.coordinates[i], polygon)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointInPolygon(\n linestring.coordinates[i],\n polygon,\n { ignoreBoundary: true }\n );\n }\n if (!foundInsidePoint && i < linestring.coordinates.length - 1) {\n var midpoint = getMidpoint(\n linestring.coordinates[i],\n linestring.coordinates[i + 1]\n );\n foundInsidePoint = booleanPointInPolygon(midpoint, polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return foundInsidePoint;\n}\n\n/**\n * Is Polygon2 in Polygon1\n * Only takes into account outer rings\n *\n * @private\n * @param {Polygon} geometry1\n * @param {Polygon|MultiPolygon} geometry2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(geometry1: Polygon, geometry2: Polygon | MultiPolygon) {\n var poly1Bbox = calcBbox(geometry1);\n var poly2Bbox = calcBbox(geometry2);\n if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {\n return false;\n }\n for (var i = 0; i < geometry1.coordinates[0].length; i++) {\n if (!booleanPointInPolygon(geometry1.coordinates[0][i], geometry2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction doBBoxOverlap(bbox1: BBox, bbox2: BBox) {\n if (bbox1[0] > bbox2[0]) return false;\n if (bbox1[2] < bbox2[2]) return false;\n if (bbox1[1] > bbox2[1]) return false;\n if (bbox1[3] < bbox2[3]) return false;\n return true;\n}\n\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1: number[], pair2: number[]) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n\n/**\n * getMidpoint\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {Position} midpoint of pair1 and pair2\n */\nfunction getMidpoint(pair1: number[], pair2: number[]) {\n return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];\n}\n\nexport { booleanWithin };\nexport default booleanWithin;\n"]}
@@ -138,7 +138,7 @@ function isLineInPoly(linestring, polygon) {
138
138
  return false;
139
139
  }
140
140
  var foundInsidePoint = false;
141
- for (var i = 0; i < linestring.coordinates.length - 1; i++) {
141
+ for (var i = 0; i < linestring.coordinates.length; i++) {
142
142
  if (!booleanPointInPolygon(linestring.coordinates[i], polygon)) {
143
143
  return false;
144
144
  }
@@ -149,7 +149,7 @@ function isLineInPoly(linestring, polygon) {
149
149
  { ignoreBoundary: true }
150
150
  );
151
151
  }
152
- if (!foundInsidePoint) {
152
+ if (!foundInsidePoint && i < linestring.coordinates.length - 1) {
153
153
  var midpoint = getMidpoint(
154
154
  linestring.coordinates[i],
155
155
  linestring.coordinates[i + 1]
@@ -201,4 +201,4 @@ export {
201
201
  booleanWithin,
202
202
  turf_boolean_within_default as default
203
203
  };
204
- //# sourceMappingURL=index.mjs.map
204
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n BBox,\n Feature,\n Geometry,\n LineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { bbox as calcBbox } from \"@turf/bbox\";\nimport { booleanPointOnLine } from \"@turf/boolean-point-on-line\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { getGeom } from \"@turf/invariant\";\n\n/**\n * Boolean-within returns true if the first geometry is completely within the second geometry.\n * The interiors of both geometries must intersect and, the interior and boundary of the primary (geometry a)\n * must not intersect the exterior of the secondary (geometry b).\n * Boolean-within returns the exact opposite result of the `@turf/boolean-contains`.\n *\n * @name booleanWithin\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n * var point = turf.point([1, 2]);\n *\n * turf.booleanWithin(point, line);\n * //=true\n */\nfunction booleanWithin(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry\n): boolean {\n var geom1 = getGeom(feature1);\n var geom2 = getGeom(feature2);\n var type1 = geom1.type;\n var type2 = geom2.type;\n\n switch (type1) {\n case \"Point\":\n switch (type2) {\n case \"MultiPoint\":\n return isPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });\n case \"Polygon\":\n case \"MultiPolygon\":\n return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"MultiPoint\":\n switch (type2) {\n case \"MultiPoint\":\n return isMultiPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return isMultiPointOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isMultiPointInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"LineString\":\n switch (type2) {\n case \"LineString\":\n return isLineOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isLineInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"Polygon\":\n switch (type2) {\n case \"Polygon\":\n case \"MultiPolygon\":\n return isPolyInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n default:\n throw new Error(\"feature1 \" + type1 + \" geometry not supported\");\n }\n}\n\nfunction isPointInMultiPoint(point: Point, multiPoint: MultiPoint) {\n var i;\n var output = false;\n for (i = 0; i < multiPoint.coordinates.length; i++) {\n if (compareCoords(multiPoint.coordinates[i], point.coordinates)) {\n output = true;\n break;\n }\n }\n return output;\n}\n\nfunction isMultiPointInMultiPoint(\n multiPoint1: MultiPoint,\n multiPoint2: MultiPoint\n) {\n for (var i = 0; i < multiPoint1.coordinates.length; i++) {\n var anyMatch = false;\n for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {\n if (\n compareCoords(multiPoint1.coordinates[i], multiPoint2.coordinates[i2])\n ) {\n anyMatch = true;\n }\n }\n if (!anyMatch) {\n return false;\n }\n }\n return true;\n}\n\nfunction isMultiPointOnLine(multiPoint: MultiPoint, lineString: LineString) {\n var foundInsidePoint = false;\n\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n if (!booleanPointOnLine(multiPoint.coordinates[i], lineString)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointOnLine(\n multiPoint.coordinates[i],\n lineString,\n { ignoreEndVertices: true }\n );\n }\n }\n return foundInsidePoint;\n}\n\nfunction isMultiPointInPoly(multiPoint: MultiPoint, polygon: Polygon) {\n var output = true;\n var oneInside = false;\n var isInside = false;\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon);\n if (!isInside) {\n output = false;\n break;\n }\n if (!oneInside) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return output && isInside;\n}\n\nfunction isLineOnLine(lineString1: LineString, lineString2: LineString) {\n for (var i = 0; i < lineString1.coordinates.length; i++) {\n if (!booleanPointOnLine(lineString1.coordinates[i], lineString2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction isLineInPoly(linestring: LineString, polygon: Polygon) {\n var polyBbox = calcBbox(polygon);\n var lineBbox = calcBbox(linestring);\n if (!doBBoxOverlap(polyBbox, lineBbox)) {\n return false;\n }\n var foundInsidePoint = false;\n\n for (var i = 0; i < linestring.coordinates.length; i++) {\n if (!booleanPointInPolygon(linestring.coordinates[i], polygon)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointInPolygon(\n linestring.coordinates[i],\n polygon,\n { ignoreBoundary: true }\n );\n }\n if (!foundInsidePoint && i < linestring.coordinates.length - 1) {\n var midpoint = getMidpoint(\n linestring.coordinates[i],\n linestring.coordinates[i + 1]\n );\n foundInsidePoint = booleanPointInPolygon(midpoint, polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return foundInsidePoint;\n}\n\n/**\n * Is Polygon2 in Polygon1\n * Only takes into account outer rings\n *\n * @private\n * @param {Polygon} geometry1\n * @param {Polygon|MultiPolygon} geometry2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(geometry1: Polygon, geometry2: Polygon | MultiPolygon) {\n var poly1Bbox = calcBbox(geometry1);\n var poly2Bbox = calcBbox(geometry2);\n if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {\n return false;\n }\n for (var i = 0; i < geometry1.coordinates[0].length; i++) {\n if (!booleanPointInPolygon(geometry1.coordinates[0][i], geometry2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction doBBoxOverlap(bbox1: BBox, bbox2: BBox) {\n if (bbox1[0] > bbox2[0]) return false;\n if (bbox1[2] < bbox2[2]) return false;\n if (bbox1[1] > bbox2[1]) return false;\n if (bbox1[3] < bbox2[3]) return false;\n return true;\n}\n\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1: number[], pair2: number[]) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n\n/**\n * getMidpoint\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {Position} midpoint of pair1 and pair2\n */\nfunction getMidpoint(pair1: number[], pair2: number[]) {\n return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];\n}\n\nexport { booleanWithin };\nexport default booleanWithin;\n"],"mappings":";;;;AAUA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,eAAe;AAmBxB,SAAS,cACP,UACA,UACS;AACT,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,MAAM;AAClB,MAAI,QAAQ,MAAM;AAElB,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,cAAQ,OAAO;AAAA,QACb,KAAK;AACH,iBAAO,oBAAoB,OAAO,KAAK;AAAA,QACzC,KAAK;AACH,iBAAO,mBAAmB,OAAO,OAAO,EAAE,mBAAmB,KAAK,CAAC;AAAA,QACrE,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,sBAAsB,OAAO,OAAO,EAAE,gBAAgB,KAAK,CAAC;AAAA,QACrE;AACE,gBAAM,IAAI,MAAM,cAAc,QAAQ,yBAAyB;AAAA,MACnE;AAAA,IACF,KAAK;AACH,cAAQ,OAAO;AAAA,QACb,KAAK;AACH,iBAAO,yBAAyB,OAAO,KAAK;AAAA,QAC9C,KAAK;AACH,iBAAO,mBAAmB,OAAO,KAAK;AAAA,QACxC,KAAK;AAAA,QACL,KAAK;AACH,iBAAO,mBAAmB,OAAO,KAAK;AAAA,QACxC;AACE,gB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C9D;AAFS;AAKT,IAAO,8BAAQ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/boolean-within",
3
- "version": "7.0.0-alpha.113+876702a45",
3
+ "version": "7.0.0-alpha.115+c76e6e96e",
4
4
  "description": "turf boolean-within module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -27,19 +27,19 @@
27
27
  "within",
28
28
  "boolean-within"
29
29
  ],
30
- "type": "commonjs",
30
+ "type": "module",
31
31
  "main": "dist/cjs/index.cjs",
32
- "module": "dist/esm/index.mjs",
33
- "types": "dist/cjs/index.d.ts",
32
+ "module": "dist/esm/index.js",
33
+ "types": "dist/esm/index.d.ts",
34
34
  "exports": {
35
35
  "./package.json": "./package.json",
36
36
  ".": {
37
37
  "import": {
38
- "types": "./dist/esm/index.d.mts",
39
- "default": "./dist/esm/index.mjs"
38
+ "types": "./dist/esm/index.d.ts",
39
+ "default": "./dist/esm/index.js"
40
40
  },
41
41
  "require": {
42
- "types": "./dist/cjs/index.d.ts",
42
+ "types": "./dist/cjs/index.d.cts",
43
43
  "default": "./dist/cjs/index.cjs"
44
44
  }
45
45
  }
@@ -54,7 +54,7 @@
54
54
  "docs": "tsx ../../scripts/generate-readmes.ts",
55
55
  "test": "npm-run-all --npm-path npm test:*",
56
56
  "test:tape": "tsx test.ts",
57
- "test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
57
+ "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/benchmark": "^2.1.5",
@@ -71,12 +71,12 @@
71
71
  "typescript": "^5.2.2"
72
72
  },
73
73
  "dependencies": {
74
- "@turf/bbox": "^7.0.0-alpha.113+876702a45",
75
- "@turf/boolean-point-in-polygon": "^7.0.0-alpha.113+876702a45",
76
- "@turf/boolean-point-on-line": "^7.0.0-alpha.113+876702a45",
77
- "@turf/helpers": "^7.0.0-alpha.113+876702a45",
78
- "@turf/invariant": "^7.0.0-alpha.113+876702a45",
74
+ "@turf/bbox": "^7.0.0-alpha.115+c76e6e96e",
75
+ "@turf/boolean-point-in-polygon": "^7.0.0-alpha.115+c76e6e96e",
76
+ "@turf/boolean-point-on-line": "^7.0.0-alpha.115+c76e6e96e",
77
+ "@turf/helpers": "^7.0.0-alpha.115+c76e6e96e",
78
+ "@turf/invariant": "^7.0.0-alpha.115+c76e6e96e",
79
79
  "tslib": "^2.6.2"
80
80
  },
81
- "gitHead": "876702a454d5d085d6e1e54ae286c2b5bc08f584"
81
+ "gitHead": "c76e6e96eea2a08d55f670333a085535da5371ce"
82
82
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n BBox,\n Feature,\n Geometry,\n LineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { bbox as calcBbox } from \"@turf/bbox\";\nimport { booleanPointOnLine } from \"@turf/boolean-point-on-line\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { getGeom } from \"@turf/invariant\";\n\n/**\n * Boolean-within returns true if the first geometry is completely within the second geometry.\n * The interiors of both geometries must intersect and, the interior and boundary of the primary (geometry a)\n * must not intersect the exterior of the secondary (geometry b).\n * Boolean-within returns the exact opposite result of the `@turf/boolean-contains`.\n *\n * @name booleanWithin\n * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n * var point = turf.point([1, 2]);\n *\n * turf.booleanWithin(point, line);\n * //=true\n */\nfunction booleanWithin(\n feature1: Feature<any> | Geometry,\n feature2: Feature<any> | Geometry\n): boolean {\n var geom1 = getGeom(feature1);\n var geom2 = getGeom(feature2);\n var type1 = geom1.type;\n var type2 = geom2.type;\n\n switch (type1) {\n case \"Point\":\n switch (type2) {\n case \"MultiPoint\":\n return isPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });\n case \"Polygon\":\n case \"MultiPolygon\":\n return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"MultiPoint\":\n switch (type2) {\n case \"MultiPoint\":\n return isMultiPointInMultiPoint(geom1, geom2);\n case \"LineString\":\n return isMultiPointOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isMultiPointInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"LineString\":\n switch (type2) {\n case \"LineString\":\n return isLineOnLine(geom1, geom2);\n case \"Polygon\":\n case \"MultiPolygon\":\n return isLineInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n case \"Polygon\":\n switch (type2) {\n case \"Polygon\":\n case \"MultiPolygon\":\n return isPolyInPoly(geom1, geom2);\n default:\n throw new Error(\"feature2 \" + type2 + \" geometry not supported\");\n }\n default:\n throw new Error(\"feature1 \" + type1 + \" geometry not supported\");\n }\n}\n\nfunction isPointInMultiPoint(point: Point, multiPoint: MultiPoint) {\n var i;\n var output = false;\n for (i = 0; i < multiPoint.coordinates.length; i++) {\n if (compareCoords(multiPoint.coordinates[i], point.coordinates)) {\n output = true;\n break;\n }\n }\n return output;\n}\n\nfunction isMultiPointInMultiPoint(\n multiPoint1: MultiPoint,\n multiPoint2: MultiPoint\n) {\n for (var i = 0; i < multiPoint1.coordinates.length; i++) {\n var anyMatch = false;\n for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {\n if (\n compareCoords(multiPoint1.coordinates[i], multiPoint2.coordinates[i2])\n ) {\n anyMatch = true;\n }\n }\n if (!anyMatch) {\n return false;\n }\n }\n return true;\n}\n\nfunction isMultiPointOnLine(multiPoint: MultiPoint, lineString: LineString) {\n var foundInsidePoint = false;\n\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n if (!booleanPointOnLine(multiPoint.coordinates[i], lineString)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointOnLine(\n multiPoint.coordinates[i],\n lineString,\n { ignoreEndVertices: true }\n );\n }\n }\n return foundInsidePoint;\n}\n\nfunction isMultiPointInPoly(multiPoint: MultiPoint, polygon: Polygon) {\n var output = true;\n var oneInside = false;\n var isInside = false;\n for (var i = 0; i < multiPoint.coordinates.length; i++) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon);\n if (!isInside) {\n output = false;\n break;\n }\n if (!oneInside) {\n isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return output && isInside;\n}\n\nfunction isLineOnLine(lineString1: LineString, lineString2: LineString) {\n for (var i = 0; i < lineString1.coordinates.length; i++) {\n if (!booleanPointOnLine(lineString1.coordinates[i], lineString2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction isLineInPoly(linestring: LineString, polygon: Polygon) {\n var polyBbox = calcBbox(polygon);\n var lineBbox = calcBbox(linestring);\n if (!doBBoxOverlap(polyBbox, lineBbox)) {\n return false;\n }\n var foundInsidePoint = false;\n\n for (var i = 0; i < linestring.coordinates.length - 1; i++) {\n if (!booleanPointInPolygon(linestring.coordinates[i], polygon)) {\n return false;\n }\n if (!foundInsidePoint) {\n foundInsidePoint = booleanPointInPolygon(\n linestring.coordinates[i],\n polygon,\n { ignoreBoundary: true }\n );\n }\n if (!foundInsidePoint) {\n var midpoint = getMidpoint(\n linestring.coordinates[i],\n linestring.coordinates[i + 1]\n );\n foundInsidePoint = booleanPointInPolygon(midpoint, polygon, {\n ignoreBoundary: true,\n });\n }\n }\n return foundInsidePoint;\n}\n\n/**\n * Is Polygon2 in Polygon1\n * Only takes into account outer rings\n *\n * @private\n * @param {Polygon} geometry1\n * @param {Polygon|MultiPolygon} geometry2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(geometry1: Polygon, geometry2: Polygon | MultiPolygon) {\n var poly1Bbox = calcBbox(geometry1);\n var poly2Bbox = calcBbox(geometry2);\n if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {\n return false;\n }\n for (var i = 0; i < geometry1.coordinates[0].length; i++) {\n if (!booleanPointInPolygon(geometry1.coordinates[0][i], geometry2)) {\n return false;\n }\n }\n return true;\n}\n\nfunction doBBoxOverlap(bbox1: BBox, bbox2: BBox) {\n if (bbox1[0] > bbox2[0]) return false;\n if (bbox1[2] < bbox2[2]) return false;\n if (bbox1[1] > bbox2[1]) return false;\n if (bbox1[3] < bbox2[3]) return false;\n return true;\n}\n\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1: number[], pair2: number[]) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n\n/**\n * getMidpoint\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {Position} midpoint of pair1 and pair2\n */\nfunction getMidpoint(pair1: number[], pair2: number[]) {\n return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];\n}\n\nexport { booleanWithin };\nexport default booleanWithin;\n"],"mappings":";;;;AAUA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,eAAe;AAmBxB,SAAS,cACP,UACA,UACS;AACT,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,QAAQ,QAAQ;AAC5B,MAAI,QAAQ,MAAM;AAClB,MAAI,QAAQ,MAAM;AAElB,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,cAAQ,OAAO;AAAA,QACb,KAAK;AACH,iBAAO,oBAAoB,OAAO,KAAK;AAAA,QACzC,KAAK;AACH,iBAAO,mBAAmB,OAAO,OAAO,E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