@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 • 632 kB
JSON
[{"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://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic7922.html#i-heading-remarks)\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?, curveType?) -> 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- **curveType** (_Optional_): [Text](https://developers.arcgis.com/arcade/guide/types/#text) - 試__Since 1.31_ The type of curve to use for the geodetic area calculation_____________________________________驗. 試_If no value is provided, the default is `Geodesic`____________________________驗. \n試_Possible values___________________驗: \n 試_- `Geodesic` - Defined by the shortest distance between two points on an ellipsoid_____________________________________________驗. \n 試_- `GreatElliptic` - Defined by the intersection of a plane that contains the center of the spheroid and the spheroid surface and passes through two points. This is also known as a great circle when a sphere is used. It is not necessarily the shortest path between two points_____________________________________________________________________________________________________________________________________________驗. \n 試_- `Loxodrome` - Defined by the line of constant bearing, or azimuth, between two points. It represents a rhumb-line path on the earth that crosses each meridian at the same acute angle, thus forming a spiral that converges on the north or south pole. The Mercator projection shows loxodromes as straight lines______________________________________________________________________________________________________________________________________________________________驗. \n 試_- `NormalSection` - Defined by the intersection of a plane that passes through two points on the surface of the spheroid and is perpendicular to the surface at the first point. It is not necessarily the shortest path between two points_________________________________________________________________________________________________________________________驗. \n 試_- `ShapePreserving` - The segment shape is preserved in the projection where it is defined. This is often used in situations where maintaining the visual representation of a feature is crucial, like when working with boundaries or coastlines___________________________________________________________________________________________________________________________驗.\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://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic7922.html#i-heading-remarks)\n"}},"parametersInfo":{"min":1,"max":3}},{"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)<[Text](https://developers.arcgis.com/arcade/guide/types/#text)> - 代表要擷取之檔案類型的文字值陣列。 \n試_Possible Values: `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)<[Attachment](https://developers.arcgis.com/arcade/guide/types/#attachment)>"}},"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試_**Be aware that using `$feature` as input to this function will yield results only as precise as the view's scale resolution________________________________________________________________驗. 試_Therefore values returned from expressions using this function may change after zooming between scales.**______________________________________________________驗","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試_**Be aware that using `$feature` as input to this function will yield results only as precise as the view's scale resolution________________________________________________________________驗. 試_Therefore values returned from expressions using this function may change after zooming between scales.**______________________________________________________驗\n\n**參數**\n\n- **containerGeometry**: [Geometry](https://developers.arcgis.com/arcade/guide/types/#geometry) \\| [Feature](https://developers.arcgis.com/arcade/guide/types/#feature) - 針對 `insideFeatures` 的 'contains’ 關係測試的幾何。 請將此幾何想像成 `insideFeatures` 的可能 'container'。\n- **insideFeatures**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset) - 針對 `containerGeometry` 的 'within' 關係所測試的 FeatureSet。\n\n**返回值**: [FeatureSet](https://developers.arcgis.com/arcade/guide/types/#featureset)\n\n**其他資源**\n\n* [Contains](https://esri.github.io/geometry-api-java/doc/Contains.html)\n"}},"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 geometries in the visualization and labeling profiles________________________________驗 試_are generalized according to the view's scale resolution to improve drawing performance_____________________________________________驗. 試_Therefore, using a feature's geometry (i.e. `$feature`) as input to any geometry function in these contexts_______________________________________________________驗 試_will return different results at each scale level. Other profiles, such as popup, provide the full resolution geometry.______________________________________________________________驗","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 geometries in the visualization and labeling profiles________________________________驗 試_are generalized according to the view's scale resolution to improve drawing performance_____________________________________________驗. 試_Therefore, using a feature's geometry (i.e. `$feature`) as input to any geometry function in these contexts_______________________________________________________驗 試_will return different results at each scale level. Other profiles, such as popup, provide the full resolution geometry.______________________________________________________________驗\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)\n\n**其他資源**\n\n* [Crosses](https://esri.github.io/geometry-api-java/doc/Crosses.html)\n"}},"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使用可能包含「低」、「高」或「無」值的「密度」欄傳回 FeatureSet\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)<[Text](https://developers.arcgis.com/arcade/guide/types/#text)> \\| [Array](https://developers.arcgis.com/arcade/guide/types/#array)<[Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary)> - 從中決定唯一值的欄位和/或表達式。 此參數可以是欄位名稱陣列、表達式陣列, 或字典或字典陣列,它們指定將儲存唯一值的輸出欄名稱。 如果指定字典,必須使用以下規格:\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)<[Dictionary](https://developers.arcgis.com/arcade/guide/types/#dictionary)> - 僅適用於 `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 的字典中建立新 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 的字典中建立新 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) - 指定的「地圖」中圖層的 ID。 必須從圖徵服務建立此圖層;不支援圖徵集合。 _請注意,此值必須是文字常值。_\n- **fields** (_Optional_): [Array](https://developers.arcgis.com/arcade/guide/types/#array)<[Text](https://developers.arcgis.com/arcade/guide/types/#text)> - 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傳回指定地圖中具有「自行車車道」標題的圖層中圖徵數量。\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) - 指定的「地圖」中的圖層標題。 必須從圖徵服務建立此圖層;不支援圖徵集合。 _請注意,此值必須是文字常值。_\n- **fields** (_Optional_): [Array](https://developers.arcgis.com/arcade/guide/types/#array)<[Text](https://developers.arcgis.com/arcade/guide/types/#text)> - 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)<[Text](https://developers.arcgis.com/arcade/guide/types/#text)> - 要在 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)<[Text](https://developers.arcgis.com/arcade/guide/types/#text)> - 要在 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":"建立新圖徵集,其中包含與給定子類型代碼相符的所有圖徵。","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建立新圖徵集,其中包含與給定子類型代碼相符的所有圖徵。\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) - 用於篩選圖徵集或圖層中圖徵的子類型代碼。\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) - 從中傳回第一個圖徵的 FeatureSe。\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) - 要從中傳回目前地理資料庫版本的 FeatureSe。\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