mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
So in the earlier PR to segmentize the given geography query with 500km of segment length we were deriving the segment length for 2d using this strategy: 1- 2d distance of (0,0 to 1,1) => 1.41 2- 2dsphere distance of (0, 0 to 1, 1) =>156.9Km So the segment length for 2d becomes => ( 500 ) / (157/1.41) -> ~4.41 But this is only true if the 2d bounds are similar to earth coordinates and will start taking time when query boxes are bigger than earth bounds. So in this PR I approximately scale up the segment length based on the size of the 2d region. So that segmentize should work relative to the given size Related work items: #2894618