Skip to content

Handle non-parseable values in attributes #5

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

Merged
merged 1 commit into from
Feb 8, 2016

Conversation

atlefren
Copy link

@atlefren atlefren commented Aug 7, 2014

For shapefiles with values that cannot be cast to float or int in the attributes the lib dies with a ValueError. I think it's cleaner to then set the value to None. This is consistent with how QGIS handles these shapefiles and should not cause much trouble.

If this causes trouble it's possible to add a flag to either die on error or set to None.

@atlefren atlefren changed the title handle wrong values in attrubutes Handle non-parseable values in attributes Aug 7, 2014
@GeospatialPython
Copy link
Owner

Just now getting to this. I need to think about it some more. On the one hand, I love it when things just work and a library doesn't bother me with minutia. But on the other hand, I could also see this change driving somebody nuts trying to figure out why a value is returned as None. The comprise might be the flag you mentioned for "strict" handling or similar. Definitely worth more discussion.

GeospatialPython added a commit that referenced this pull request Feb 8, 2016
Handle non-parseable values in attributes
@GeospatialPython GeospatialPython merged commit c593c15 into GeospatialPython:master Feb 8, 2016
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 this pull request may close these issues.

2 participants