Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-74983

Divergence in sin/cos functions across platforms can result in different 2dsphere index keys for Geo Points

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • ALL
    • QE 2023-05-15, QE 2023-05-29

      When generating a 2dsphere index key for a GeoJSON point, one of the first steps is to convert the lat/long coordinates of said point to a 3D point using the sine and cosine functions. The implementation of these functions can differ slightly across the various platforms that MongoDB can run on, which means that we can wind up with slightly different 3D points across platforms. In practice, this doesn't result in different S2 cell ids (i.e. different 2d sphere index keys), however, in some rare cases when the original point is near an S2Cell boundary, these different implementations can produce 3D points that fall on either side of the boundary and produce different index keys.

            mihai.andrei@mongodb.com Mihai Andrei
            dan.larkin-york@mongodb.com Dan Larkin-York
            0 Vote for this issue
            18 Start watching this issue