algorithm - geointersects - Using MongoDB's Geospacial index with 3d data



mongodb geohash (1)

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 leveraging the Geospacial Index to do similar queries on 3-space data?

https://ffff65535.com


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





geospatial