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

Item not found #1

Closed
SebastianStehle opened this issue May 20, 2015 · 5 comments
Closed

Item not found #1

SebastianStehle opened this issue May 20, 2015 · 5 comments

Comments

@SebastianStehle
Copy link

Hi,
I have a dataset of 7600 items and I make a query to get the 40 nearest members but one of the expected results is missing. Is there any known bug? If you have time to have a look I can provide the dataset.

Sebastian

@codeandcats
Copy link
Owner

Hi Sebastian,

If you shoot me your dataset I'll check it out. I'll email you shortly.

Cheers,
Ben

@RobThree
Copy link
Collaborator

@SebastianStehle Not to be a meddler: I would start with trimming the dataset to, say, 41 or 45 items (all 40 expected ones and then one or a few more) and check to see if it still doesn't return the expected items. If the problem is still present the dataset would at least be small enough to be posted here so others could have a crack at it too. You could even probably make a testcase with maybe 3 or 10 items that reproduces and demonstrates the same problem and then post it here.

Don't get me wrong; I think it's awesome @codeandcats is willing to have a look at your data. All I'm trying to point out is that if you'd be able to post the data here as a 'testcase' (unittest if you will), as opposed to exchanging stuff via e-mail, others (like me) could also have a look at it. That way not all the weight would be on @codeandcats' shoulders 😉 Yay Open Source! 😛 Also, other people possibly experiencing the same problem might pitch in when the see your data/testcase and may contribute more alike examples or maybe even a solution / PR.

@codeandcats
Copy link
Owner

Hehe thanks @RobThree, I appreciate and agree with your sentiments though I had some free time tonight so didn't mind having a quick look. :)

I wrote a short LinqPad query simply ordering the dataset by distance and it seems that the item in question isn't within the nearest 50 of the specified point. Just getting @SebastianStehle to review my code and confirm now..

@codeandcats
Copy link
Owner

Update:

I wrote a small script to test using simple math that the id was not in the nearest 50. However Sebastian was getting different results running the script. It seems float.Parse was interpretating commas as thousand separators/decimal points differently between us. Once I fixed that bug in the script, it does appear that the item is within the nearest 50 using simple math, but isn't according to the tree.

I've asked Sebastian to add a unit test and send me a pull request so we can get more eyes across this. :)

@codeandcats
Copy link
Owner

Closing this issue. It turned out that the data contained duplicate coordinates, so the point in question simply didn't get added to the tree.
I've created a new enhancement allowing duplicates within the tree.

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

3 participants