ee.Geometry.LinearRing.cutLines
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Converts LineString, MultiLineString, and LinearRing geometries into a MultiLineString by cutting them into parts no longer than the given distance along their length. כל שאר סוגי הגאומטריה יומרו ל-MultiLineString ריק.
שימוש | החזרות |
---|
LinearRing.cutLines(distances, maxError, proj) | גיאומטריה |
ארגומנט | סוג | פרטים |
---|
זה: geometry | גיאומטריה | חיתוך הקווים של הצורה הגיאומטרית הזו. |
distances | רשימה | המרחקים לאורך כל LineString לחיתוך הקו לחלקים נפרדים, נמדדים ביחידות של ה-proj שצוין, או במטרים אם לא צוין proj. |
maxError | ErrorMargin, ברירת מחדל: null | הכמות המקסימלית של שגיאות שמותרות כשמבצעים הקרנה מחדש. |
proj | תחזית, ברירת מחדל: null | ההטלה של תוצאת המדידה והמרחק, או EPSG:4326 אם לא צוין ערך. |
דוגמאות
עורך הקוד (JavaScript)
// Define a LinearRing object.
var linearRing = ee.Geometry.LinearRing(
[[-122.091, 37.420],
[-122.085, 37.422],
[-122.080, 37.430]]);
// Apply the cutLines method to the LinearRing object.
var linearRingCutLines = linearRing.cutLines({'distances': [10, 100], 'maxError': 1});
// Print the result to the console.
print('linearRing.cutLines(...) =', linearRingCutLines);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(linearRing,
{'color': 'black'},
'Geometry [black]: linearRing');
Map.addLayer(linearRingCutLines,
{'color': 'red'},
'Result [red]: linearRing.cutLines');
הגדרת Python
מידע על Python API ועל שימוש ב-geemap
לפיתוח אינטראקטיבי מופיע בדף
Python Environment.
import ee
import geemap.core as geemap
Colab (Python)
# Define a LinearRing object.
linearring = ee.Geometry.LinearRing(
[[-122.091, 37.420], [-122.085, 37.422], [-122.080, 37.430]]
)
# Apply the cutLines method to the LinearRing object.
linearring_cut_lines = linearring.cutLines(distances=[10, 100], maxError=1)
# Print the result.
display('linearring.cutLines(...) =', linearring_cut_lines)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(linearring, {'color': 'black'}, 'Geometry [black]: linearring')
m.add_layer(
linearring_cut_lines, {'color': 'red'}, 'Result [red]: linearring.cutLines'
)
m
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[],["The `cutLines` method converts LineString, MultiLineString, and LinearRing geometries into a MultiLineString by dividing them into segments based on specified distances. It takes a list of `distances` to define cut points along each line, a `maxError` for reprojection tolerance, and an optional `proj` for projection information. Other geometry types are converted to an empty MultiLineString. The resulting geometry is displayed on a map with a specific color.\n"],null,[]]