ee.Geometry.Polygon.distance
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ंक्शन, दो ज्यामिति के बीच की कम से कम दूरी दिखाता है.
इस्तेमाल | रिटर्न |
---|
Polygon.distance(right, maxError, proj, spherical) | फ़्लोट |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: left | ज्यामिति | ऑपरेशन के बाएं ऑपरेंड के तौर पर इस्तेमाल की जाने वाली ज्यामिति. |
right | ज्यामिति | ऑपरेशन के राइट ऑपरेंड के तौर पर इस्तेमाल की जाने वाली ज्यामिति. |
maxError | ErrorMargin, डिफ़ॉल्ट: null | ज़रूरी रीप्रोजेक्ट करने के दौरान, गड़बड़ी की ज़्यादा से ज़्यादा सीमा. |
proj | प्रोजेक्शन, डिफ़ॉल्ट: null | वह प्रोजेक्शन जिसमें कार्रवाई करनी है. अगर टाइप नहीं बताया गया है, तो ऑपरेशन गोलाकार निर्देशांक प्रणाली में किया जाएगा और गोले पर लीनियर दूरियां मीटर में होंगी. |
spherical | बूलियन, डिफ़ॉल्ट: गलत | अगर यह सही है, तो यूनिट स्फ़ीर पर हिसाब लगाया जाएगा. अगर यह वैल्यू गलत है, तो पृथ्वी के चपटे होने को ध्यान में रखते हुए, अंडाकार आकार का हिसाब लगाया जाएगा. अगर proj की वैल्यू दी गई है, तो इस पर ध्यान नहीं दिया जाता. डिफ़ॉल्ट रूप से, यह 'गलत' पर सेट होती है. |
उदाहरण
कोड एडिटर (JavaScript)
// Define a Polygon object.
var polygon = ee.Geometry.Polygon(
[[[-122.092, 37.424],
[-122.086, 37.418],
[-122.079, 37.425],
[-122.085, 37.423]]]);
// Define other inputs.
var inputGeom = ee.Geometry.Point(-122.090, 37.423);
// Apply the distance method to the Polygon object.
var polygonDistance = polygon.distance({'right': inputGeom, 'maxError': 1});
// Print the result to the console.
print('polygon.distance(...) =', polygonDistance);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(polygon,
{'color': 'black'},
'Geometry [black]: polygon');
Map.addLayer(inputGeom,
{'color': 'blue'},
'Parameter [blue]: inputGeom');
Python सेटअप
Python API के बारे में जानकारी पाने और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Define a Polygon object.
polygon = ee.Geometry.Polygon([[
[-122.092, 37.424],
[-122.086, 37.418],
[-122.079, 37.425],
[-122.085, 37.423],
]])
# Define other inputs.
input_geom = ee.Geometry.Point(-122.090, 37.423)
# Apply the distance method to the Polygon object.
polygon_distance = polygon.distance(right=input_geom, maxError=1)
# Print the result.
display('polygon.distance(...) =', polygon_distance)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(polygon, {'color': 'black'}, 'Geometry [black]: polygon')
m.add_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom')
m
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],["The `distance` method calculates the minimum distance between two geometries (`left` and `right`). It accepts optional arguments: `maxError` (tolerated error during reprojection), `proj` (projection for the operation), and `spherical` (spherical or elliptical calculation when `proj` is unspecified). The method returns a float value. The example shows how to use the function, by creating two geometries, one of type Polygon and the other Point, and obtain the minimum distance between them.\n"],null,[]]