Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large radius query returns different results for small amounts either side of the meridian #227

Open
tteggel opened this issue Jun 22, 2021 · 1 comment

Comments

@tteggel
Copy link

tteggel commented Jun 22, 2021

In investigating some strange behaviour in a map rendered from geofire I noticed this following strange behaviour.

For a query with a radius equal or over 8,587,850, at the equator, moving the longitude a tiny amount to the other side of the meridian returns a different set of results. For higher/lower latitudes the critical radius is lower e.g. at 55 degrees latitude a radius of 3,342,783 passes and 3,342,784 fails. I wrote the below test case to demonstrate the problem.

I'm out of time to investigate this further as we're using a different approach but I hope this partial write-up might be useful to the team.

it('Query bounds from geohashQueryBounds must work across the meridian with big radius', () => {
    const centerLat = 0;
    const centerLong = 0.00000001;
    const radius = 8_587_850; // fails
    // const radius = 8_587_849; // passes
    const queriesEast = geohashQueryBounds([centerLat, centerLong], radius);
    const queriesWest = geohashQueryBounds([centerLat, -centerLong], radius);
    expect(queriesEast).to.have.deep.members(queriesWest);
});
@ediaStudio
Copy link

Hello, any solution about this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants