Questions tagged [mongodb-geospatial]
38 questions
1
vote
0 answers
MongoDB lookup expression with nearSphere criteria
I have a scenario where I have to join my restaurants and zips collection based on their location.
Restaurants
[{
"_id" : ObjectId("55cba2486c522cafdb059deb"),
"location" : {
"coordinates" : [
-74.138492,
…

Ghazanfar Khan
- 3,648
- 8
- 44
- 89
1
vote
1 answer
Filtering several Geo near operations in a query sends an error
I made a filter to do a Geospatial query on data from my Mongodb database and this filter works fine until I do an "And" operation on this filter with another Geospatial filter, but pointing to a different Property on the Collection I'm querying.…

John Code
- 655
- 7
- 24
1
vote
0 answers
java mongodb geonear using query class
I am trying to find the documents which are near to a point without using aggregation.I want use NearQuery or Query class or any other.
I tried with following queries but getting exception
1)
NearQuery…

nithin
- 371
- 9
- 24
1
vote
1 answer
mongoDB geospatial query doesn't works
I'm trying to extract all the elements inside a polygon (regular or irregular) but mongoDB geospatial doesn't works.
When I do the query like this, works perfectly
db.getCollection('houses').find({
'coordinates_geojson.coordinates.1': {
…

kirbylife
- 115
- 1
- 9
1
vote
1 answer
Does precision influence performance with MongoDB GeoSpatial Queries?
Consider a query of:
db.stuff.find({ Location:
{ $geoWithin:
{ $centerSphere: [ [ -73.93414657, 40.82302903 ], 5 / 3963.2 ] } } })
Would it be reasonable to expect a performance boost if the coordinates were less precise? If so, by how…

Wjdavis5
- 3,952
- 7
- 35
- 63
0
votes
1 answer
MongoDB geoNear on Group Results/ Distinct field of Latest records
Following are the fields with some sample data of my collection for geolocation of all the users on every 30 seconds.
Data Collection Documents
[{
"_id": id1,
"purpose": "tracking",
"user": User1,
"geoLocation": {
"type": "Point",
…

Durvesh Parmar
- 15
- 1
- 8
0
votes
0 answers
geospatial/geolocation for KMM Realm Mongodb
I have a kotlin multiplatform mobile app in android and swiftui, what is the best approach to implement a geospatial/geolocation using realm?
user20468094
0
votes
1 answer
Mongoose query on GeoJSON objects
I am trying to query some restaurants ordered by their distance to a certain location (user's location).
I have a "restaurants" collection with documents like this:
{
...
"location": {
"type": "Point",
"coordinates": [7.756894,…

SeriousMonk
- 75
- 6
0
votes
0 answers
How to find which polygon contains the given GPS coordinate from list of polygons, in server-side?
Background Information
I am using Node JS with MongoDB as database to build an API for a mobile application which collects geospatial data. The data consists of latitude and longitude information along with other data relevant to the…
0
votes
0 answers
MongoDB & Parse Server - Can not query based on geoPoint
Simple Query:
PFQuery *query=[PFQuery queryWithClassName:@"Adventures"];
[query whereKey:@"location" nearGeoPoint:self.userLocation withinMiles:100];
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error)…

Peter
- 1,053
- 13
- 29
0
votes
1 answer
Does MongoDB provide the distance to point with $nearSphere operator?
The $nearSphere MongoDB operator is able to return the documents near to a given point (specified as parameter of the operator) sorted by incresing distance.
However, how to get the actual distance? Is there any mean of getting this using MongoDB…

fgalan
- 11,732
- 9
- 46
- 89
0
votes
0 answers
Results of my mongoDB $near query are not sorted
When I make a query to my MongoDB database using mongoose and the mongoDB $near geospatial operator (also tried $nearSphere) my code returns a 200 HTTP status with the correct list of documents but they are not sorted from nearest to furthest (which…

eliotmkb
- 1
- 2
0
votes
1 answer
Is it possible to use mongoDB geospacial indexes with grid FS
I have a large geojson feature collection which is over 16MB. I am hoping to insert the data into MongoDB so that I can utilize the geospatial functionality that MongoDB offers ($geoIntersects, $geoWithin, etc). Due to the large size of the file, I…

sfraser
- 1
- 1
0
votes
1 answer
Can't extract geo keys - Working with Atlas but not Local MongoDB
Please refer to this issue Here
I have same issue except i am not providing any geo data.
My Model's geo data implementation portion below
startLocation: {
// GeoJSON
type: {
type: String,
default: 'Point',
…

Kebrum Otis
- 25
- 1
- 6
0
votes
1 answer
MongoDB Geospatial, project matching multi points
Via MongoDB $geoNear command with Aggregate, I'm unable to generate locations that are within the queried maxDistance field.
array(
'$geoNear' => array(
'near' => array(
…

Michael Mikhjian
- 2,760
- 4
- 36
- 51