ee.FeatureCollection.randomPoints
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह दिए गए ज्यामिति में, एक जैसे रैंडम पॉइंट जनरेट करता है. अगर ज्यामिति दो-आयामी (पॉलीगॉन या मल्टी-पॉलीगॉन) है, तो दिखाए गए पॉइंट, गोले के दिए गए क्षेत्र पर समान रूप से डिस्ट्रिब्यूट किए जाते हैं. अगर ज्यामिति एक-आयामी (लाइनस्ट्रिंग) है, तो दिखाए गए पॉइंट को ज्यामिति के किनारों के साथ एक जैसा इंटरपोलेशन किया जाता है. अगर ज्यामिति का डाइमेंशन शून्य (पॉइंट) है, तो इनपुट पॉइंट से, दिखाए गए पॉइंट का सैंपल एक जैसा लिया जाता है. अगर अलग-अलग डाइमेंशन की कई ज्यामितियां दी गई हैं, तो सबसे ज़्यादा डाइमेंशन वाली कॉम्पोनेंट ज्यामितियों से पॉइंट सैंपल किए जाते हैं.
इस्तेमाल | रिटर्न |
---|
ee.FeatureCollection.randomPoints(region, points, seed, maxError) | FeatureCollection |
आर्ग्यूमेंट | टाइप | विवरण |
---|
region | ज्यामिति | वह क्षेत्र जिसके लिए पॉइंट जनरेट करने हैं. |
points | पूर्णांक, डिफ़ॉल्ट: 1,000 | जनरेट किए जाने वाले पॉइंट की संख्या. |
seed | लंबी, डिफ़ॉल्ट: 0 | रैंडम नंबर जनरेटर के लिए सीड. |
maxError | ErrorMargin, ज़रूरी नहीं | ज़रूरी रीप्रोजेक्ट करने के दौरान, गड़बड़ी की ज़्यादा से ज़्यादा सीमा. |
उदाहरण
कोड एडिटर (JavaScript)
// An ee.Geometry to constrain the geographic bounds of random points.
var region = ee.Geometry.Rectangle(
{coords: [-113.5, 40.0, -110.2, 41.9], geodesic: false});
// Generate 50 random points with the region.
var randomPoints = ee.FeatureCollection.randomPoints(
{region: region, points: 50, seed: 0, maxError: 1});
print('Random points from within the defined region', randomPoints);
Map.setCenter(-111.802, 40.979, 7);
Map.addLayer(region, {color: 'yellow'}, 'Region');
Map.addLayer(randomPoints, {color: 'black'}, 'Random points');
Python सेटअप
Python API के बारे में जानकारी पाने और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# An ee.Geometry to constrain the geographic bounds of random points.
region = ee.Geometry.Rectangle(
coords=[-113.5, 40.0, -110.2, 41.9], proj='EPSG:4326', geodesic=False
)
# Generate 50 random points with the region.
random_points = ee.FeatureCollection.randomPoints(
region=region, points=50, seed=0, maxError=1
)
display('Random points from within the defined region', random_points)
m = geemap.Map()
m.set_center(-111.802, 40.979, 7)
m.add_layer(region, {'color': 'yellow'}, 'Region')
m.add_layer(random_points, {'color': 'black'}, 'Random points')
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 `ee.FeatureCollection.randomPoints` function generates a specified number of random points within a given geometry. The points are uniformly distributed within the geometry's area if it's two-dimensional, along its edges if one-dimensional, or sampled from the input points if zero-dimensional. For mixed-dimension multi-geometries, points are drawn from the highest-dimension components. The user defines the `region`, the number of `points`, a random `seed`, and an optional `maxError`.\n"],null,[]]