Using a spatial database to find polygons that con

2019-08-02 08:42发布

问题:

I'm using MongoDB to store spatial records. Some records are polygons, and others are points. Data is being continually inserted.

I need to be able to access all records whose polygon contains a point. Mongo's spatial queries allow finding all points within a polygon, but not all polygons that contain a point. Is there a good way to do this in MongoDB another database system?

回答1:

Unfortunately, there is no way to run this query at present -- unless you're willing to simplify the application (i.e., assume all polygons are circles of a particular radius [or small set of radii]).

There's an open ticket for the functionality you described: https://jira.mongodb.org/browse/SERVER-2874