お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
ee.initialize
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ライブラリを初期化します。オブジェクト コンストラクタが使用されるまでに呼び出されていない場合は、その時点で呼び出されます。異なる baseurl または tileurl で 2 回目に呼び出された場合、以前に読み込まれたアルゴリズムなどの初期化解除は行われませんが、それらは上書きされ、代替サーバーを指すようになります。
initialize() が非同期モードで最初に呼び出された場合(成功コールバックを渡すことによって)、以降の非同期モードの呼び出しでは、コールバックがキューに追加され、すべてのコールバックがまとめて実行されます。
同期モードの呼び出しが非同期呼び出しの後に実行されると、ブロックされ、以前に指定されたすべてのコールバックが実行されてから戻ります。
ほとんどの場合、ライブラリを初期化する前に、ee.data.authorize() または ee.data.setAuthToken() を使用して認証トークンを設定する必要があります。
Python では、このメソッドは ee.Initialize という名前で、I は大文字です。一部のパラメータは JavaScript と Python で異なります。Python では、以下の opt_url と project に加えて、credentials(google.oauth2.Credentials オブジェクト、または保存された認証情報を使用するための「persistent」(デフォルト))、http_transport(httplib2.Http クライアント)もサポートされています。
用途 | 戻り値 |
---|
ee.initialize(baseurl, tileurl, successCallback, errorCallback, xsrfToken, project) | |
引数 | タイプ | 詳細 |
---|
baseurl | 文字列、省略可 | Earth Engine REST API エンドポイント。(Python 引数名: opt_url) |
tileurl | 文字列、省略可 | Earth Engine REST タイル エンドポイント。これは省略可能で、デフォルトは baseurl です。(JavaScript のみ) |
successCallback | 関数(省略可) | 初期化が成功したときに呼び出されるコールバック(省略可)。指定されていない場合、初期化は同期的に行われます。(JavaScript のみ) |
errorCallback | 関数(省略可) | 初期化が失敗した場合にエラーとともに呼び出されるコールバック(省略可)。(JavaScript のみ) |
xsrfToken | 文字列、省略可 | EE API XHR の「xsrfToken」パラメータに渡す文字列。(JavaScript のみ) |
project | 文字列、省略可 | API 呼び出しを行うときに使用するクライアント プロジェクト ID または番号(省略可)。(Python 引数名: project) |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eThe \u003ccode\u003eee.initialize()\u003c/code\u003e function initializes the Earth Engine library, setting the API endpoint and optional tile server.\u003c/p\u003e\n"],["\u003cp\u003eInitialization can be performed synchronously or asynchronously with success and error callbacks.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization should typically be handled before initialization using \u003ccode\u003eee.data.authorize()\u003c/code\u003e or \u003ccode\u003eee.data.setAuthToken()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eee.initialize()\u003c/code\u003e offers parameters for customization, like base URL, tile URL, and project ID.\u003c/p\u003e\n"],["\u003cp\u003eThe Python equivalent is \u003ccode\u003eee.Initialize()\u003c/code\u003e, with minor parameter differences compared to JavaScript.\u003c/p\u003e\n"]]],[],null,["# ee.initialize\n\n\u003cbr /\u003e\n\nInitialize the library. If this hasn't been called by the time any object constructor is used, it will be called then. If this is called a second time with a different baseurl or tileurl, this doesn't do an un-initialization of e.g.: the previously loaded Algorithms, but will overwrite them and let point at alternate servers.\n\n\u003cbr /\u003e\n\nIf initialize() is first called in asynchronous mode (by passing a success callback), any future asynchronous mode calls will add their callbacks to a queue and all the callbacks will be run together.\n\nIf a synchronous mode call is made after any number of asynchronous calls, it will block and execute all the previously supplied callbacks before returning.\n\nIn most cases, an authorization token should be set before the library is initialized, either with ee.data.authorize() or ee.data.setAuthToken().\n\nIn Python, this method is named ee.Initialize, with a capital I. Note that some parameters differ between JavaScript and Python. In addition to opt_url and project below, Python also supports: credentials - a google.oauth2.Credentials object or 'persistent' to use stored credentials (the default); http_transport - a httplib2.Http client.\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------------------------------|---------|\n| `ee.initialize(`*baseurl* `, `*tileurl* `, `*successCallback* `, `*errorCallback* `, `*xsrfToken* `, `*project*`)` | |\n\n| Argument | Type | Details |\n|-------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `baseurl` | String, optional | The Earth Engine REST API endpoint. (Python argument name: opt_url) |\n| `tileurl` | String, optional | The Earth Engine REST tile endpoint, this is optional and defaults to baseurl. (JavaScript only) |\n| `successCallback` | Function, optional | An optional callback to be invoked when the initialization is successful. If not provided, the initialization is done synchronously. (JavaScript only) |\n| `errorCallback` | Function, optional | An optional callback to be invoked with an error if the initialization fails. (JavaScript only) |\n| `xsrfToken` | String, optional | A string to pass in the \"xsrfToken\" parameter of EE API XHRs. (JavaScript only) |\n| `project` | String, optional | Optional client project ID or number to use when making API calls. (Python argument name: project) |"]]