ee.FeatureCollection.distance

इससे DOUBLE इमेज बनती है. इसमें हर पिक्सल, कलेक्शन में मौजूद सबसे नज़दीकी पॉइंट, LineString या पॉलीगोनल बाउंड्री से पिक्सल सेंटर की दूरी को मीटर में दिखाता है. ध्यान दें कि पॉलीगॉन के अंदरूनी हिस्सों में भी दूरी मापी जाती है. ज्यामिति से 'searchRadius' मीटर की दूरी पर मौजूद पिक्सल को मास्क कर दिया जाएगा.

दूरी की गणना गोले के आधार पर की जाती है. इसलिए, हर पिक्सल और सबसे नज़दीकी ज्यामिति के बीच अक्षांश के अंतर के हिसाब से, थोड़ी गड़बड़ी होती है.

इस्तेमालरिटर्न
FeatureCollection.distance(searchRadius, maxError)इमेज
आर्ग्यूमेंटटाइपविवरण
यह: featuresFeatureCollectionसुविधाओं का ऐसा कलेक्शन जिससे पिक्सल की दूरी का हिसाब लगाने के लिए इस्तेमाल की गई सुविधाएं मिलती हैं.
searchRadiusफ़्लोट, डिफ़ॉल्ट: 100000किनारों का पता लगाने के लिए, हर पिक्सल से ज़्यादा से ज़्यादा दूरी (मीटर में). इस दूरी के अंदर किनारों के मौजूद न होने पर, पिक्सल को मास्क कर दिया जाएगा.
maxErrorफ़्लोट, डिफ़ॉल्ट: 100मीटर में ज़्यादा से ज़्यादा रीप्रोजेक्शन गड़बड़ी. इसका इस्तेमाल सिर्फ़ तब किया जाता है, जब इनपुट पॉलीलाइन को रीप्रोजेक्ट करने की ज़रूरत होती है. अगर '0' दिया गया है, तो प्रोजेक्शन की ज़रूरत होने पर यह कार्रवाई पूरी नहीं होगी.

उदाहरण

कोड एडिटर (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

// Generate an image of distance to nearest power plant.
var distance = fc.distance({searchRadius: 50000, maxError: 50});

// Display the image and FeatureCollection on the map.
Map.setCenter(4.56, 50.78, 7);
Map.addLayer(distance, {max: 50000}, 'Distance to power plants');
Map.addLayer(fc, {color: 'red'}, 'Power plants');

Python सेटअप करना

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

import ee
import geemap.core as geemap

Colab (Python)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"'
)

# Generate an image of distance to nearest power plant.
distance = fc.distance(searchRadius=50000, maxError=50)

# Display the image and FeatureCollection on the map.
m = geemap.Map()
m.set_center(4.56, 50.78, 7)
m.add_layer(distance, {'max': 50000}, 'Distance to power plants')
m.add_layer(fc, {'color': 'red'}, 'Power plants')
m