ee.initialize
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מאתחלים את הספרייה. אם הפונקציה הזו לא נקראה עד לשימוש בבונה אובייקט כלשהו, היא תיקרא אז. אם הפונקציה הזו נקראת בפעם השנייה עם baseurl או tileurl שונים, היא לא מבטלת את ההפעלה של האלגוריתמים שנטענו קודם, אלא מחליפה אותם ומאפשרת להפנות לשרתים חלופיים.
אם הפונקציה initialize() מופעלת קודם במצב אסינכרוני (על ידי העברת קריאה חוזרת להצלחה), כל הקריאות העתידיות במצב אסינכרוני יוסיפו את הקריאות החוזרות שלהן לתור, וכל הקריאות החוזרות יופעלו יחד.
אם מתבצעת קריאה במצב סינכרוני אחרי מספר כלשהו של קריאות אסינכרוניות, היא תיחסם ותבצע את כל הקריאות החוזרות שסופקו קודם לפני שהיא תחזיר ערך.
ברוב המקרים, צריך להגדיר אסימון הרשאה לפני שמפעילים את הספריה, באמצעות ee.data.authorize() או ee.data.setAuthToken().
ב-Python, השם של השיטה הזו הוא ee.Initialize, עם I גדולה. שימו לב שיש הבדלים בין פרמטרים מסוימים ב-JavaScript וב-Python. בנוסף ל-opt_url ול-project שמופיעים למטה, Python תומך גם ב: 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 | מחרוזת, אופציונלי | מחרוזת להעברה בפרמטר xsrfToken של בקשות XHR של EE API. (JavaScript בלבד) |
project | מחרוזת, אופציונלי | מזהה או מספר פרויקט לקוח אופציונליים לשימוש כשמבצעים קריאות ל-API. (שם הארגומנט ב-Python: project) |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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) |"]]