【问题标题】:Convert earth engine feature collection to a dataframe in python将地球引擎特征集合转换为python中的数据框
【发布时间】:2022-07-03 19:05:36
【问题描述】:

我在我的 Earth Engine 帐户中上传了一个 shapefile 作为功能集合,现在我需要在 jupyter 实验室笔记本中使用它。

我使用以下代码导入集合:

df = ee.FeatureCollection('users/my_user/my_shape')

但现在我不知道如何转换为数据框。有什么想法吗?

【问题讨论】:

    标签: python java collections google-earth-engine


    【解决方案1】:

    您应该可以使用geemap 执行此操作。

    gdf = geemap.ee_to_pandas(df)

    【讨论】:

      【解决方案2】:

      特征集合到熊猫数据框:

      nested_list = results.reduceColumns(ee.Reducer.toList(len(column_df)), column_df).values().get(0)
      data = nested_list.getInfo()
      data
      
      # dont forget we need to call the callback method "getInfo" to retrieve the data
      df = pd.DataFrame(data, columns=column_df)
      # we obtain the data frame as per our demand
      df
      

      您可以访问博客文章: https://kaflekrishna.com.np/blog-detail/extraction-raster-values-point-samples-google-earth-engine-gee/

      在步骤 11 中找到:“方法 1:特征集合到 pandas 数据框”,然后您可以将特征集合转换为 pandas 数据框,您会发现我遇到并使用此示例的整个案例场景。

      【讨论】:

        猜你喜欢
        • 2021-06-29
        • 2021-10-29
        • 2020-08-01
        • 2017-10-07
        • 2021-07-22
        • 1970-01-01
        • 1970-01-01
        • 2021-11-29
        • 2021-04-28
        相关资源
        最近更新 更多