UNPKG

@arcgis/coding-components

Version:

Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.

1 lines 604 kB
[{"id":"constants","title":"常量","items":[{"type":"constant","name":"infinity","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#infinity","description":"表示大于任何其他数字的值。 `-Infinity` 也可以用作小于任何数字的值。","examples":"\n**示例**\n\n计算四个字段值的最大值\n\n```arcade\nvar values = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4 ];\nvar maxValue = -Infinity;\n\nfor(var i in values){\n maxValue = IIF(values[i] > maxValue, values[i], maxValue);\n}\n\nreturn maxValue;\n```\n\n","completion":{"label":"Infinity","detail":"Infinity","insertText":"Infinity","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n表示大于任何其他数字的值。 `-Infinity` 也可以用作小于任何数字的值。"}}},{"type":"constant","name":"pi","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#pi","description":"圆的周长除以其直径所得出的值大约为 `3.14159`。","examples":"\n**示例**\n\n返回圆要素的面积\n\n```arcade\nvar r = $feature.radius;\nPI * r * r;\n```\n\n","completion":{"label":"PI","detail":"PI","insertText":"PI","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n圆的周长除以其直径所得出的值大约为 `3.14159`。"}}},{"type":"constant","name":"textformatting.backwardslash","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.backwardslash","description":"在文本中插入反斜杠字符 `\\`。","examples":"\n**示例**\n\n返回 '\\\\\\serverName\\foo\\bar'\n\n```arcade\nTextFormatting.BackwardSlash + TextFormatting.BackwardSlash + $feature.FILE_PATH\n```\n\n","completion":{"label":"TextFormatting.BackwardSlash","detail":"TextFormatting.BackwardSlash","insertText":"TextFormatting.BackwardSlash","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n在文本中插入反斜杠字符 `\\`。"}}},{"type":"constant","name":"textformatting.doublequote","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.doublequote","description":"在文本中插入双引号字符 `\\\"`。","examples":"\n**示例**\n\n返回 'Nicholas \\\"Nick\\\" Anderson’\n\n```arcade\n$feature.NAME + \" \" + TextFormatting.DoubleQuote + $feature.ALIAS + TextFormatting.DoubleQuote + \" \" + $feature.SURNAME\n```\n\n","completion":{"label":"TextFormatting.DoubleQuote","detail":"TextFormatting.DoubleQuote","insertText":"TextFormatting.DoubleQuote","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n在文本中插入双引号字符 `\\\"`。"}}},{"type":"constant","name":"textformatting.forwardslash","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.forwardslash","description":"在文本中插入正斜线字符 `/`。","examples":"\n**示例**\n\n返回 '151/low'\n\n```arcade\n$feature.POP_DENSITY + TextFormatting.ForwardSlash + $feature.CLASS\n```\n\n","completion":{"label":"TextFormatting.ForwardSlash","detail":"TextFormatting.ForwardSlash","insertText":"TextFormatting.ForwardSlash","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n在文本中插入正斜线字符 `/`。"}}},{"type":"constant","name":"textformatting.newline","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.newline","description":"在文本中插入新行或换行符。 ArcGIS API 3.x for JavaScript 和 ArcGIS Online Map Viewer Classic **不** 支持多行标注。","examples":"\n**示例**\n\n返回 \"T2N R1W\"\n\n```arcade\n\"T\" + $feature.TOWNSHIP + TextFormatting.NewLine + \"R\" + $feature.RANGE\n```\n\n","completion":{"label":"TextFormatting.NewLine","detail":"TextFormatting.NewLine","insertText":"TextFormatting.NewLine","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n在文本中插入新行或换行符。 ArcGIS API 3.x for JavaScript 和 ArcGIS Online Map Viewer Classic **不** 支持多行标注。"}}},{"type":"constant","name":"textformatting.singlequote","bundle":"core","sinceVersion":"1.0","link":"https://developers.arcgis.com/arcade/function-reference/constants/#textformatting.singlequote","description":"在文本中插入单引号字符 `'`。","examples":"\n**示例**\n\n返回 \\\"Nicholas 'Nick' Anderson\\\"\n\n```arcade\n$feature.NAME + \" \" + TextFormatting.SingleQuote + $feature.ALIAS + TextFormatting.SingleQuote + \" \" + $feature.SURNAME\n```\n\n","completion":{"label":"TextFormatting.SingleQuote","detail":"TextFormatting.SingleQuote","insertText":"TextFormatting.SingleQuote","insertTextMode":2,"insertTextFormat":1,"kind":21,"documentation":{"kind":"markdown","value":"**[起始版本 1.0](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n在文本中插入单引号字符 `'`。"}}}]},{"id":"featureset_functions","title":"FeatureSet 函数","items":[{"type":"function","name":"area","bundle":"data-access","sinceVersion":"1.7","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#area","description":"以给定单位返回输入 FeatureSet 的面积。 这是使用笛卡尔算法的平面测量。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_","examples":"\n**示例**\n\n以平方千米为单位返回图层面积。\n\n```arcade\nArea($layer, 'square-kilometers')\n```\n\n","completion":{"label":"Area","detail":"Area(features, unit?) -> Number","insertText":"Area(${1:features_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.7](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n以给定单位返回输入 FeatureSet 的面积。 这是使用笛卡尔算法的平面测量。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 待计算平面面积的 FeatureSet。\n- **unit** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) \\| [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 返回值的测量单位。 这可能是下面可能的值之一,或者是下面附加资源部分中列出的数字代码之一。 对于可视化、标注和弹出窗口文件,默认单位是地图的空间参考。 在其他配置文件中,如字段计算,默认基于数据的空间参考。 \n可能的值:`acres` | `hectares` | `square-centimeters` | `square-decimeters` | `square-feet` | `square-inches` | `square-kilometers` | `square-meters` | `square-miles` | `square-millimeters` | `square-us-feet` | `square-us-miles` | `square-yards` \n\n\n**返回值**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)\n\n**其他资源**\n\n* [AreaGeodetic()](https://developers.arcgis.com/arcade/function-reference/featureset_functions/#areageodetic)\n* [Available numeric codes for unit parameter](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/)\n* [More available numeric codes for unit parameter](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/)\n"}},"parametersInfo":{"min":1,"max":2}},{"type":"function","name":"areageodetic","bundle":"data-access","sinceVersion":"1.7","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#areageodetic","description":"以给定单位返回输入 FeatureSet 的测量面积。 这是比 `Area()` 更可靠的面积测量 因为它考虑到了地球的曲率。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_","examples":"\n**示例**\n\n以平方千米为单位返回图层的测量面积。\n\n```arcade\nAreaGeodetic($layer, 'square-kilometers')\n```\n\n","completion":{"label":"AreaGeodetic","detail":"AreaGeodetic(features, unit?) -> Number","insertText":"AreaGeodetic(${1:features_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.7](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n以给定单位返回输入 FeatureSet 的测量面积。 这是比 `Area()` 更可靠的面积测量 因为它考虑到了地球的曲率。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 待计算测量面积的 FeatureSet。\n- **unit** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) \\| [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 返回值的测量单位。 这可能是下面可能的值之一,或者是下面附加资源部分中列出的数字代码之一。 对于可视化、标注和弹出窗口文件,默认单位是地图的空间参考。 在其他配置文件中,如字段计算,默认基于数据的空间参考。 \n可能的值:`acres` | `hectares` | `square-centimeters` | `square-decimeters` | `square-feet` | `square-inches` | `square-kilometers` | `square-meters` | `square-miles` | `square-millimeters` | `square-us-feet` | `square-us-miles` | `square-yards` \n\n\n**返回值**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)\n\n**其他资源**\n\n* [Area()](https://developers.arcgis.com/arcade/function-reference/featureset_functions/#area)\n* [Available numeric codes for unit parameter](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/)\n* [More available numeric codes for unit parameter](https://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/)\n"}},"parametersInfo":{"min":1,"max":2}},{"type":"function","name":"attachments","bundle":"data-access","sinceVersion":"1.6","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#attachments","description":"返回与输入要素相关联的附件列表。 每个结果包含附件的名称、内容类型、ID 和大小(以字节为单位)。 仅适用于从要素服务创建的要素。","examples":"\n**示例**\n\n返回与要素相关联的附件数量\n\n```arcade\n// Returns the number of attachments associated with the feature\nCount(Attachments($feature))\n```\n\n","completion":{"label":"Attachments","detail":"Attachments(inputFeature, options?) -> Array<Attachment>","insertText":"Attachments(${1:inputFeature_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.6](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回与输入要素相关联的附件列表。 每个结果包含附件的名称、内容类型、ID 和大小(以字节为单位)。 仅适用于从要素服务创建的要素。\n\n**参数**\n\n- **inputFeature**: [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 将从服务中获取与此要素相关联的附件。\n- **options** (_Optional_): [Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary) - 请求的设置。 字典属性:\n\n - **types**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - 表示要获取的文件类型的文本值数组。 \n可能的值为:`bmp`, `ecw`, `emf`, `eps`, `ps`, `gif`, `img`, `jp2`, `jpc`, `j2k`, `jpf`, `jpg`, `jpeg`, `jpe`, `png`, `psd`, `raw`, `sid`, `tif, tiff`, `wmf`, `wps`, `avi`, `mpg`, `mpe`, `mpeg`, `mov`, `wmv`, `aif`, `mid`, `rmi`, `mp2`, `mp3`, `mp4`, `pma`, `mpv2`, `qt`, `ra, ram`, `wav`, `wma`, `doc`, `docx`, `dot`, `xls`, `xlsx`, `xlt`, `pdf`, `ppt`, `pptx`, `txt`, `zip`, `7z`, `gz`, `gtar`, `tar`, `tgz, vrml`, `gml`, `json`, `xml`, `mdb`, `geodatabase`\n - **minsize**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 附件的最小文件大小(以字节为单位)。\n - **maxsize**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 附件的最大文件大小(以字节为单位)。\n - **metadata** (_Optional_): [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) - 指示是否在函数返回中包含附件元数据。 目前仅支持图像的 Exif 元数据。\n\n**返回值**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Attachment](https://developers.arcgis.com/arcade/guide/types/#attachment)&gt;"}},"parametersInfo":{"min":1,"max":2}},{"type":"function","name":"average","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#average","description":"返回 FeatureSet 中给定数值字段的平均值。","examples":"\n**示例**\n\n计算要素人口与图层中所有要素平均人口的差值\n\n```arcade\n$feature.population - Average($layer, 'population')\n```\n\n计算图层中所有要素每平方英里的平均人口\n\n```arcade\nAverage($layer, 'population / area')\n```\n\n","completion":{"label":"Average","detail":"Average(features, fieldNameOrSQLExpression) -> Number","insertText":"Average(${1:features_}, ${2:fieldNameOrSQLExpression_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回 FeatureSet 中给定数值字段的平均值。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 要对其执行运算的 FeatureSet。\n- **fieldNameOrSQLExpression**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 指定将从输入 FeatureSet 计算统计数据的数值字段的名称或 SQL92 表达式。\n\n**返回值**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"contains","bundle":"data-access","sinceVersion":"1.7","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#contains","description":"从输入几何中包含的 FeatureSet 返回要素。 在下图中,红色突出显示了函数将返回要素的空间关系。\n\n**请注意,如果使用 `$feature` 作为此函数的输入,将只产生与视图的比例分辨率具有同等精度的结果。 因此,使用此函数返回的表达式值可能会在比例缩放后发生更改。**","examples":"\n**示例**\n\n返回给定面中包含的要素数\n\n```arcade\nvar parcels = FeatureSetByName($map, 'parcels')\nvar projectArea = $feature;\nCount(Contains(projectArea, parcels));\n```\n\n","completion":{"label":"Contains","detail":"Contains(containerGeometry, insideFeatures) -> FeatureSet","insertText":"Contains(${1:containerGeometry_}, ${2:insideFeatures_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.7](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n从输入几何中包含的 FeatureSet 返回要素。 在下图中,红色突出显示了函数将返回要素的空间关系。\n\n**请注意,如果使用 `$feature` 作为此函数的输入,将只产生与视图的比例分辨率具有同等精度的结果。 因此,使用此函数返回的表达式值可能会在比例缩放后发生更改。**\n\n**参数**\n\n- **containerGeometry**: [Geometry](https://developers.arcgis.com/arcade/guide/types/#geometry) \\| [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 用于测试与 `insideFeatures` 的“包含”关系的几何。 把这种几何看作是 `insideFeatures` 的潜在“容器”。\n- **insideFeatures**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 用于测试与 `containerGeometry` 的‘位于’关系的 FeatureSet。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"count","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#count","description":"返回 FeatureSet 中的要素数量。","examples":"\n**示例**\n\n返回图层中的要素数\n\n```arcade\nCount($layer)\n```\n\n","completion":{"label":"Count","detail":"Count(features) -> Number","insertText":"Count(${1:features_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回 FeatureSet 中的要素数量。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 从中计算要素数量的 FeatureSet\n\n**返回值**: [Number](https://developers.arcgis.com/arcade/guide/types/#number)"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"crosses","bundle":"data-access","sinceVersion":"1.3","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#crosses","description":"从与输入几何交叉的 FeatureSet 返回要素。 在下图中,红色突出显示了函数将返回要素的空间关系。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_","examples":"\n**示例**\n\n返回与给定面交叉的 FeatureSet 中的要素数\n\n```arcade\nvar geom2 = Polygon({ ... });\nCount( Crosses($layer, geom2) );\n```\n\n","completion":{"label":"Crosses","detail":"Crosses(features, crossingGeometry) -> FeatureSet","insertText":"Crosses(${1:features_}, ${2:crossingGeometry_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.3](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n从与输入几何交叉的 FeatureSet 返回要素。 在下图中,红色突出显示了函数将返回要素的空间关系。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 用于测试与输入 `crossingGeometry` 的交叉关系的要素。\n- **crossingGeometry**: [Geometry](https://developers.arcgis.com/arcade/guide/types/#geometry) \\| [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 被交叉的几何。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"distinct","bundle":"data-access","sinceVersion":"1.8","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#distinct","description":"从 FeatureSet 返回一组不同的值或唯一值。","examples":"\n**示例**\n\n返回包含“Status”列的 FeatureSet。 每行 FeatureSet 均包含唯一的统计值\n\n```arcade\nDistinct($layer, 'Status')\n```\n\n返回包含“Status”和“Type”列的 FeatureSet。 每行 FeatureSet 均包含“Status”和“Type”值的唯一组合\n\n```arcade\nDistinct($layer, ['Status', 'Type'])\n```\n\n返回包含 Density 列的 FeatureSet,其中行可能包含值 Low、High 或 N/A\n\n```arcade\nDistinct($layer, {\n name: \"Density\",\n expression: \"CASE WHEN PopDensity < 100 THEN 'Low' WHEN PopDensity >= 100 THEN 'High' ELSE 'N/A' END\"\n})\n```\n\n返回包含 Score 和 Type 列的 FeatureSet\n\n```arcade\nDistinct($layer, [{\n name: 'Score',\n expression: 'POPULATION_DENSITY * 0.65 + Status_Code * 0.35'\n}, {\n name: 'Type',\n expression: 'Category'\n}])\n```\n\n","completion":{"label":"Distinct","detail":"Distinct(features, fields) -> FeatureSet","insertText":"Distinct(${1:features_}, ${2:fields_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.8](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n从 FeatureSet 返回一组不同的值或唯一值。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 要从中返回不同值的 FeatureSet。\n- **fields**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) \\| [Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary) \\| [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; \\| [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary)&gt; - 用于确定唯一值的字段和/或表达式。 此参数可以是字段名称数组、表达式数组, 也可以是指定将存储唯一值的输出列名称的对象或对象数组。 如果字典已指定,必须使用以下规范:\n\n - **name**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 存储给定表达式结果的列的名称。\n - **expression**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 用于计算唯一值的 SQL-92 表达式。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"domain","bundle":"data-access","sinceVersion":"1.11","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#domain","description":"返回分配给所提供 `featureSet` 的给定字段的属性域。 如果 `featureSet` 属于子类型类,则将返回分配给该子类型的属性域。","examples":"\n**示例**\n\n分配给要素子类型的属性域。\n\n```arcade\nvar fsPole = FeatureSetByName($layer, \"Pole\", 1);\nvar d = Domain(fsPole, \"poleType\")\n// the poleType field has a coded value domain called poleTypes\n// the value of d will be\n// {\n// type: \"codedValue\" ,\n// name: \"poleTypesThreePhase\",\n// dataType: \"number\",\n// codedValues: [\n// { name: \"Unknown\", code: 0 },\n// { name: \"Wood\", code: 1 },\n// { name: \"Steel\", code: 2 }\n// { name: \"Reinforced Steel\", code: 3 }\n// ]\n// }\n```\n\n","completion":{"label":"Domain","detail":"Domain(features, fieldName, subtype?) -> Dictionary","insertText":"Domain(${1:features_}, ${2:fieldName_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.11](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回分配给所提供 `featureSet` 的给定字段的属性域。 如果 `featureSet` 属于子类型类,则将返回分配给该子类型的属性域。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 具有包含属性域字段的要素的 FeatureSet。\n- **fieldName**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 包含属性域的字段名称(非字段别名)。\n- **subtype** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) \\| [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 如果要素支持子类型,则为子类型的编码值。\n\n**返回值**: [Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary) \n返回以下属性描述的字典。\n\n- **type**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 属性域类型 - `codedValue` 或 `range`。\n- **name**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 属性域名称。\n- **dataType**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 属性域字段的数据类型。 可以是下列值中的一个: “esriFieldTypeSmallInteger”、“esriFieldTypeInteger”、“esriFieldTypeBigInteger”、“esriFieldTypeSingle”、“esriFieldTypeDouble”、 `esriFieldTypeString`, `esriFieldTypeDate`, `esriFieldTypeOID`, `esriFieldTypeGeometry`, `esriFieldTypeBlob`, `esriFieldTypeRaster`, `esriFieldTypeGUID`, `esriFieldTypeGlobalID`, `esriFieldTypeXML`.\n- **min**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 仅适用于 `range` 属性域。 属性域的最小值。\n- **max**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 仅适用于 `range` 属性域。 属性域的最大值。\n- **codedValues**: [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary)&gt; - 仅适用于 `codedValue` 属性域。 用于描述字段有效值的字典数组。 每个字典都有一个 `code` 属性,其中包含实际的字段值, 和一个 `name` 属性,其中包含对值的简明易懂的描述(例如 `{ code: 1, name: \\\"pavement\\\" }`)。"}},"parametersInfo":{"min":2,"max":3}},{"type":"function","name":"domaincode","bundle":"data-access","sinceVersion":"1.7","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#domaincode","description":"返回 FeatureSet 中的关联属性域描述的代码。","examples":"\n**示例**\n\n打印所参考的字段的属性域描述。\n\n```arcade\nDomainCode($layer, 'Enabled', 'True', subtype)\n```\n\n","completion":{"label":"DomainCode","detail":"DomainCode(features, fieldName, value, subtype?) -> Number,Text","insertText":"DomainCode(${1:features_}, ${2:fieldName_}, ${3:value_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.7](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回 FeatureSet 中的关联属性域描述的代码。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 具有包含属性域的字段的要素集。\n- **fieldName**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 包含属性域的字段名称(非字段别名)。\n- **value**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 将要转换回代码的值。 返回的代码来自服务元数据。\n- **subtype** (_Optional_): [Number](https://developers.arcgis.com/arcade/guide/types/#number) \\| [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 如果要素集支持子类型,则为子类型的编码编号或名称。\n\n**返回值**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) \\| [Text](https://developers.arcgis.com/arcade/guide/types/#text)"}},"parametersInfo":{"min":3,"max":4}},{"type":"function","name":"domainname","bundle":"data-access","sinceVersion":"1.7","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#domainname","description":"返回 FeatureSet 中属性域代码的描述性名称。","examples":"\n**示例**\n\n输出所参考字段的属性域描述\n\n```arcade\nDomainName($layer, 'fieldName')\n```\n\n","completion":{"label":"DomainName","detail":"DomainName(features, fieldName, code?, subtype?) -> Text","insertText":"DomainName(${1:features_}, ${2:fieldName_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.7](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回 FeatureSet 中属性域代码的描述性名称。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 具有属性域字段的 FeatureSet。\n- **fieldName**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 包含属性域的字段名称(非字段别名)。\n- **code** (_Optional_): [Number](https://developers.arcgis.com/arcade/guide/types/#number) \\| [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 与所需描述性名称相关联的代码。 返回的代码来自服务元数据。\n- **subtype** (_Optional_): [Number](https://developers.arcgis.com/arcade/guide/types/#number) \\| [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 如果 FeatureSet 支持子类型,则为子类型的编码编号或名称。\n\n**返回值**: [Text](https://developers.arcgis.com/arcade/guide/types/#text)"}},"parametersInfo":{"min":2,"max":4}},{"type":"function","name":"envelopeintersects","bundle":"data-access","sinceVersion":"1.11","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#envelopeintersects","description":"从 FeatureSet 返回要素,其中一组要素的包络(或范围)与另一个几何包络相交。 在下图中,红色突出显示了函数将返回要素的空间关系。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_","examples":"\n**示例**\n\n返回与 geom2 包络相交的要素数\n\n```arcade\nvar geom2 = Polygon({ ... });\nCount( EnvelopeIntersects($layer, geom2) );\n```\n\n","completion":{"label":"EnvelopeIntersects","detail":"EnvelopeIntersects(features, envelope) -> FeatureSet","insertText":"EnvelopeIntersects(${1:features_}, ${2:envelope_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.11](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n从 FeatureSet 返回要素,其中一组要素的包络(或范围)与另一个几何包络相交。 在下图中,红色突出显示了函数将返回要素的空间关系。\n\n_可视化和标签配置文件中的要素几何 会根据视图的比例分辨率进行概化以提高绘制性能。 因此,在这些上下文中使用要素的几何(即 `$feature`)作为任何几何函数的输入 将返回因比例级别而异的结果。 其他配置文件,例如弹出窗口,提供全分辨率几何。_\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 测试与输入 `envelope` 的相交关系的 FeatureSet。\n- **envelope**: [Geometry](https://developers.arcgis.com/arcade/guide/types/#geometry) \\| [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 被相交的包络。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"expects","bundle":"data-access","sinceVersion":"1.15","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#expects","description":"请求给定 FeatureSet 的其他属性。","examples":"\n**示例**\n\n请求聚类中要素的 POPULATION 字段\n\n```arcade\n// If the layer is clustered based on count,\n// only the OBJECTID field is requested by default.\n// To display the sum of the POPULATION field\n// for all features in the cluster, we must\n// explicitly request the POPULATION data. \nExpects($aggregatedFeatures, 'POPULATION')\nText(Sum($aggregatedFeatures, 'POPULATION'), '#,###')\n```\n\n","completion":{"label":"Expects","detail":"Expects(features, field1, [field2, ..., fieldN]?) -> Null","insertText":"Expects(${1:features_}, ${2:field1_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.15](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n请求给定 FeatureSet 的其他属性。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 将请求字段附加到的要素集。\n- **field1**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 请求给定要素的字段名称。 仅列出在表达式中使用所需的字段。 如有必要,您可以使用通配符 `*` 来请求所有字段。 但应该避免这种情况,以防止加载可能对应用程序性能产生负面影响的不必要的数据量。 该值必须是文本文字,不能是变量。\n- **[field2, ..., fieldN]** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 为给定要素请求的字段名称的正在使用的列表。 仅列出在表达式中使用所需的字段。 这些值必须是文本文字,不能是变量。\n\n**返回值**: Null"}},"parametersInfo":{"min":2,"max":-1}},[{"type":"function","name":"featureset","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featureset1","description":"根据 ArcGIS REST 规范从 JSON 创建新的 FeatureSet。 有关示例,请参见以下片段。","examples":"\n**示例**\n\n从 JSON 创建 FeatureSet。\n\n```arcade\n// JSON representation of the feature used in the snippet below\n// {\n// 'fields': [{\n// 'alias': 'RANK',\n// 'name': 'RANK',\n// 'type': 'esriFieldTypeInteger'\n// }, {\n// 'alias': 'ELEV_m',\n// 'name': 'ELEV_m',\n// 'type': 'esriFieldTypeInteger'\n// }],\n// 'spatialReference': { 'wkid': 4326 },\n// 'geometryType': 'esriGeometryPoint',\n// 'features': [{\n// 'geometry': {\n// 'spatialReference': { 'wkid': 4326 },\n// 'x': -151.0063,\n// 'y': 63.069\n// },\n// 'attributes': {\n// 'RANK': 1,\n// 'ELEV_m': 6168\n// }\n// }]\n// };\n// The Dictionary representation of the FeatureSet must be a serialized text value\nvar features = FeatureSet('{\"fields\":[{\"alias\":\"RANK\",\"name\":\"RANK\",\"type\":\"esriFieldTypeInteger\"},{\"alias\":\"ELEV_m\",\"name\":\"ELEV_m\",\"type\":\"esriFieldTypeInteger\"}],\"spatialReference\":{\"wkid\":4326},\"geometryType\":\"esriGeometryPoint\",\"features\":[{\"geometry\":{\"spatialReference\":{\"wkid\":4326},\"x\":-151.0063,\"y\":63.069},\"attributes\":{\"RANK\":1,\"ELEV_m\":6168}}]}')\n```\n\n","completion":{"label":"FeatureSet","detail":"FeatureSet(definition) -> FeatureSet","insertText":"FeatureSet(${1:definition_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n根据 ArcGIS REST 规范从 JSON 创建新的 FeatureSet。 有关示例,请参见以下片段。\n\n**参数**\n\n- **definition**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - JSON 可以描述一组要素。 JSON 必须序列化为文本值。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"featureset","bundle":"data-access","sinceVersion":"1.19","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featureset2","description":"根据 ArcGIS REST 规范,从表示 JSON 的 Dictionary 中创建一个新的 FeatureSet。 有关示例,请参见以下片段。","examples":"\n**示例**\n\n从字典创建一个 FeatureSet。\n\n```arcade\n// JSON representation of the feature used in the snippet below\nvar d = {\n fields: [{\n alias: 'RANK',\n name: 'RANK',\n type: 'esriFieldTypeInteger'\n }, {\n alias: 'ELEV_m',\n name: 'ELEV_m',\n type: 'esriFieldTypeInteger'\n }],\n spatialReference: { wkid: 4326 },\n geometryType: 'esriGeometryPoint',\n features: [{\n geometry: {\n spatialReference: { wkid: 4326 },\n x: -151.0063,\n y: 63.069\n },\n attributes: {\n RANK: 1,\n ELEV_m: 6168\n }\n }]\n };\nvar features = FeatureSet(d)\n```\n\n","completion":{"label":"FeatureSet","detail":"FeatureSet(definition) -> FeatureSet","insertText":"FeatureSet(${1:definition_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.19](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n根据 ArcGIS REST 规范,从表示 JSON 的 Dictionary 中创建一个新的 FeatureSet。 有关示例,请参见以下片段。\n\n**参数**\n\n- **definition**: [Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary) - 字典描述一组要素。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":1,"max":1}}],{"type":"function","name":"featuresetbyassociation","bundle":"data-access","sinceVersion":"1.9","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyassociation","description":"返回与输入要素相关联的所有要素作为 FeatureSet。 这特定于公共设施网络工作流。","examples":"\n**示例**\n\n将返回所有具有变压器低压侧终端连通性关联的资产。\n\n```arcade\nFeatureSetByAssociation($feature, 'connected', 'Low');\n```\n\n返回与要素相关联的电气装置数量\n\n```arcade\nvar allContent = FeatureSetByAssociation ($feature, \"content\");\nvar devicesRows = Filter(allContent, \"className = 'Electric Device'\");\nvar devicesCount = Count(devicesRows);\nreturn devicesCount;\n```\n\n","completion":{"label":"FeatureSetByAssociation","detail":"FeatureSetByAssociation(inputFeature, associationType, terminalName?) -> FeatureSet","insertText":"FeatureSetByAssociation(${1:inputFeature_}, ${2:associationType_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.9](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回与输入要素相关联的所有要素作为 FeatureSet。 这特定于公共设施网络工作流。\n\n**参数**\n\n- **inputFeature**: [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 用于查询所有关联要素的要素。 该要素必须来自要素服务;不支持要素集合。\n- **associationType**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 与要返回的要素关联的类型。 \n 可能的值: `connected` \\| `container` \\| `content` \\| `structure` \\| `attached` \n 1.10 版添加的可能值:`junctionEdge` \\| `midspan`\n- **terminalName** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 仅适用于 `connected` 关联类型。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) \n返回一个 FeatureSet,其中包含具有下表中描述的字段规范的要素。\n\n- **className**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 基于 `TONETWORKSOURCEID` 或 `FROMNETWORKSOURCEID` 值的类名称。\n- **globalId**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 其他表中要素的全局 ID(例如,`TOGLOBALID` 或 `FROMGLOBALID` 的值)。\n- **isContentVisible**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 值可以是`1`(可见)或 `0`(不可见)。 该值表示关联内容的可见性,且仅适用于包含关联。\n- **objectId**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 关联表中该行的 ObjectID。\n- **percentAlong**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 应用于 `midspan` 关联类型。 将返回 0-1 之间的浮点数值,以指示边交汇点的位置。\n- **side**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 应用于 `junctionEdge` 关联类型。 指示交汇点位于哪一侧。\n\n可能的值: `from` 或 `to`"}},"parametersInfo":{"min":2,"max":3}},{"type":"function","name":"featuresetbyid","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyid","description":"根据地图或要素服务中的图层 ID 通过要素图层创建 FeatureSet。 限制请求中的字段数并排除几何可以提高脚本的性能。","examples":"\n**示例**\n\n返回给定地图中 ID 为 DemoLayerWM_1117 的图层中的要素数。\n\n```arcade\nvar features = FeatureSetById($map,'DemoLayerWM_1117', ['*'], true);\nCount( features );\n```\n\n","completion":{"label":"FeatureSetById","detail":"FeatureSetById(featureSetCollection, id, fields?, includeGeometry?) -> FeatureSet","insertText":"FeatureSetById(${1:featureSetCollection_}, ${2:id_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n根据地图或要素服务中的图层 ID 通过要素图层创建 FeatureSet。 限制请求中的字段数并排除几何可以提高脚本的性能。\n\n**参数**\n\n- **featureSetCollection**: [FeatureSetCollection](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection) - 此地图或要素服务包含一个或多个用于创建 FeatureSet 的图层。 通常,此值为 `$map` 或 `$datastore` 全局。\n- **id**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 给定 `map` 中的图层 ID。 该图层必须从要素服务创建;不支持要素集合。 _请注意这个值必须是文字文本。_\n- **fields** (_Optional_): [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - 要包括在 FeatureSet 中的字段。 默认情况下,包含所有字段。 要请求图层中的所有字段,请将此值设置为 `['*']`。 限制字段数可以提高脚本性能。\n- **includeGeometry** (_Optional_): [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) - 指示是否在要素中包括几何。 默认为 true。 由于性能原因,您应该仅在必要时请求几何, 例如用于几何函数。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":4}},{"type":"function","name":"featuresetbyname","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyname","description":"根据地图或要素服务中的名称通过要素图层创建 FeatureSet。 请注意,此名称不一定是唯一的。 因此,使用 `FeatureSetById()` 创建 FeatureSet 更合适。 限制 FeatureSet 中的字段数并排除几何可以提高脚本的性能。","examples":"\n**示例**\n\n返回给定地图中标题为“Bike routes”的图层中的要素数。\n\n```arcade\nvar features = FeatureSetByName($map,'Bike routes', ['*'], true);\nCount(features);\n```\n\n","completion":{"label":"FeatureSetByName","detail":"FeatureSetByName(featureSetCollection, title, fields?, includeGeometry?) -> FeatureSet","insertText":"FeatureSetByName(${1:featureSetCollection_}, ${2:title_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n根据地图或要素服务中的名称通过要素图层创建 FeatureSet。 请注意,此名称不一定是唯一的。 因此,使用 `FeatureSetById()` 创建 FeatureSet 更合适。 限制 FeatureSet 中的字段数并排除几何可以提高脚本的性能。\n\n**参数**\n\n- **featureSetCollection**: [FeatureSetCollection](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection) - 此地图或要素服务包含一个或多个用于创建 FeatureSet 的图层。 通常,此值为 `$map` 或 `$datastore` 全局。\n- **title**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 给定 `map` 中的图层标题。 该图层必须从要素服务创建;不支持要素集合。 _请注意这个值必须是文字文本。_\n- **fields** (_Optional_): [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - 要包括在 FeatureSet 中的字段。 默认情况下,包含所有字段。 要请求图层中的所有字段,请将此值设置为 `['*']`。 限制字段数可以提高脚本性能。\n- **includeGeometry** (_Optional_): [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) - 指示是否在要素中包括几何。 默认为 true。 由于性能原因,您应该仅在必要时请求几何, 例如用于几何函数。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":4}},{"type":"function","name":"featuresetbyrelationshipclass","bundle":"data-access","sinceVersion":"1.24","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipclass","description":"基于给定关系类的名称返回给定要素的相关记录。","examples":"\n**示例**\n\n返回电线杆检查相关记录的计数\n\n```arcade\n// A calculation rule that returns the count of a pole inspection records.\n// When a pole feature is updated the calculation rule reads all its related inspections records from the comments field and returns the total inspection count for that feature.\nvar fsinspected = FeatureSetByRelationshipClass($feature, “pole_inspection”, [“comments”], false);\nreturn Count(fsinspected);\n```\n\n","completion":{"label":"FeatureSetByRelationshipClass","detail":"FeatureSetByRelationshipClass(inputFeature, relationshipClass, fieldNames?, includeGeometry?) -> FeatureSet","insertText":"FeatureSetByRelationshipClass(${1:inputFeature_}, ${2:relationshipClass_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.24](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n基于给定关系类的名称返回给定要素的相关记录。\n\n**参数**\n\n- **inputFeature**: [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 从中获取相关记录的要素。\n- **relationshipClass**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 数据源中定义的关系类的名称。\n- **fieldNames** (_Optional_): [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - 要在 FeatureSet 中返回的字段。 此列表包括关系表和输入要素中的字段。\n- **includeGeometry** (_Optional_): [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) - 指示是否返回结果要素的几何。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)\n\n**其他资源**\n\n* [Attribute rules and relationship classes](https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rules-and-relationship-classes.htm)\n"}},"parametersInfo":{"min":2,"max":4}},{"type":"function","name":"featuresetbyrelationshipname","bundle":"data-access","sinceVersion":"1.8","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyrelationshipname","description":"返回给定要素的相关记录作为 FeatureSet。","examples":"\n**示例**\n\n返回所有相关记录中多个字段的总和\n\n```arcade\nvar results = FeatureSetByRelationshipName($feature, 'Election_Results', ['*'], false)\nSum(results, 'democrat + republican + other')\n```\n\n","completion":{"label":"FeatureSetByRelationshipName","detail":"FeatureSetByRelationshipName(inputFeature, relationshipName, fieldNames?, includeGeometry?) -> FeatureSet","insertText":"FeatureSetByRelationshipName(${1:inputFeature_}, ${2:relationshipName_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.8](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回给定要素的相关记录作为 FeatureSet。\n\n**参数**\n\n- **inputFeature**: [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 为其获取相关记录的要素。\n- **relationshipName**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 符合与给定要素相关联的要素服务的关系名称。\n- **fieldNames** (_Optional_): [Array](https://developers.arcgis.com/arcade/guide/types/#array)&lt;[Text](https://developers.arcgis.com/arcade/guide/types/#text)&gt; - 要在 FeatureSet 中返回的字段。 此列表包括关系表和输入要素中的字段。\n- **includeGeometry** (_Optional_): [Boolean](https://developers.arcgis.com/arcade/guide/types/#boolean) - 指示是否返回结果要素的几何。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":4}},{"type":"function","name":"filter","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter","description":"使用通过 SQL92 表达式过滤器的所有要素创建新 FeatureSet。","examples":"\n**示例**\n\n使用 SQL92 表达式过滤要素\n\n```arcade\n// Returns all features with a Population greater than 10,000\nvar result = Filter($layer, 'POPULATION > 10000');\n```\n\n使用具有变量替换的 SQL92 表达式过滤要素\n\n```arcade\n// Returns all features with a Population greater than the dataset average\nvar averageValue = Average($layer, 'POPULATION')\nvar result = Filter($layer, 'POPULATION > @averageValue');\n```\n\n","completion":{"label":"Filter","detail":"Filter(features, sqlExpression) -> FeatureSet","insertText":"Filter(${1:features_}, ${2:sqlExpression_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n使用通过 SQL92 表达式过滤器的所有要素创建新 FeatureSet。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 要过滤的 FeatureSet 或图层。\n- **sqlExpression**: [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 用于过滤图层中要素的 SQL92 表达式。 该表达式可以使用 `@` 字符替换 Arcade 变量。 有关示例,请参见以下片段。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"filterbysubtypecode","bundle":"data-access","sinceVersion":"1.25","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filterbysubtypecode","description":"创建一个新的 FeatureSet,其中包含与给定子类型代码相匹配的所有要素。","examples":"\n**示例**\n\n使用子类型代码过滤要素\n\n```arcade\n// Returns all features that have the given subtype code\nFilterBySubtypeCode($layer, 5)\n```\n\n","completion":{"label":"FilterBySubtypeCode","detail":"FilterBySubtypeCode(features, subtypeCode) -> FeatureSet","insertText":"FilterBySubtypeCode(${1:features_}, ${2:subtypeCode_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.25](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n创建一个新的 FeatureSet,其中包含与给定子类型代码相匹配的所有要素。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 要过滤的 FeatureSet 或图层。\n- **subtypeCode**: [Number](https://developers.arcgis.com/arcade/guide/types/#number) - 用于过滤 FeatureSet 或图层中要素的子类型代码。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":2,"max":2}},{"type":"function","name":"first","bundle":"data-access","sinceVersion":"1.5","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#first","description":"返回 FeatureSet 中的第一个要素。 如果 FeatureSet 为空,则将返回 `null`。","examples":"\n**示例**\n\n返回图层中第一个要素的面积。\n\n```arcade\nArea( First($layer) )\n```\n\n","completion":{"label":"First","detail":"First(features) -> Feature","insertText":"First(${1:features_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.5](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回 FeatureSet 中的第一个要素。 如果 FeatureSet 为空,则将返回 `null`。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 从中返回第一个 FeatureSet 的数组。\n\n**返回值**: [Feature](https://developers.arcgis.com/arcade/guide/types/#feature)"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"gdbversion","bundle":"data-access","sinceVersion":"1.12","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#gdbversion","description":"返回分支或版本化数据的当前地理数据库版本的名称。 当数据不在多用户地理数据库中时,将返回一个空文本值。","examples":"\n**示例**\n\n返回给定 FeatureSet 的地理数据库版本\n\n```arcade\nGdbVersion($layer)\n```\n\n","completion":{"label":"GdbVersion","detail":"GdbVersion(features) -> Text","insertText":"GdbVersion(${1:features_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.12](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n返回分支或版本化数据的当前地理数据库版本的名称。 当数据不在多用户地理数据库中时,将返回一个空文本值。\n\n**参数**\n\n- **features**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 从中返回当前地理数据库版本的 FeatureSet。\n\n**返回值**: [Text](https://developers.arcgis.com/arcade/guide/types/#text)\n\n**其他资源**\n\n* [Overview of Versioning](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/overview-of-versioning-in-arcgis-pro.htm)\n"}},"parametersInfo":{"min":1,"max":1}},{"type":"function","name":"getfeatureset","bundle":"data-access","sinceVersion":"1.14","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#getfeatureset","description":"获取输入要素所属的 FeatureSet。 返回的 FeatureSet 表示输入要素的父/根图层或表中的所有要素。","examples":"\n**示例**\n\n返回表示数据源中所有要素的 FeatureSet。\n\n```arcade\n// Assume the data source for the 'Bike routes' layer has 2,000 features \n// and the user creating the map has set a definition expression on the 'Bike routes' layer that filters the layer to 100 features. \nvar fs1 = FeatureSetByName($map, 'Bike routes', ['*'], true);\nvar fs2 = top(fs1, 10) \nvar f = First(fs2)\nGetFeatureSet(f)\n// returns a FeatureSet representing the data source, which does not include the map filter (2,000 features)\n```\n\n返回要素的根 FeatureSet。\n\n```arcade\n// Assume the data source for the 'Bike routes' layer has 2,000 features \n// and the user creating the map has set a definition expression on the 'Bike routes' layer that filters the layer to 100 features. \nvar fs1 = FeatureSetByName($map, 'Bike routes', ['*'], true);\nvar fs2 = top(fs1, 10) \nvar f = First(fs2)\nGetFeatureSet(f, 'root')\n// returns the root FeatureSet, which honors the user's filter from the map (a total of 100 features)\n```\n\n返回要素的父 FeatureSet。\n\n```arcade\n// Assume the data source for the 'Bike routes' layer has 2,000 features \n// and the user creating the map has set a definition expression on the 'Bike routes' layer that filters the layer to 100 features. \nvar fs1 = FeatureSetByName($map, 'Bike routes', ['*'], true);\nvar fs2 = top(fs1, 10) \nvar f = First(fs2)\nGetFeatureSet(f, 'parent')\n// returns the parent FeatureSet, which is the result of the top function \n// (a total of 10 features)\n```\n\n返回数据源表中要素 1 英里范围内的要素数。\n\n```arcade\nvar fullFeatureSet = GetFeatureSet($feature);\nvar featuresOneMile = Intersects(fullFeatureSet, BufferGeodetic($feature, 1, 'miles'))\nCount(featuresOneMile)\n```\n\n","completion":{"label":"GetFeatureSet","detail":"GetFeatureSet(inputFeature, source?) -> FeatureSet","insertText":"GetFeatureSet(${1:inputFeature_})$0","insertTextMode":2,"insertTextFormat":2,"kind":3,"documentation":{"kind":"markdown","value":"**[起始版本 1.14](https://developers.arcgis.com/arcade/guide/version-matrix)**\n\n获取输入要素所属的 FeatureSet。 返回的 FeatureSet 表示输入要素的父/根图层或表中的所有要素。\n\n**参数**\n\n- **inputFeature**: [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 属于父或根 FeatureSet 的要素。\n- **source** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 指示要返回的源 FeatureSet。 \n可能的值:\n\n - `datasource`:(默认值)从输入要素的数据源返回未使用任何过滤器或定义表达式的所有要素,作为 FeatureSet。 \n - `root`:返回输入要素所属的初始 FeatureSet。 这可能是数据源中所有要素的过滤子集。 \n - `parent`:返回输入要素的父 FeatureSet。 这可以是比原始数据源或根 FeatureSet 更小的 FeatureSet。 \n\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)"}},"parametersInfo":{"min":1,"max":2}},{"type":"function","name":"getfeaturesetinfo","bundle":"data-access","sinceVersion":"1.18","link":"https://developers.arcgis.com/arcade/function-reference/featureset_functions/#getfeaturesetinfo","description":"返回 FeatureSet 的原始源数据库和服务(如果适用)的元数据。","examples":"\n**示例**\n\n从连接到基础要素服务的 FeatureSet 返回的元数据\n\n```arcade\n// $layer originates from a feature service layer in a web map\nGetFeatureSetInfo($layer);\n\n// returns the following: \n{\n \"layerId\": 7,\n \"layerName\": \"My Table\",\n \"itemId\": \"dda795cf2af44d2bb7af2827963b76e8\",\n \"serviceLayerUrl\": \"https://utilitynetwork.esri.com/server/rest/services/ClassicNapervilleElectric_Postgres/FeatureServer/100\",\n \"webMapLayerId\": 1,\n \"webMapLayerTitle\": \"MyTable1\",\n \"className\": null,\n \"objectClassId\": null\n}\n```\n\n从源自 filegdb 或 mobilegdb 的 FeatureSet 返回的元数据\n\n```arcade\n// $featureset originates from a feature class in a filegdb or mobilegdb\nGetFeatureSetInfo($featureset);\n\n// returns the following: \n{\n \"layerId\": null,\n \"layerName\": null,\n \"itemId\": null,\n \"serviceLayerUrl\": null,\n \"webMapLayerId\": null,\n \"webMapLayerTitle\": null,\n \"className\": \"myTable\",\n \"objectClassId\": 7\n}\n```\n\n从连接到 sde 工作空间的 FeatureSet 返回的元数据(客户端服务器直接连接)\n\n```arcade\n// Client server direct connection (sqlserv