Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Features in feature collection might have different properties names #2068

Closed
shaiabir opened this issue Jul 3, 2024 · 1 comment · Fixed by #2074
Closed

Features in feature collection might have different properties names #2068

shaiabir opened this issue Jul 3, 2024 · 1 comment · Fixed by #2074

Comments

@shaiabir
Copy link

shaiabir commented Jul 3, 2024

geemap/geemap/common.py

Lines 9136 to 9139 in d58a242

property_names = ee_object.first().propertyNames().sort().getInfo()
if remove_geom:
data = ee_object.map(
lambda f: ee.Feature(None, f.toDictionary(property_names))

I suggest not to limit the columns of the dataframe to be the properties of the first feature only, but to allow to have each feature with its original properties names:
I suggest:

            data = ee_object.map(
                lambda f: ee.Feature(None, f.toDictionary(f.propertyNames().sort()))
            )
@giswqs
Copy link
Member

giswqs commented Jul 3, 2024

This is not a very common user case. If every feature has different properties, it will result in a bloated data frame with a lot of columns.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants