Repository navigation
index geo payload - #366
Conversation
8322560 to
3be36bd
Compare
|
WDYT degarding splitting of |
|
@generall I agree with you sentiment, I will split the geohash functions from the geo indexing 👍 |
3be36bd to
dce84a7
Compare
8634f4a to
fec7d38
Compare
908eb0c to
257466a
Compare
214ae9d to
b8895be
Compare
| values_count | ||
| } else { | ||
| // between 0 and 1 (there is at least one payload per point) | ||
| let payload_per_point = total_points_count as f64 / self.payload_count as f64; |
There was a problem hiding this comment.
It should be called point_per_payload, isn't it?
| } else { | ||
| // between 0 and 1 (there is at least one payload per point) | ||
| let payload_per_point = total_points_count as f64 / self.payload_count as f64; | ||
| values_count.saturating_sub((values_count as f64 * payload_per_point) as usize) |
There was a problem hiding this comment.
That could be used as some approximation to expected value, but not min
| primary_clauses: vec![], | ||
| min, | ||
| exp: expected_count, | ||
| max: expected_count, |
There was a problem hiding this comment.
But max != expected in this case. For max we should guarantee, that it is impossible to match more than this amount of points with this query
| values_count.saturating_sub((values_count as f64 * payload_per_point) as usize) | ||
| }; | ||
| // don't overflow max number of points | ||
| let expected_count = total_points_count.min(values_count); |
| let top_left = GeoPoint { | ||
| lat: rectangle.max().x, | ||
| lon: rectangle.min().y, | ||
| lat: rectangle.max().y, |
There was a problem hiding this comment.
mapping x/y to lat/lon is so error prone 😞
| if n < 1.0 { | ||
| return 1.0; // By definition | ||
| } | ||
| (2. * PI * n).sqrt().ln() + n * (n / E).ln() |
There was a problem hiding this comment.
the std lib defines also TAU that we could use here
/// The full circle constant (τ)
///
/// Equal to 2π.
#[stable(feature = "tau_constant", since = "1.47.0")]
pub const TAU: f64 = 6.28318530717958647692528676655900577_f64;
This PR adds a new indexing scheme for geo payloads #362
Notes:
geo_indexfile has been renamed togeo_hashto make space for the newPersistedGeoMapIndex