Anúncio: todos os projetos não comerciais registrados para usar o Earth Engine antes de
15 de abril de 2025 precisam
verificar a qualificação não comercial para manter o acesso ao Earth Engine.
ee.initialize
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Inicialize a biblioteca. Se isso não tiver sido chamado quando um construtor de objeto for usado, ele será chamado nesse momento. Se isso for chamado uma segunda vez com um baseurl ou tileurl diferente, não será feita uma desinicialização, por exemplo, dos algoritmos carregados anteriormente, mas eles serão substituídos e apontarão para servidores alternativos.
Se initialize() for chamado primeiro no modo assíncrono (transmitindo um callback de sucesso), todas as futuras chamadas no modo assíncrono vão adicionar os callbacks a uma fila, e todos eles serão executados juntos.
Se uma chamada de modo síncrono for feita após qualquer número de chamadas assíncronas, ela será bloqueada e executará todos os callbacks fornecidos anteriormente antes de retornar.
Na maioria dos casos, um token de autorização precisa ser definido antes da inicialização da biblioteca, com ee.data.authorize() ou ee.data.setAuthToken().
Em Python, esse método é chamado ee.Initialize, com um I maiúsculo. Alguns parâmetros são diferentes entre JavaScript e Python. Além de opt_url e project abaixo, o Python também oferece suporte a: credentials (um objeto google.oauth2.Credentials ou "persistent" para usar credenciais armazenadas, que é o padrão); http_transport (um cliente httplib2.Http).
Uso | Retorna |
---|
ee.initialize(baseurl, tileurl, successCallback, errorCallback, xsrfToken, project) | |
Argumento | Tipo | Detalhes |
---|
baseurl | String, opcional | O endpoint da API REST do Earth Engine.
(Nome do argumento Python: opt_url) |
tileurl | String, opcional | O endpoint de bloco REST do Earth Engine. É opcional e o padrão é "baseurl". (somente JavaScript) |
successCallback | Função, opcional | Um callback opcional a ser invocado quando a inicialização for bem-sucedida. Se não for fornecido, a inicialização será feita de forma síncrona. (somente JavaScript) |
errorCallback | Função, opcional | Um callback opcional a ser invocado com um erro se a inicialização falhar. (somente JavaScript) |
xsrfToken | String, opcional | Uma string a ser transmitida no parâmetro "xsrfToken" das solicitações XHR da API EE. (somente JavaScript) |
project | String, opcional | ID ou número do projeto do cliente opcional a ser usado ao fazer chamadas de API. (Nome do argumento Python: project) |
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-26 UTC.
[null,null,["Última atualização 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) |"]]