公告:所有在
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 | 字符串,默认值:null | 用于填充多边形和点形状的颜色。默认值为不透明度为 0.66 的“color”。 |
styleProperty | 字符串,默认值:null | 一种按功能划分的属性,预计包含一个字典。字典中的值会覆盖相应功能的任何默认值。 |
neighborhood | 整数,默认值:5 | 如果使用了 styleProperty,并且任何要素的点大小或宽度大于默认值,则可能会出现平铺伪影。指定任何特征所需的最大邻域(pointSize + width)。 |
lineType | 字符串,默认值:“solid” | 线条以及多边形和点状形状轮廓的默认线条样式。默认值为“实线”。以下各项之一:实线、点划线、虚线。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]