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

IsValid returns false for valid value (4.0.0) #111

Open
autori-toni opened this issue Apr 28, 2023 · 4 comments
Open

IsValid returns false for valid value (4.0.0) #111

autori-toni opened this issue Apr 28, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@autori-toni
Copy link

autori-toni commented Apr 28, 2023

I've run into problem where seemingly valid index created with FromPoint-method is deemed invalid by the IsValid.

var point = new Point(24.57011413572222, 60.191627502416665) { SRID = 4326 };
var h3Index = H3Index.FromPoint(point, 15);
var index = h3Index.IsValid; // => false

The problem exists only on version 4.0.0, same point is returned as "valid" index by the previous version 3.7.2.1.

The validation seems to fail at last line where leading zeros are checked.

@pocketken
Copy link
Owner

I've run into problem where seemingly valid index created with FromPoint-method is deemed invalid by the IsValid.

var point = new Point(24.57011413572222, 60.191627502416665) { SRID = 4326 };
var h3Index = H3Index.FromPoint(point, 15);
var index = h3Index.IsValid; // => false

The problem exists only on version 4.0.0, same point is returned as "valid" index by the previous version 3.7.2.1.

The validation seems to fail at last line where leading zeros are checked.

First off apologies for the late reply, notifications in GH were not working for some reason.

Are you using anything prior to dotnet 5? There's a bug in the LeadingNonZero method in the "polyfilled" versions I had in place for this release; it should be fixed in the next one once I finally get a few minutes to spend a bit of time catching up on this project. If you want you can try checking out the dev/km/rel-4.1.0 branch and let me know if you can still reproduce the issue.

I'll add this as a test case anyway just in case.

@pocketken pocketken added the bug Something isn't working label May 10, 2023
@pocketken
Copy link
Owner

Nope; still a bug in the latest stuff. Will take a look.

@jrgcubano
Copy link

jrgcubano commented Jan 12, 2024

@pocketken Hello. Were you able to fix the bug? I was upgrading our projects to NET8 and was going to upgrade this library.

@pocketken
Copy link
Owner

Hi @jrgcubano, unfortunately not yet. I just haven't had any free time recently, so I only got as far as some basic debugging. I'm not quite sure when I will be able to look at it, as it seems like as soon as one work project ends 3 more start. I am happy to accept PRs, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants