ee.Geometry.LineString.withinDistance
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
अगर ज्यामिति, तय की गई दूरी के अंदर होती हैं, तो यह फ़ंक्शन 'सही' वैल्यू दिखाता है.
इस्तेमाल | रिटर्न |
---|
LineString.withinDistance(right, distance, maxError, proj) | बूलियन |
आर्ग्यूमेंट | टाइप | विवरण |
---|
यह: left | ज्यामिति | ज्यामिति का इस्तेमाल, ऑपरेशन के लेफ्ट ऑपरेंड के तौर पर किया जाता है. |
right | ज्यामिति | ज्यामिति, जिसका इस्तेमाल ऑपरेशन के राइट ऑपरेंड के तौर पर किया जाता है. |
distance | फ़्लोट | दूरी का थ्रेशोल्ड. अगर कोई प्रोजेक्शन तय किया गया है, तो दूरी को उस प्रोजेक्टेड कोऑर्डिनेट सिस्टम की इकाइयों में मापा जाता है. अगर कोई प्रोजेक्शन तय नहीं किया गया है, तो दूरी को मीटर में मापा जाता है. |
maxError | ErrorMargin, डिफ़ॉल्ट: null | ज़रूरी रीप्रोजेक्शन करते समय, ज़्यादा से ज़्यादा कितनी गड़बड़ी हो सकती है. |
proj | प्रोजेक्शन, डिफ़ॉल्ट: null | वह प्रोजेक्शन जिसमें ऑपरेशन करना है. अगर इसे तय नहीं किया जाता है, तो ऑपरेशन स्फ़ेरिकल कोऑर्डिनेट सिस्टम में किया जाएगा. साथ ही, गोले पर रैखिक दूरी मीटर में होगी. |
उदाहरण
कोड एडिटर (JavaScript)
// Define a LineString object.
var lineString = ee.Geometry.LineString([[-122.09, 37.42], [-122.08, 37.43]]);
// Define other inputs.
var inputGeom = ee.Geometry.Point(-122.090, 37.423);
// Apply the withinDistance method to the LineString object.
var lineStringWithinDistance = lineString.withinDistance({'right': inputGeom, 'distance': 500, 'maxError': 1});
// Print the result to the console.
print('lineString.withinDistance(...) =', lineStringWithinDistance);
// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(lineString,
{'color': 'black'},
'Geometry [black]: lineString');
Map.addLayer(inputGeom,
{'color': 'blue'},
'Parameter [blue]: inputGeom');
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Define a LineString object.
linestring = ee.Geometry.LineString([[-122.09, 37.42], [-122.08, 37.43]])
# Define other inputs.
input_geom = ee.Geometry.Point(-122.090, 37.423)
# Apply the withinDistance method to the LineString object.
linestring_within_distance = linestring.withinDistance(
right=input_geom, distance=500, maxError=1
)
# Print the result.
display('linestring.withinDistance(...) =', linestring_within_distance)
# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(linestring, {'color': 'black'}, 'Geometry [black]: linestring')
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-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eDetermines if one geometry lies within a specified distance of another geometry.\u003c/p\u003e\n"],["\u003cp\u003eReturns \u003ccode\u003etrue\u003c/code\u003e if the geometries are within the given distance, \u003ccode\u003efalse\u003c/code\u003e otherwise.\u003c/p\u003e\n"],["\u003cp\u003eTakes a distance threshold, optional projection, and maximum error as parameters.\u003c/p\u003e\n"],["\u003cp\u003eCan be applied to various geometry types like LineString, Point, Polygon, etc.\u003c/p\u003e\n"],["\u003cp\u003eDistance is measured in meters or in the units of the projected coordinate system if specified.\u003c/p\u003e\n"]]],[],null,["# ee.Geometry.LineString.withinDistance\n\nReturns true if and only if the geometries are within a specified distance.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------------------------|---------|\n| LineString.withinDistance`(right, distance, `*maxError* `, `*proj*`)` | Boolean |\n\n| Argument | Type | Details |\n|--------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `left` | Geometry | The geometry used as the left operand of the operation. |\n| `right` | Geometry | The geometry used as the right operand of the operation. |\n| `distance` | Float | The distance threshold. If a projection is specified, the distance is in units of that projected coordinate system, otherwise it is in meters. |\n| `maxError` | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `proj` | Projection, default: null | The projection in which to perform the operation. If not specified, the operation will be performed in a spherical coordinate system, and linear distances will be in meters on the sphere. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Define a LineString object.\nvar lineString = ee.Geometry.LineString([[-122.09, 37.42], [-122.08, 37.43]]);\n\n// Define other inputs.\nvar inputGeom = ee.Geometry.Point(-122.090, 37.423);\n\n// Apply the withinDistance method to the LineString object.\nvar lineStringWithinDistance = lineString.withinDistance({'right': inputGeom, 'distance': 500, 'maxError': 1});\n\n// Print the result to the console.\nprint('lineString.withinDistance(...) =', lineStringWithinDistance);\n\n// Display relevant geometries on the map.\nMap.setCenter(-122.085, 37.422, 15);\nMap.addLayer(lineString,\n {'color': 'black'},\n 'Geometry [black]: lineString');\nMap.addLayer(inputGeom,\n {'color': 'blue'},\n 'Parameter [blue]: inputGeom');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Define a LineString object.\nlinestring = ee.Geometry.LineString([[-122.09, 37.42], [-122.08, 37.43]])\n\n# Define other inputs.\ninput_geom = ee.Geometry.Point(-122.090, 37.423)\n\n# Apply the withinDistance method to the LineString object.\nlinestring_within_distance = linestring.withinDistance(\n right=input_geom, distance=500, maxError=1\n)\n\n# Print the result.\ndisplay('linestring.withinDistance(...) =', linestring_within_distance)\n\n# Display relevant geometries on the map.\nm = geemap.Map()\nm.set_center(-122.085, 37.422, 15)\nm.add_layer(linestring, {'color': 'black'}, 'Geometry [black]: linestring')\nm.add_layer(input_geom, {'color': 'blue'}, 'Parameter [blue]: input_geom')\nm\n```"]]