ee.FeatureCollection.getInfo

AJAX 呼び出しを介して、このコレクションに関する既知のすべての情報を返す命令型関数。

フィールドに次のものを含むコレクションの説明を返します。

- features: コレクション内のフィーチャーに関するメタデータを含むリスト。

- properties: コレクションのメタデータ プロパティを含むオプションのディクショナリ。

用途戻り値
FeatureCollection.getInfo(callback)FeatureCollectionDescription|Object
引数タイプ詳細
this: featurecollectionFeatureCollectionFeatureCollection インスタンス。
callback関数、省略可省略可能なコールバック。指定しない場合、呼び出しは同期的に行われます。指定した場合、成功した場合は最初のパラメータ、失敗した場合は 2 番目のパラメータで呼び出されます。

コードエディタ(JavaScript)

/**
 * WARNING: this function transfers data from Earth Engine servers to the
 * client. Doing so can negatively affect request processing and client
 * performance. Server-side options should be used whenever possible.
 * Learn more about the distinction between server and client:
 * https://developers.google.com/earth-engine/guides/client_server
 */

// A server-side ee.FeatureCollection of power plants in Belgium.
var fcServer = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

// Use getInfo to transfer server-side feature collection to the client. The
// result is an object.
var fcClient = fcServer.getInfo();
print('Client-side feature collection is an object', typeof fcClient);
print('Feature collection object keys', Object.keys(fcClient));
print('Array of features', fcClient.features);
print('Properties of first feature', fcClient.features[0].properties);

Python の設定

Python API と geemap を使用したインタラクティブな開発については、 Python 環境 のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

"""WARNING: this function transfers data from Earth Engine servers to the
client. Doing so can negatively affect request processing and client
performance. Server-side options should be used whenever possible.
Learn more about the distinction between server and client:
https://developers.google.com/earth-engine/guides/client_server
"""

# A server-side ee.FeatureCollection of power plants in Belgium.
fc_server = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

# Use getInfo to transfer server-side feature collection to the client. The
# result is an object.
fc_client = fc_server.getInfo()
display('Client-side feature collection is a dictionary:', type(fc_client))
display('Feature collection dictionary keys:', fc_client.keys())
display('Array of features:', fc_client['features'])
display('Properties of first feature:', fc_client['features'][0]['properties'])