【问题标题】:MongoEngine geo_within_box not working with polygonMongoEngine geo_within_box 不适用于多边形
【发布时间】:2020-01-10 13:37:53
【问题描述】:

我要查询Drawing.objects(box__geo_within_box=[(-180, -90), (180, 90)])

Drawing.box 是这种类型的多边形 PolygonField() 以下列方式初始化:

{ "type": "Polygon", "coordinates": [ [ [left, top], [right, top], [right, bottom], [left, bottom], [left, top] ] ] }

但它不起作用(我得到空结果)。也许 geo_within_box 仅适用于点,而不适用于多边形?

如何查询框内的所有多边形?

注意:box__geo_intersects 只返回与边缘相交的多边形,而不是给定多边形内的多边形。

【问题讨论】:

标签: mongodb geospatial mongoengine geo


【解决方案1】:

问题是我查询"big" polygons。

box__geo_intersects 适用于小于单个半球的多边形。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    • 2019-11-16
    • 2020-11-06
    • 1970-01-01
    相关资源
    最近更新 更多