ee.Geometry.cutLines

यह फ़ंक्शन, LineString, MultiLineString, और LinearRing ज्यामिति को MultiLineString में बदलता है. इसके लिए, वह उन्हें उनकी लंबाई के हिसाब से तय की गई दूरी से ज़्यादा नहीं काटता. अन्य सभी ज्यामिति टाइप को खाली MultiLineString में बदल दिया जाएगा.

इस्तेमालरिटर्न
Geometry.cutLines(distances, maxError, proj)ज्यामिति
आर्ग्यूमेंटटाइपविवरण
यह: geometryज्यामितिइस ज्यामिति की लाइनों को काटता है.
distancesसूचीहर LineString के साथ दूरियां, ताकि लाइन को अलग-अलग हिस्सों में काटा जा सके. इन्हें दिए गए प्रोज़ की इकाइयों या मीटर में मापा जाता है. अगर प्रोज़ के बारे में नहीं बताया गया है, तो इन्हें मीटर में मापा जाता है.
maxErrorErrorMargin, डिफ़ॉल्ट: nullज़रूरी रीप्रोजेक्शन करते समय, ज़्यादा से ज़्यादा कितनी गड़बड़ी हो सकती है.
projप्रोजेक्शन, डिफ़ॉल्ट: nullनतीजे और दूरी के मेज़रमेंट का प्रोजेक्शन या अगर यह तय नहीं किया गया है, तो EPSG:4326.

उदाहरण

कोड एडिटर (JavaScript)

// Define a Geometry object.
var geometry = ee.Geometry({
  'type': 'Polygon',
  'coordinates':
    [[[-122.081, 37.417],
      [-122.086, 37.421],
      [-122.084, 37.418],
      [-122.089, 37.416]]]
});

// Apply the cutLines method to the Geometry object.
var geometryCutLines = geometry.cutLines({'distances': [10, 100], 'maxError': 1});

// Print the result to the console.
print('geometry.cutLines(...) =', geometryCutLines);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(geometry,
             {'color': 'black'},
             'Geometry [black]: geometry');
Map.addLayer(geometryCutLines,
             {'color': 'red'},
             'Result [red]: geometry.cutLines');

Python सेटअप करना

Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, Python एनवायरमेंट पेज देखें.

import ee
import geemap.core as geemap

Colab (Python)

# Define a Geometry object.
geometry = ee.Geometry({
    'type': 'Polygon',
    'coordinates': [[
        [-122.081, 37.417],
        [-122.086, 37.421],
        [-122.084, 37.418],
        [-122.089, 37.416],
    ]],
})

# Apply the cutLines method to the Geometry object.
geometry_cut_lines = geometry.cutLines(distances=[10, 100], maxError=1)

# Print the result.
display('geometry.cutLines(...) =', geometry_cut_lines)

# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(geometry, {'color': 'black'}, 'Geometry [black]: geometry')
m.add_layer(
    geometry_cut_lines, {'color': 'red'}, 'Result [red]: geometry.cutLines'
)
m