ee.Image.stratifiedSample
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک نمونه تصادفی طبقه بندی شده از نقاط را از یک تصویر استخراج می کند. تعداد مشخص شده نمونه را برای هر مقدار متمایز کشف شده در "classBand" استخراج می کند. یک مجموعه ویژگی از 1 ویژگی در هر نقطه استخراج شده را برمیگرداند که هر ویژگی دارای 1 ویژگی در هر باند در تصویر ورودی است. اگر تعداد نمونه های مشخص شده برای یک مقدار کلاس معین کمتر از تعداد مشخص شده باشد، تمام امتیازهای آن کلاس لحاظ می شود. مستلزم آن است که classBand دارای مقادیر صحیح باشد.
استفاده | برمی گرداند | Image. stratifiedSample (numPoints, classBand , region , scale , projection , seed , classValues , classPoints , dropNulls , tileScale , geometries ) | مجموعه ویژگی ها |
استدلال | تایپ کنید | جزئیات | این: image | تصویر | تصویر برای نمونه |
numPoints | عدد صحیح | تعداد پیش فرض امتیاز برای نمونه در هر کلاس. می توان برای کلاس های خاص با استفاده از ویژگی های 'classValues' و 'classPoints' نادیده گرفت. |
classBand | رشته، پیش فرض: null | نام باند حاوی کلاس هایی که برای طبقه بندی استفاده می شود. اگر مشخص نشده باشد، از اولین باند تصویر ورودی استفاده می شود. |
region | هندسه، پیش فرض: null | منطقه ای که باید از آن نمونه برداری کرد. اگر مشخص نباشد، کل ردپای تصویر ورودی استفاده می شود. |
scale | شناور، پیش فرض: null | یک مقیاس اسمی بر حسب متر از طرح ریزی برای نمونه. به طور پیش فرض مقیاس اولین باند تصویر ورودی را تعیین می کند. |
projection | Projection، پیش فرض: null | طرح ریزی که در آن نمونه برداری می شود. در صورت نامشخص، از نمایش اولین باند تصویر ورودی استفاده می شود. اگر علاوه بر مقیاس مشخص شده است، به مقیاس مشخص شده مجدداً مقیاس می شود. |
seed | عدد صحیح، پیش فرض: 0 | یک دانه تصادفی برای استفاده برای نمونه گیری فرعی. |
classValues | لیست، پیش فرض: null | لیستی از مقادیر کلاس که برای آنها پارامتر numPoints لغو می شود. باید به اندازه classPoints یا null باشد. |
classPoints | لیست، پیش فرض: null | فهرستی از حداکثر تعداد پیکسلهایی که برای هر کلاس در فهرست classValues نمونهگیری میشود. باید به اندازه classValues یا null باشد. |
dropNulls | بولی، پیش فرض: درست است | از پیکسل هایی که هر باندی در آنها پوشانده شده است صرف نظر کنید. |
tileScale | شناور، پیش فرض: 1 | یک عامل پوسته پوسته شدن مورد استفاده برای کاهش اندازه کاشی تجمع. استفاده از یک tileScale بزرگتر (مثلاً 2 یا 4) ممکن است محاسباتی را فعال کند که با پیش فرض حافظه آنها تمام می شود. |
geometries | بولی، پیش فرض: نادرست | اگر درست باشد، نتایج شامل یک هندسه در هر پیکسل نمونه می شود. در غیر این صورت، هندسه ها حذف می شوند (صرفه جویی در حافظه). |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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). |"]]