gee-community/geemap

Features in feature collection might have different properties names

Closed this issue · 1 comments

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()))
            )

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.