सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए,
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
ee.Geometry.MultiLineString.cutLines
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ंक्शन, LineString, MultiLineString, और LinearRing ज्यामिति को MultiLineString में बदलता है. इसके लिए, वह उन्हें उनकी लंबाई के हिसाब से तय की गई दूरी से ज़्यादा नहीं काटता. अन्य सभी ज्यामिति टाइप को खाली MultiLineString में बदल दिया जाएगा.
इस्तेमाल | रिटर्न |
---|
MultiLineString.cutLines(distances, maxError, proj) | ज्यामिति |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: geometry | ज्यामिति | इस ज्यामिति की लाइनों को काटता है. |
distances | सूची | हर LineString के साथ दूरियां, ताकि लाइन को अलग-अलग हिस्सों में काटा जा सके. इन्हें दिए गए प्रोज़ की इकाइयों या मीटर में मापा जाता है. अगर प्रोज़ के बारे में नहीं बताया गया है, तो इन्हें मीटर में मापा जाता है. |
maxError | ErrorMargin, डिफ़ॉल्ट: null | ज़रूरी रीप्रोजेक्शन करते समय, ज़्यादा से ज़्यादा कितनी गड़बड़ी हो सकती है. |
proj | प्रोजेक्शन, डिफ़ॉल्ट: null | नतीजे और दूरी के मेज़रमेंट का प्रोजेक्शन या अगर यह तय नहीं किया गया है, तो EPSG:4326. |
उदाहरण
कोड एडिटर (JavaScript)
// Define a MultiLineString object.
var multiLineString = ee.Geometry.MultiLineString(
[[[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
[[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]]]);
// Apply the cutLines method to the MultiLineString object.
var multiLineStringCutLines = multiLineString.cutLines({'distances': [10, 100], 'maxError': 1});
// Print the result to the console.
print('multiLineString.cutLines(...) =', multiLineStringCutLines);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(multiLineString,
{'color': 'black'},
'Geometry [black]: multiLineString');
Map.addLayer(multiLineStringCutLines,
{'color': 'red'},
'Result [red]: multiLineString.cutLines');
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Define a MultiLineString object.
multilinestring = ee.Geometry.MultiLineString([
[[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
[[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]],
])
# Apply the cutLines method to the MultiLineString object.
multilinestring_cut_lines = multilinestring.cutLines(
distances=[10, 100], maxError=1
)
# Print the result.
display('multilinestring.cutLines(...) =', multilinestring_cut_lines)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(
multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring'
)
m.add_layer(
multilinestring_cut_lines,
{'color': 'red'},
'Result [red]: multilinestring.cutLines',
)
m
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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, measured in units of the given `proj` or meters by default. It has a `maxError` parameter that sets a tolerance for reprojection error. Other geometry types will return an empty MultiLineString. The outputs are shown with JavaScript and Python code.\n"],null,[]]