ध्यान दें कि दूरी, पॉलीगॉन के अंदर भी मेज़र की जाती है. ज्यामिति के 'searchRadius' मीटर के दायरे में न आने वाले पिक्सल को मास्क कर दिया जाएगा.
दूरी की गणना, गोले पर की जाती है. इसलिए, हर पिक्सल और सबसे नज़दीकी ज्यामिति के बीच अक्षांश के अंतर के हिसाब से, थोड़ी गड़बड़ी हो सकती है.
| इस्तेमाल | रिटर्न |
|---|---|
FeatureCollection.distance(searchRadius, maxError) | इमेज |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|---|---|
यह: features | FeatureCollection | पिक्सेल की दूरी की गणना करने के लिए, सुविधाओं की जानकारी पाने का कलेक्शन. |
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');
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