Node.js MongoDB/Geojson$geointersects问题

Node.js MongoDB/Geojson$geointersects问题,node.js,mongodb,geojson,Node.js,Mongodb,Geojson,现在已经8个小时了,我正在尝试处理MongoDB Geojson$geoIntersects问题: 当我的多边形是正方形或长方形时,效果很好, 但是,当多边形具有交叉顶点时,我无法从$geoIntersects请求中获得一些结果,如以下示例: (来自()的图像) 多边形数据如下所示: { "type": "Feature", "properties": { "shape": "Polygon" }, "ge

现在已经8个小时了,我正在尝试处理MongoDB Geojson$geoIntersects问题:

当我的多边形是正方形或长方形时,效果很好, 但是,当多边形具有交叉顶点时,我无法从$geoIntersects请求中获得一些结果,如以下示例:

(来自()的图像)

多边形数据如下所示:

{
        "type": "Feature",
        "properties": {
            "shape": "Polygon"
        },
        "geometry": {
            "type": "Polygon",
            "coordinates": [
                [
                    [-1.565584, 47.226352],
                    [-1.564704, 47.226927],
                    [-1.564093, 47.225616],
                    [-1.563138, 47.226374],
                    [-1.565584, 47.226352]
                ]
            ]
        },
        "id": "dda54a42-090b-46ea-9dd0-fdda6d240f90"
    }
对于本例,我需要知道多边形是否包含我的点坐标。 这是我的简单查询:

db.geojsondatas.find({
    geometry: {
        $geoIntersects: {
            $geometry: {
                type: "Point",
                coordinates: [ -1.555638, 47.216245 ]
            }
        }
    }
});
有人知道有没有办法做到这一点吗

提前感谢。

也许可以尝试并调查您的多边形:


我认为
$geocurses
不支持自相交多边形

感谢您的回答,您是对的,$geoIntersects不支持自相交多边形:(我现在正在寻找一种将它们一分为二的解决方案。)再次感谢。