Skip to content

Conversation

@Hagellach37
Copy link
Member

No description provided.

center_x = feature.GetFieldAsDouble("center_x")
center_y = feature.GetFieldAsDouble("center_y")
groups[group_id_string]["center_points"].append([center_x, center_y])
except: # noqa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 raises an issue not to use bar except statements. If the error type is known it should be used instead. But I am not sure which error would be raised by GetFieldAsDouble if the key is not found.
Probably KeyError.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I also was not sure which error will be raised, since this will come from gdal/ogr and this is always a bit complicated

@Hagellach37 Hagellach37 merged commit b1db2bb into master Nov 6, 2020
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.

3 participants