39 questions
1
vote
0
answers
24
views
coordinate of Geospatial with node js express and mangodb
i am using nodejs express and mangodb, when a user signup i want to get the live location of the use geospatial code . this is the error i get when i run my code .
MongoServerError: Can't extract geo ...
1
vote
0
answers
127
views
Does Postgis's ST_Within and Mongodb's $geoWithin perform the same way and should return the same result?
I have been trying to compare the Geospatial query function of two well-known database engine, Mongod and Postgis to see which one would suit my work the most.
I prepared mock data for my database, ...
0
votes
1
answer
116
views
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": "...
2
votes
0
answers
112
views
Why does mongoDB driver seem to fallback to MarshalJSON but not UnmarshalJSON in Go
I noticed when trying to insert an complex data type into a mongodb using Go without having MarshalBSON implemented, it falls back to MarshalJSON and inserts the struct correctly as a document in ...
1
vote
0
answers
81
views
MongoDB for big tile map game 1000x1000
I started learning mongodb and was trying to figure out which way is better suited for a large 2d tile map if I need to store a large number of tiles.
In my case, the player has to fill in the free 4 ...
1
vote
1
answer
77
views
Mongodb geospacial aggregate returns different results using $match vs query
db.units.aggregate([
{
"$geoNear": {
"near": {
"type": "Point",
"coordinates": [ -3.70256, 40.4165 ]
},
"...
1
vote
0
answers
203
views
Azure CosmosDB MongoDB Api GeoSpatial queries not working
I have CosmosDB MongoDB-API instance.
Mongo server version = 4.0.0
Inserted documents look like:
{
"_id": "111",
"fileName": "some.txt",
"...
1
vote
1
answer
797
views
MongoDB $geoNear Aggregation on another collection
I have a database with two collections like so:
[
{
"name": "Person A",
"location": {"type": "Point", "coordinates": [180, 90]}
}...
1
vote
1
answer
351
views
MongoDB $geowithin not acting as expected
I am storing positions into a collection, and based on a bounding box, I would like to retrieve the positions that are within this bounding box.
For small bounding boxes, everything seems to work fine,...
1
vote
1
answer
813
views
MongoDB and geospatial queries: unknown geo specifier: $geometry: null
i'm experimenting with mongodb and geospatial queries. I made the following collection:
shape> db.shape.find()
[
{
_id: ObjectId("61ab50d2056b5357b5e23e56"),
name: 'Point1',
...
1
vote
1
answer
752
views
MongoDB GeoSpatial Data: Loop is not valid: Edges 8 and 10 cross
I am trying to insert a polygon into a MongoDB DBMS. The polygon is self intersecting in one point. The polygon is the following:
{
"type": "FeatureCollection",
"crs": { &...
1
vote
1
answer
212
views
MongoDB and .netCore Find nearest locations (unable to find index for $geoNear query)
I'm trying to find nearest other locations form my MongoDB database.
I'm using .net Core as rest API.
.net Core 5.0
This is my MDB Class
public class MdbTrip
{
[BsonId]
[...
3
votes
0
answers
393
views
MongoDB - $geoNear and includeLocs with multiple matches in same document
I have a collection that looks like this:
Mongodb Collection Data:
/* 1 */
{
"_id" : "X1255",
"member" : {
"id" : "X1255",
&...
0
votes
1
answer
340
views
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:
{
...
"...
0
votes
0
answers
426
views
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 ...
0
votes
0
answers
159
views
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 ...
-1
votes
1
answer
223
views
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 ...
-1
votes
1
answer
2k
views
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 ...
2
votes
1
answer
2k
views
How to check if a vehicle entered into geofence or not using geospatial data in NodeJS using mongodb and mongoose?
I've been working on creating geo fences and alerting systems using Node.JS, mongoDB and mongoose framwork.
I've a vehicle with a sensor, which keep on sending the coordinates it travelling through.
...
0
votes
1
answer
531
views
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? ...
0
votes
0
answers
337
views
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 ...
0
votes
1
answer
134
views
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, $...
0
votes
1
answer
266
views
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: {
...
0
votes
1
answer
318
views
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(
...
1
vote
1
answer
469
views
get the document with $box with mongodb and add distance field for each record with specific coordinate point
Case
I have store the location coordinates in MongoDB collection with 2dsphere index. I want to get the records which included into the specific bounds on map. I have one coordinate point which is ...
0
votes
1
answer
558
views
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"),
...
0
votes
1
answer
461
views
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 ...
1
vote
1
answer
701
views
Can I use other coordinate types to create a 2d index in MongoDB?
I am building a MongoDB database of property data in the Netherlands. I want to be able to perform geospatial queries on my dataset. Each document does not have longitude and latitude coordinates, but ...
1
vote
0
answers
134
views
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" : {
"...
0
votes
1
answer
234
views
MongoDB geospatial index on $center
Collection Schema
{
"_id" : ObjectId("5d3562bf1b48d90ea4b06a74"),
"name" : "19",
"location" : {
"type" : "Point",
"coordinates" : [
50.0480208,
30....
1
vote
1
answer
562
views
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 ...
0
votes
0
answers
224
views
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:
...
2
votes
0
answers
339
views
How to query Mongodb on Single Field with multiple ranges efficiently?
I am trying to build custom geospatial indexes using MongoDB's B-tree indexes, as I find Mongo's native implementation limiting for my own case. In order to fulfill my geospatial queries which will ...
1
vote
0
answers
504
views
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)
...
0
votes
1
answer
125
views
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....
0
votes
0
answers
357
views
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 ...
5
votes
0
answers
2k
views
How to do a bounding box query with MongoDB?
I can't seem to get a bounding box query working with MongoDB, that actually uses the spatial index.
Here's my indexes:
[
{
"v" : 2,
"key" : {
"_id" : 1
},
...
1
vote
1
answer
416
views
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')....
1
vote
1
answer
169
views
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 ...