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

Empty features #1487

Closed
damiles opened this issue Jul 12, 2021 · 2 comments
Closed

Empty features #1487

damiles opened this issue Jul 12, 2021 · 2 comments

Comments

@damiles
Copy link

damiles commented Jul 12, 2021

If an empty geojson is added with empty features like:

{"type":"FeatureCollection","features":[]}

an error is reach:

    566         they are functions returning dictionaries.
    567         """
--> 568         test_feature = self.data['features'][0]
    569         if not callable(func) or not isinstance(func(test_feature), dict):
    570             raise ValueError('{} should be a function that accepts items from '

IndexError: list index out of range

A simple check will avoid this issue.

test_feature = self.data['features'][0]

@Conengmo
Copy link
Member

Looks like currently an empty features is not allowed. I don't see the point of allowing those. The error message could be better though.

@Conengmo
Copy link
Member

This was fixed in #1213. And this issue is a duplicate of #1212.

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

2 participants