booleanWithin
是一个Turf.js 函数,用于确定一个geometry对象是否完全包含在另一个geometry中。
booleanWithin(outerGeometry, innerGeometry);
函数接收两个参数,即:
outerGeometry
Feature
| Geometry
innerGeometry
Feature
| Geometry
Boolean
var outerPolygon = turf.polygon([[[0,0],[0,10],[10,10],[10,0],[0,0]]]);
var innerPolygon = turf.polygon([[[0,0],[0,5],[5,5],[5,0],[0,0]]]);
var boolean = turf.booleanWithin(outerPolygon, innerPolygon);
console.log(boolean); // true