公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Image.sldStyle
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用提供的 OGC SLD 樣式,為點陣輸入內容設定樣式。
注意事項:
* 支援 OGC SLD 1.0 和 OGC SE 1.1。
* 傳入的 XML 文件可以是完整的,也可以只有 SldRasterSymbolizer 元素和以下內容。
* 必須提供剛好一個 SldRasterSymbolizer。
* 頻帶可依正確的 EarthEngine 名稱選取,或使用數字 ID (「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 文件 (或片段)。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間: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). |"]]