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

Feature::field should return Result<Option<FieldValue>> #132

Closed
dead10ck opened this issue Jan 3, 2021 · 0 comments · Fixed by #134
Closed

Feature::field should return Result<Option<FieldValue>> #132

dead10ck opened this issue Jan 3, 2021 · 0 comments · Fixed by #134

Comments

@dead10ck
Copy link
Contributor

dead10ck commented Jan 3, 2021

Currently, Feature::field returns Result<FieldValue>, but fields can be null. When this is the case, the default value for the FieldValue variant is returned. This makes it difficult to distinguish e.g. a legitimate Integer 0 value from the absence of a value.

I am not very familiar with the GDAL lib, but just taking a quick one through, it looks like maybe the OGR_F_IsFieldNull function could be used to see if a field is null first, and if so, return None.

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

Successfully merging a pull request may close this issue.

1 participant