ee.FeatureCollection.getDownloadURL

ダウンロード URL を取得します。URL にアクセスすると、FeatureCollection が複数の形式のいずれかでダウンロードされます。

コールバックが指定されている場合は、ダウンロード URL を返します。指定されていない場合は、undefined を返します。

用途戻り値
FeatureCollection.getDownloadURL(format, selectors, filename, callback)Object|String
引数タイプ詳細
これ: featurecollectionFeatureCollectionFeatureCollection インスタンス。
format文字列、省略可ダウンロードの形式(「csv」、「json」、「geojson」、「kml」、「kmz」のいずれか)。「json」は GeoJSON を出力します。指定しない場合、デフォルトは「csv」です。
selectorsList<String>|String(省略可)ダウンロードする属性を選択するために使用される特徴プロパティ名。指定しない場合は、すべてのプロパティが含まれます。
filename文字列、省略可ダウンロードするファイルの名前。デフォルトで拡張子が追加されます。指定しない場合、デフォルトは「table」です。
callback関数(省略可)オプションのコールバック。指定しない場合、呼び出しは同期的に行われます。

コードエディタ(JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
            .filter('country_lg == "Belgium"');

// Get a download URL for the FeatureCollection.
var downloadUrl = fc.getDownloadURL({
  format: 'CSV',
  selectors: ['capacitymw', 'fuel1'],
  filename: 'belgian_power_plants'
});
print('URL for downloading FeatureCollection as CSV', downloadUrl);

Python の設定

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

import ee
import geemap.core as geemap

Colab(Python)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

# Get a download URL for the FeatureCollection.
download_url = fc.getDownloadURL(**{
  'filetype': 'CSV',
  'selectors': ['capacitymw', 'fuel1'],
  'filename': 'belgian_power_plants',
})
print('URL for downloading FeatureCollection as CSV:', download_url)