ב-Earth Engine הוספנו
רמות מכסת שימוש לא מסחרי כדי להגן על משאבי מחשוב משותפים ולספק ביצועים מהימנים לכולם. בפרויקטים לא מסחריים נעשה שימוש במסלול Community כברירת מחדל, אבל אפשר לשנות את המסלול של הפרויקט בכל שלב.
Google משתמשת בטכנולוגיית AI כדי לתרגם תוכן לשפה המועדפת עליך. בתרגומים כאלו עשויות להיות שגיאות.
ee.Geometry.Rectangle.buffer
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הפונקציה מחזירה את הקלט שנוסף לו מאגר נתונים זמני לפי מרחק נתון. אם המרחק חיובי, הגיאומטריה מורחבת, ואם המרחק שלילי, הגיאומטריה מצטמצמת.
| שימוש | החזרות |
|---|
Rectangle.buffer(distance, maxError, proj) | גיאומטריה |
| ארגומנט | סוג | פרטים |
|---|
זה: geometry | גיאומטריה | הגיאומטריה שנוצרת לה מאגר. |
distance | מספר ממשי (float) | מרחק האזור, שיכול להיות שלילי. אם לא מציינים הקרנה, היחידה היא מטרים. אחרת, היחידה נמצאת במערכת הקואורדינטות של ההטלה. |
maxError | שולי שגיאה, ברירת מחדל: null | הכמות המקסימלית של שגיאות שמותרות כשמבצעים קירוב של מעגל החיץ וכל שינוי נדרש של ההטלה. אם לא מציינים ערך, ברירת המחדל היא 1% מהמרחק. |
proj | היטל, ברירת מחדל: null | אם מציינים היטל, המאגר יבוצע בהיטל הזה והמרחק יפורש כיחידות של מערכת הקואורדינטות של ההיטל הזה. אחרת, המרחק מפורש כמטרים והמאגר נוצר במערכת קואורדינטות כדורית. |
דוגמאות
Code Editor (JavaScript)
// Define a Rectangle object.
var rectangle = ee.Geometry.Rectangle(-122.09, 37.42, -122.08, 37.43);
// Apply the buffer method to the Rectangle object.
var rectangleBuffer = rectangle.buffer({'distance': 100});
// Print the result to the console.
print('rectangle.buffer(...) =', rectangleBuffer);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(rectangle,
{'color': 'black'},
'Geometry [black]: rectangle');
Map.addLayer(rectangleBuffer,
{'color': 'red'},
'Result [red]: rectangle.buffer');
הגדרה של Python
בדף
סביבת Python מפורט מידע על API בשפת Python ועל השימוש ב-geemap לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
# Define a Rectangle object.
rectangle = ee.Geometry.Rectangle(-122.09, 37.42, -122.08, 37.43)
# Apply the buffer method to the Rectangle object.
rectangle_buffer = rectangle.buffer(distance=100)
# Print the result.
display('rectangle.buffer(...) =', rectangle_buffer)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(rectangle, {'color': 'black'}, 'Geometry [black]: rectangle')
m.add_layer(
rectangle_buffer, {'color': 'red'}, 'Result [red]: rectangle.buffer'
)
m
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-10-14 (שעון UTC).
[null,null,["עדכון אחרון: 2026-10-14 (שעון UTC)."],[],["The `buffer` method expands or contracts a geometry by a specified distance. A positive distance expands, while a negative one contracts. The distance unit is meters by default or the projection's units if specified. The method accepts a `distance`, an optional `maxError` (defaulting to 1% of the distance), and an optional `proj` for the projection. It returns a new `Geometry`. The examples provided showcase this operation on a `Rectangle` geometry, increasing it's size.\n"]]