Data type for latitude / longitude

1,129 views
Skip to first unread message

Alex Brown

unread,
Apr 12, 2012, 8:16:55 PM4/12/12
to mongoo...@googlegroups.com
Using mongoose, what type would be best for latitude / longitude?
I'm going to do geospatial indexing etc...

Victor Powell

unread,
Apr 13, 2012, 11:11:15 AM4/13/12
to mongoo...@googlegroups.com
I would think just Number or [Number] . To the best of my knowledge, there is no special type for geolocation data. For more information it my help to read this : http://www.mongodb.org/display/DOCS/Geospatial+Indexing#GeospatialIndexing-MultilocationDocuments

On Thu, Apr 12, 2012 at 8:16 PM, Alex Brown <al...@alexjamesbrown.com> wrote:
Using mongoose, what type would be best for latitude / longitude?
I'm going to do geospatial indexing etc...

--
http://mongoosejs.com
http://github.com/learnboost/mongoose
You received this message because you are subscribed to the Google
Groups "Mongoose Node.JS ORM" group.
To post to this group, send email to mongoo...@googlegroups.com
To unsubscribe from this group, send email to
mongoose-orm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mongoose-orm?hl=en

Aaron Heckmann

unread,
Apr 13, 2012, 11:41:19 AM4/13/12
to mongoo...@googlegroups.com
Use array syntax mentioned in the link. The object syntax isn't supported in mongoose.


On Thu, Apr 12, 2012 at 5:16 PM, Alex Brown <al...@alexjamesbrown.com> wrote:
Using mongoose, what type would be best for latitude / longitude?
I'm going to do geospatial indexing etc...

--
http://mongoosejs.com
http://github.com/learnboost/mongoose
You received this message because you are subscribed to the Google
Groups "Mongoose Node.JS ORM" group.
To post to this group, send email to mongoo...@googlegroups.com
To unsubscribe from this group, send email to
mongoose-orm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mongoose-orm?hl=en

Anthony Ettinger

unread,
Oct 29, 2013, 5:35:41 PM10/29/13
to mongoo...@googlegroups.com
Its my understanding that array values are swapped: [ lng, lat ] 

Is this true?

j...@team9.com.au

unread,
Oct 30, 2013, 10:01:15 PM10/30/13
to mongoo...@googlegroups.com
Absolutely, especially if you're using a 2dsphere index.

You should probably also be aware of this issue if you're working with 2dsphere indexed [lng, lat] points:

Anthony Ettinger

unread,
Oct 30, 2013, 11:39:08 PM10/30/13
to mongoo...@googlegroups.com
how does the other data type work?


--
Documentation - http://mongoosejs.com/
Plugins - http://plugins.mongoosejs.com/
Bug Reports - http://github.com/learnboost/mongoose
Production Examples - http://mongoosejs.tumblr.com/
StackOverflow - http://stackoverflow.com/questions/tagged/mongoose
Google Groups - https://groups.google.com/forum/?fromgroups#!forum/mongoose-orm
Twitter - https://twitter.com/mongoosejs
IRC - #mongoosejs
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Anthony Ettinger
http://about.me/anthony.ettinger
ant...@ettinger.name
+1 (831) 406-1123

Jed Watson

unread,
Oct 31, 2013, 12:02:27 AM10/31/13
to mongoo...@googlegroups.com
What do you mean by other data type?

You received this message because you are subscribed to a topic in the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongoose-orm/9yY3RdKmaDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongoose-orm...@googlegroups.com.

Anthony Ettinger

unread,
Oct 31, 2013, 12:03:11 AM10/31/13
to mongoo...@googlegroups.com
you said 2d, isn't there a 3d or something?
Reply all
Reply to author
Forward
0 new messages