公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.ImageCollection.style
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用簡單的樣式語言繪製向量集合,以進行視覺化。
用量 | 傳回 |
---|
ImageCollection.style(color, pointSize, pointShape, width, fillColor, styleProperty, neighborhood, lineType) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
這個:collection | FeatureCollection | 要繪製的集合。 |
color | 字串,預設值為「black」 | 預設顏色 (CSS 3.0 顏色值,例如 'FF0000' 或 'red'),用於繪製特徵。支援不透明度 (例如 「FF000088」(50% 透明的紅色)。 |
pointSize | 整數,預設值為 3 | 點標記的預設大小 (以像素為單位)。 |
pointShape | 字串,預設值為「circle」 | 要在每個點位置繪製的標記預設形狀。其中一個:`circle`、`square`、`diamond`、`cross`、`plus`、`pentagram`、`hexagram`、`triangle`、`triangle_up`、`triangle_down`、`triangle_left`、`triangle_right`、`pentagon`、`hexagon`、`star5`、`star6`。這個引數也支援下列 Matlab 標記縮寫:`o`、`s`、`d`、`x`、`+`、`p`、`h`、`^`、`v`、`<`、`>`。 |
width | 浮點值,預設值為 2 | 線條和多邊形/點形狀輪廓的預設線條寬度。 |
fillColor | 字串,預設值為空值 | 用於填滿多邊形和點形狀的顏色。預設為不透明度 0.66 的「color」。 |
styleProperty | 字串,預設值為空值 | 每個特徵的屬性都應包含字典。字典中的值會覆寫該功能的任何預設值。 |
neighborhood | 整數,預設值為 5 | 如果使用 styleProperty,且任何特徵的 pointSize 或寬度大於預設值,就可能發生圖塊構件。指定任何特徵所需的最大鄰域 (pointSize + width)。 |
lineType | 字串,預設值為「solid」 | 線條、多邊形和點形狀輪廓的預設線條樣式。預設值為「solid」。以下其中之一:實線、點線、虛線。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eVisualize vector collections (FeatureCollections) by applying styles like color, size, and shape to their features.\u003c/p\u003e\n"],["\u003cp\u003eCustomize the appearance of points, lines, and polygons with parameters such as point size, shape, line width, and fill color.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003estyleProperty\u003c/code\u003e parameter to define individual styles for each feature within the collection.\u003c/p\u003e\n"],["\u003cp\u003eControl potential tiling artifacts by setting the \u003ccode\u003eneighborhood\u003c/code\u003e parameter, especially when using large point sizes or widths.\u003c/p\u003e\n"],["\u003cp\u003eAdjust the default line style for lines and outlines with the \u003ccode\u003elineType\u003c/code\u003e parameter, choosing between solid, dotted, and dashed options.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.style\n\nDraw a vector collection for visualization using a simple style language.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| ImageCollection.style`(`*color* `, `*pointSize* `, `*pointShape* `, `*width* `, `*fillColor* `, `*styleProperty* `, `*neighborhood* `, `*lineType*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | FeatureCollection | The collection to draw. |\n| `color` | String, default: \"black\" | A default color (CSS 3.0 color value e.g., 'FF0000' or 'red') to use for drawing the features. Supports opacity (e.g., 'FF000088' for 50% transparent red). |\n| `pointSize` | Integer, default: 3 | The default size in pixels of the point markers. |\n| `pointShape` | String, default: \"circle\" | The default shape of the marker to draw at each point location. One of: \\`circle\\`, \\`square\\`, \\`diamond\\`, \\`cross\\`, \\`plus\\`, \\`pentagram\\`, \\`hexagram\\`, \\`triangle\\`, \\`triangle_up\\`, \\`triangle_down\\`, \\`triangle_left\\`, \\`triangle_right\\`, \\`pentagon\\`, \\`hexagon\\`, \\`star5\\`, \\`star6\\`. This argument also supports these Matlab marker abbreviations: \\`o\\`, \\`s\\`, \\`d\\`, \\`x\\`, \\`+\\`, \\`p\\`, \\`h\\`, \\`\\^\\`, \\`v\\`, \\`\\\u003c\\`, \\`\\\u003e\\`. |\n| `width` | Float, default: 2 | The default line width for lines and outlines for polygons and point shapes. |\n| `fillColor` | String, default: null | The color for filling polygons and point shapes. Defaults to 'color' at 0.66 opacity. |\n| `styleProperty` | String, default: null | A per-feature property expected to contain a dictionary. Values in the dictionary override any default values for that feature. |\n| `neighborhood` | Integer, default: 5 | If styleProperty is used and any feature has a pointSize or width larger than the defaults, tiling artifacts can occur. Specifies the maximum neighborhood (pointSize + width) needed for any feature. |\n| `lineType` | String, default: \"solid\" | The default line style for lines and outlines of polygons and point shapes. Defaults to 'solid'. One of: solid, dotted, dashed. |"]]