MongoDB - Geospatial intersection of two polygon

前端 未结 2 1519
天命终不由人
天命终不由人 2021-02-05 22:36

Is there any way we can query and get location data using mongodb geospatial query that matches the following criteria?

  • Getting all locations that are part of inte
2条回答
  •  醉酒成梦
    2021-02-05 23:19

    In case anyone else looks at this, as of mongo version 2.4, you can use $geoIntersects to find the intersection of GeoJSON objects, which supports intersections of two polygons, among other types.

    {
      : {
         $geoIntersects: {
            $geometry: {
               type: "" ,
               coordinates: [  ]
            }
         }
      }
    }
    

    There is a nice write up on this blog.

提交回复
热议问题