Questions tagged [mongodb-geospatial]

38 questions
0
votes
1 answer

MongoDB: Matching points from one collection with polygons from another

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" :…
Ralfeus
  • 845
  • 9
  • 31
0
votes
1 answer

How to store a circle and see if it overlaps with a box/ Geojson point in mongodb

I am not sure if there is a way to do this. I need to have a circle in mongodb and run a query against that with a box using $box to see if these two shapes overlap or not. However, Geojson does not support circles. What would be the best way to get…
BlackLog
  • 301
  • 1
  • 5
  • 17
0
votes
1 answer

MongoDB geospatial index on $center

Collection Schema { "_id" : ObjectId("5d3562bf1b48d90ea4b06a74"), "name" : "19", "location" : { "type" : "Point", "coordinates" : [ 50.0480208, 30.5239127 ] } } Indexes >…
Hide
  • 3,199
  • 7
  • 41
  • 83
0
votes
0 answers

Unable to use linestring in $geoNear aggregation

I am trying to use LineString in $geoNear in a aggregation query, but unable to use it. I want any other alternative to use a LineString to compare list of co-ordinates. this is my function: function…
0
votes
1 answer

How to retrieve document using geospatial query in Mongoose

I am trying to use mongoose geospatial queries on the mongodb collection. "2dsphere" index is already applied on the location object. Query Please find the query below: const data = await Banks.find( { location: { $near: { …
Ashy Ashcsi
  • 1,529
  • 7
  • 22
  • 54
0
votes
0 answers

nodejs - Mongoose 5.3.8 - GeoJSON queries not working

I am attempting to store and query locations based on coordinate points with Mongoose 5.3.8 in order to return points within the radius of another point. I have read the docs and have implemented the pointSchema + citySchema example in the…
Bdyce
  • 332
  • 2
  • 11
-1
votes
1 answer

Sort Items in mongoDB using distance from a desired point

Database MongoDB on Azure with Cosmos DB (so the Mongo version will be 3.6) Scenario: I wish to show to the user in a mobile app, the items are linked to a supplier which have coordinates deep in the document structure. I would like to display the…
Ahmad Hajou
  • 1,289
  • 5
  • 22
  • 39
-1
votes
1 answer

Mongo geoWithin error: Polygon coordinates must be an array

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…
1 2
3