我有这个多边形:
const polygon = JSON.parse('{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[6.26950853,50.72473626],[6.26953794,50.72468996],[6.2695546,50.7246512],[6.26949169,50.72468741],[6.26948194,50.72469389],[6.26946154,50.72470787],[6.26949172,50.72474162],[6.26950853,50.72473626]]]}}');
这个边界框:
const bbox = JSON.parse('{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[6.511887823915231,50.950514414615334],[6.512896634823051,50.53594214902105],[5.98503728350704,50.53594214902105],[5.98604609441486,50.950514414615334],[6.511887823915231,50.950514414615334]]]}}');
我想知道多边形是否与边界框相交
为此,我使用了turf.js中的booleanOverlap。
turf.booleanOverlap(polygon, bbox);
它返回false
。
这是为什么?这绝对是在边界框内。