公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.sldStyle
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用提供的 OGC SLD 样式设置栅格输入的样式。
注意事项:
* 支持 OGC SLD 1.0 和 OGC SE 1.1。
* 传入的 XML 文档可以是完整的,也可以只是 SldRasterSymbolizer 元素及以下内容。
* 必须提供一个且仅一个 SldRasterSymbolizer。
* 可通过其正确的 EarthEngine 名称或使用数字标识符(“1”“2”等)选择波段。系统会先尝试使用正确的 EarthEngine 名称。
* 支持直方图和归一化对比度拉伸机制。
* 支持 SLD 1.0(GeoServer 扩展)中 ColorMap 元素的 type="values"、type="intervals" 和 type="ramp" 属性。
* 只有当不透明度为 0.0(透明)时,系统才会考虑不透明度。非零不透明度值被视为完全不透明。
* 目前会忽略 OverlapBehavior 定义。
* 目前不支持 ShadedRelief 机制。
* 目前不支持 ImageOutline 机制。
* 系统会忽略 Geometry 元素。
如果请求进行直方图均衡化或归一化,输出图片将包含 histogram_bandname 元数据。
用法 | 返回 |
---|
Image.sldStyle(sldXml) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:input | 图片 | 要使用 SLD 渲染的图片。 |
sldXml | 字符串 | OGC SLD 1.0 或 1.1 文档(或片段)。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eStyles raster images using OGC SLD 1.0 and 1.1, accepting either a complete document or just the SldRasterSymbolizer element.\u003c/p\u003e\n"],["\u003cp\u003eSupports various functionalities like band selection, Histogram and Normalize contrast stretches, and ColorMap types (values, intervals, ramp).\u003c/p\u003e\n"],["\u003cp\u003eWhile opacity is acknowledged, it only recognizes 0.0 for transparency, with other values treated as opaque, and certain features like OverlapBehavior, ShadedRelief, and ImageOutline are not supported.\u003c/p\u003e\n"],["\u003cp\u003eThe output image may contain metadata about histogram equalization or normalization, and the styling is applied using the \u003ccode\u003eImage.sldStyle(sldXml)\u003c/code\u003e function where \u003ccode\u003esldXml\u003c/code\u003e is the SLD document.\u003c/p\u003e\n"]]],[],null,["# ee.Image.sldStyle\n\nStyles a raster input with the provided OGC SLD styling.\n\n\u003cbr /\u003e\n\nPoints of note:\n\n\\* OGC SLD 1.0 and OGC SE 1.1 are supported.\n\n\\* The XML document passed in can be complete, or just the SldRasterSymbolizer element and down.\n\n\\* Exactly one SldRasterSymbolizer is required.\n\n\\* Bands may be selected by their proper EarthEngine names or using numeric identifiers (\"1\", \"2\", ...). Proper EarthEngine names are tried first.\n\n\\* The Histogram and Normalize contrast stretch mechanisms are supported.\n\n\\* The type=\"values\", type=\"intervals\" and type=\"ramp\" attributes for ColorMap element in SLD 1.0 (GeoServer extensions) are supported.\n\n\\* Opacity is only taken into account when it is 0.0 (transparent). Non-zero opacity values are treated as completely opaque.\n\n\\* The OverlapBehavior definition is currently ignored.\n\n\\* The ShadedRelief mechanism is not currently supported.\n\n\\* The ImageOutline mechanism is not currently supported.\n\n\\* The Geometry element is ignored.\n\nThe output image will have histogram_bandname metadata if histogram equalization or normalization is requested.\n\n| Usage | Returns |\n|--------------------------|---------|\n| Image.sldStyle`(sldXml)` | Image |\n\n| Argument | Type | Details |\n|---------------|--------|------------------------------------------------|\n| this: `input` | Image | The image to rendering using the SLD. |\n| `sldXml` | String | The OGC SLD 1.0 or 1.1 document (or fragment). |"]]