mongodb-geospatial

Mongo geoWithin error: Polygon coordinates must be an array

不打扰是莪最后的温柔 提交于 2020-08-10 23:17:49
问题 I have a data set with geo points. { _id ...other fields... location: { type: "Point", coordinates: [0,0]}} What I have been attempting to do is filter out and delete any documents that have points that are in water bodies. I downloaded and converted a shape file of the earth's water bodies and stored that in a separate collection in the same database. I have been trying to use Mongo's geoWithin function, but am not able to get it to work for me when I specify the water body's polygon

MongoDB: Matching points from one collection with polygons from another

萝らか妹 提交于 2020-06-29 04:18:40
问题 I'm trying to match points in one collection with regions stored in another collection. Here are examples of documents. Points: { "_id" : ObjectId("5e36d904618c0ea59f1eb04f"), "gps" : { "lat" : 50.073288, "lon" : 14.43979 }, "timeAdded" : ISODate("2020-02-02T15:13:22.096Z") } Regions: { "_id" : ObjectId("5e49a469afae4a11c4ff3cf7"), "type" : "Feature", "geometry" : { "type" : "Polygon", "coordinates" : [ [ [ -748397.88, -1049211.61 ], [ -748402.77, -1049212.2 ], ... [ -748410.41, -1049213.11 ]