إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.Image.stratifiedSample
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تستخرج هذه الأداة عيّنة عشوائية طبقية من النقاط من صورة. يستخرج هذا الإجراء العدد المحدّد من العيّنات لكل قيمة مميّزة تم اكتشافها ضمن classBand. تعرض هذه الدالة مجموعة FeatureCollection تتضمّن ميزة واحدة لكل نقطة مستخرَجة، مع تضمين كل ميزة لسمة واحدة لكل نطاق في الصورة المُدخَلة. إذا كان عدد العيّنات المتاحة لقيمة فئة معيّنة أقل من العدد المحدّد، سيتم تضمين جميع النقاط الخاصة بهذه الفئة. يجب أن يحتوي classBand على قيم عددية صحيحة.
الاستخدام | المرتجعات |
---|
Image.stratifiedSample(numPoints, classBand, region, scale, projection, seed, classValues, classPoints, dropNulls, tileScale, geometries) | FeatureCollection |
الوسيطة | النوع | التفاصيل |
---|
هذا: image | صورة | الصورة المطلوب أخذ عيّنة منها |
numPoints | عدد صحيح | عدد النقاط التلقائي المطلوب أخذ عيّنات منها في كل فئة. يمكن تجاهل هذه السياسة لفئات محدّدة باستخدام السمتَين classValues وclassPoints. |
classBand | سلسلة، القيمة التلقائية: null | اسم النطاق الذي يحتوي على الفئات المطلوب استخدامها للتصنيف الطبقي إذا لم يتم تحديدها، سيتم استخدام النطاق الأول من الصورة المُدخَلة. |
region | Geometry, default: null | المنطقة التي سيتم أخذ عيّنات منها في حال عدم تحديدها، يتم استخدام المساحة الكاملة للصورة المُدخَلة. |
scale | العدد العائم، القيمة التلقائية: null | مقياس اسمي بالأمتار للإسقاط الذي سيتم أخذ عينات منه يكون الإعداد التلقائي هو مقياس النطاق الأول من الصورة المُدخَلة. |
projection | التوقّع، القيمة التلقائية: null | نظام الإسقاط الذي سيتم أخذ العيّنة فيه. في حال عدم تحديدها، يتم استخدام إسقاط النطاق الأول للصورة المُدخَلة. إذا تم تحديدها بالإضافة إلى المقياس، سيتم إعادة قياسها وفقًا للمقياس المحدّد. |
seed | عدد صحيح، القيمة التلقائية: 0 | قيمة أساسية عشوائية تُستخدَم لأخذ عينات فرعية. |
classValues | قائمة، القيمة التلقائية: فارغة | قائمة بقيم الفئات التي سيتم إلغاء المعلمة numPoints لها. يجب أن يكون بالحجم نفسه الذي يظهر به classPoints أو أن تكون قيمته فارغة. |
classPoints | قائمة، القيمة التلقائية: فارغة | قائمة بالحد الأقصى لعدد وحدات البكسل التي سيتم أخذ عينات منها لكل فئة في قائمة classValues. يجب أن يكون الحجم هو نفسه حجم classValues أو null. |
dropNulls | قيمة منطقية، القيمة التلقائية: true | تخطّي وحدات البكسل التي تم إخفاء أي نطاق فيها |
tileScale | عدد عائم، القيمة التلقائية: 1 | عامل قياس يُستخدَم لتقليل حجم مربّع التجميع، ويؤدي استخدام قيمة أكبر لـ tileScale (مثل 2 أو 4) قد تتيح إجراء عمليات حسابية تنفد فيها الذاكرة مع القيمة التلقائية. |
geometries | قيمة منطقية، القيمة التلقائية: false | إذا كانت القيمة صحيحة، ستتضمّن النتائج شكلاً هندسيًا لكل بكسل تم أخذ عيّنة منه. وإلا سيتم حذف الأشكال الهندسية (لتوفير مساحة في الذاكرة). |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eExtracts a stratified random sample of points from an image based on distinct class values within a specified band.\u003c/p\u003e\n"],["\u003cp\u003eReturns a FeatureCollection containing one feature per sampled point, each with properties corresponding to the image bands.\u003c/p\u003e\n"],["\u003cp\u003eAllows customization of the number of samples per class, sampling region, scale, projection, and randomization.\u003c/p\u003e\n"],["\u003cp\u003eHandles cases with insufficient samples for a class by including all available points for that class.\u003c/p\u003e\n"],["\u003cp\u003eRequires the class band to contain integer values for proper stratification.\u003c/p\u003e\n"]]],[],null,["# ee.Image.stratifiedSample\n\nExtracts a stratified random sample of points from an image. Extracts the specified number of samples for each distinct value discovered within the 'classBand'. Returns a FeatureCollection of 1 Feature per extracted point, with each feature having 1 property per band in the input image. If there are less than the specified number of samples available for a given class value, then all of the points for that class will be included. Requires that the classBand contain integer values.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|\n| Image.stratifiedSample`(numPoints, `*classBand* `, `*region* `, `*scale* `, `*projection* `, `*seed* `, `*classValues* `, `*classPoints* `, `*dropNulls* `, `*tileScale* `, `*geometries*`)` | FeatureCollection |\n\n| Argument | Type | Details |\n|---------------|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to sample. |\n| `numPoints` | Integer | The default number of points to sample in each class. Can be overridden for specific classes using the 'classValues' and 'classPoints' properties. |\n| `classBand` | String, default: null | The name of the band containing the classes to use for stratification. If unspecified, the first band of the input image is used. |\n| `region` | Geometry, default: null | The region to sample from. If unspecified, the input image's whole footprint is used. |\n| `scale` | Float, default: null | A nominal scale in meters of the projection to sample in. Defaults to the scale of the first band of the input image. |\n| `projection` | Projection, default: null | The projection in which to sample. If unspecified, the projection of the input image's first band is used. If specified in addition to scale, rescaled to the specified scale. |\n| `seed` | Integer, default: 0 | A randomization seed to use for subsampling. |\n| `classValues` | List, default: null | A list of class values for which to override the numPoints parameter. Must be the same size as classPoints or null. |\n| `classPoints` | List, default: null | A list of the per-class maximum number of pixels to sample for each class in the classValues list. Must be the same size as classValues or null. |\n| `dropNulls` | Boolean, default: true | Skip pixels in which any band is masked. |\n| `tileScale` | Float, default: 1 | A scaling factor used to reduce aggregation tile size; using a larger tileScale (e.g., 2 or 4) may enable computations that run out of memory with the default. |\n| `geometries` | Boolean, default: false | If true, the results will include a geometry per sampled pixel. Otherwise, geometries will be omitted (saving memory). |"]]