开发者

Using MongoDB's Geospacial index with 3d data

I have a set of documents each of which contain a point in 3-space stored in a MongoDB collection. MongoDB currently has Geospatial Indexes only for 2-space. Is there a way of lev开发者_JAVA百科eraging the Geospacial Index to do similar queries on 3-space data?


You could kludge it by compressing one of the dimensions, but you would lose half your precision.

Say if they were 64 bit keys and you wanted to store three 32 bit coordinates: [(x << 32) + y, z]

Heck, you can even interleave three and store it in one key:

xxx

yyy

zzz

xyzxyzyz

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜