公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Classifier.spectralRegion
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建一个分类器,用于测试其输入是否位于任意二维坐标系中由一组坐标定义的多边形内。要分类的每个输入都必须有 2 个值(例如,图片必须有 2 个波段)。如果输入值包含在指定多边形内,结果将为 1,否则为 0。
用法 | 返回 |
---|
ee.Classifier.spectralRegion(coordinates, schema) | 分类器 |
参数 | 类型 | 详细信息 |
---|
coordinates | 列表 | 多边形的坐标,以环列表的形式表示。每个环都是一个坐标对列表(例如[u1, v1, u2, v2, ..., uN, vN])。任何边都不得与任何其他边相交。如果输入值位于指定多边形的内部,则生成的分类结果为 1;也就是说,必须跨越奇数条多边形边才能到达多边形外部,否则结果为 0。 |
schema | 列表,默认值:null | 分类器的架构。分类器将处理的波段或属性名称的列表。由于此分类器不经过训练步骤,因此必须手动指定这些参数。默认值为 ['u', 'v']。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCreates a classifier to determine if input data points, represented by two values, fall within a defined polygon.\u003c/p\u003e\n"],["\u003cp\u003eThe classifier uses a polygon defined by a set of coordinates in a 2D coordinate system.\u003c/p\u003e\n"],["\u003cp\u003eInput data, such as images with two bands, is classified as 1 if inside the polygon and 0 if outside.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify the polygon coordinates and optionally define a schema for the classifier's input bands or properties.\u003c/p\u003e\n"]]],[],null,["# ee.Classifier.spectralRegion\n\nCreates a classifier that tests if its inputs lie within a polygon defined by a set of coordinates in an arbitrary 2D coordinate system. Each input to be classified must have 2 values (e.g., images must have 2 bands). The result will be 1 wherever the input values are contained within the given polygon and 0 otherwise.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------------|------------|\n| `ee.Classifier.spectralRegion(coordinates, `*schema*`)` | Classifier |\n\n| Argument | Type | Details |\n|---------------|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `coordinates` | List | The coordinates of the polygon, as a list of rings. Each ring is a list of coordinate pairs (e.g., \\[u1, v1, u2, v2, ..., uN, vN\\]). No edge may intersect any other edge. The resulting classification will be a 1 wherever the input values are within the interior of the given polygon, that is, an odd number of polygon edges must be crossed to get outside the polygon and 0 otherwise. |\n| `schema` | List, default: null | The classifier's schema. A list of band or property names that the classifier will operate on. Since this classifier doesn't undergo a training step, these have to be specified manually. Defaults to \\['u', 'v'\\]. |"]]