{"id":2642652,"date":"2025-04-07T15:35:17","date_gmt":"2025-04-07T22:35:17","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2642652"},"modified":"2025-09-25T10:17:18","modified_gmt":"2025-09-25T17:17:18","slug":"attribute-rules-generate-spatial-join","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join","title":{"rendered":"Template Attribute Rules &#8211; Generate Spatial Join"},"author":365172,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[23851],"tags":[42181,302212,86442,777832],"industry":[],"product":[36561],"class_list":["post-2642652","blog","type-blog","status-publish","format-standard","hentry","category-data-management","tag-arcgis-pro","tag-attribute-rules","tag-data-management","tag-template-attribute-rules","product-arcgis-pro"],"acf":{"authors":[{"ID":365172,"user_firstname":"Mihail","user_lastname":"Kaburis","nickname":"Mihail Kaburis","user_nicename":"mkaburis","display_name":"Mihail Kaburis","user_email":"mkaburis@esri.com","user_url":"","user_registered":"2024-11-20 00:37:26","user_description":"","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/01\/uc_2024_profile_stamford-468x465.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"short_description":"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.","flexible_content":[{"acf_fc_layout":"content","content":"<p>In ArcGIS Pro 3.4 we have introduced three new <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/data\/geodatabases\/overview\/template-attribute-rules.htm\">Template Attribute Rules<\/a> that allow you to generate attribute rules tailored to specific workflows. We took some of the most commonly used attribute rules and created a geoprocessing (GP) tool experience to guide you through their creation process. This enhancement not only speeds up the generation of these rules but also makes them more accessible for users who may not have prior knowledge of Arcade scripting.<\/p>\n<p>This blog describes a workflow of creating and utilizing a Generate Spatial Join template attribute rule to determine the number of lots and average property values of a few parcels in New Haven, Connecticut.<\/p>\n<p>Spatial joins facilitate analysis and retrieval of information from multiple feature classes based on their spatial relationships. This means that an explicit attribute indicating that \u201cfeature class A is inside of feature class B\u201d is unnecessary. Instead, we utilize the inherent relationships between features to determine if they are spatially joined to one another. The spatial relationship between parcels and lots is quite intuitive: parcels <em>contain<\/em> lots.<\/p>\n<p>Here\u2019s what our data looks like (<strong><em>note:<\/em> <\/strong>the light green polygons represent parcels and the yellow polygons represent lots):<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2681222,"id":2681222,"title":"GenerateSpatialJoin_Parcels","filename":"GenerateSpatialJoin_Parcels.png","filesize":703733,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\/generatespatialjoin_parcels","alt":"","author":"365172","description":"","caption":"","name":"generatespatialjoin_parcels","status":"inherit","uploaded_to":2642652,"date":"2025-02-13 01:19:05","modified":"2025-02-13 01:19:05","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":620,"height":443,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","medium-width":365,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","medium_large-width":620,"medium_large-height":443,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","large-width":620,"large-height":443,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","1536x1536-width":620,"1536x1536-height":443,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","2048x2048-width":620,"2048x2048-height":443,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","card_image-width":620,"card_image-height":443,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_Parcels.png","wide_image-width":620,"wide_image-height":443}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>Manually counting the number of lots within each parcel and determining their respective average property values can be a tedious and error-prone process. This task becomes even more daunting when it expands beyond the few lots in a city to encompass the entire county or even a whole state such as Connecticut. Additionally with frequent changes in urban landscapes, it is crucial for parcel data to be regularly updated for taxation and planning purposes. Imagine investing significant effort to obtain precise counts, only to find that you need to recount later. Not to worry though! As GIS professionals, we have a solution to streamline this process!<\/p>\n<p>Here\u2019s a brief overview video of the Generate Spatial Join Attribute Rule tool:<\/p>\n"},{"acf_fc_layout":"kaltura","video_id":"1_ixg5uqnz","time":false,"start":0,"stop":""},{"acf_fc_layout":"content","content":"<h2><strong>Utilizing the Generate Spatial Join Tool<\/strong><\/h2>\n<h3><strong>Review Generate Spatial Join Data<\/strong><\/h3>\n<p><span class=\"TextRun SCXW245505625 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW245505625 BCX0\"><strong>Note:<\/strong>\u00a0Attribute Rules\u00a0<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">require<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">\u00a0an\u00a0<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">ArcGIS Pro\u00a0<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">S<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">tandard or\u00a0<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">A<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">dvance<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">d<\/span><span class=\"NormalTextRun SCXW245505625 BCX0\">\u00a0license level. To learn more please refer to the\u00a0<a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/get-started\/license-levels.htm\">ArcGIS Pro license levels help documentation<\/a>.<\/span><\/span><\/p>\n<ol>\n<li><span data-contrast=\"auto\">Download the\u00a0<\/span><a href=\"https:\/\/arcg.is\/0iPri9\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">TemplatedARs_SpatialJoin.ppkx<\/span><\/a><span data-contrast=\"auto\"> project package file and then click on the file to open the TemplatedARs_SpatialJoin project. This project contains the data to step through the workflow in this blog.<\/span><\/li>\n<li>The project opens with the New Haven Lots and Parcels map active. The map contains two polygon feature classes representing lots and parcels.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>Let\u2019s go ahead and determine the number of parcels and average property values within the example data.<\/p>\n<p>The first thing we are going to want to do is right click on the Parcels layer in the Table of Contents pane and select <strong>Data Design<\/strong> <strong>&gt; Attribute Rules <\/strong>to open the Attribute Rules Data Design View.<\/p>\n<p>In the Attribute Rules tab of the ribbon click on the bottom half of the Calculation Rules button. In the Context Menu go to <strong>Templates &gt; Generate Spatial Join<\/strong>.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2718712,"id":2718712,"title":"GenerateSpatialJoin_TemplateOption","filename":"GenerateSpatialJoin_TemplateOption.png","filesize":46599,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\/generatespatialjoin_templateoption","alt":"","author":"365172","description":"","caption":"","name":"generatespatialjoin_templateoption","status":"inherit","uploaded_to":2642652,"date":"2025-03-05 22:56:08","modified":"2025-03-05 22:56:08","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":460,"height":231,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","medium-width":460,"medium-height":231,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","medium_large-width":460,"medium_large-height":231,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","large-width":460,"large-height":231,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","1536x1536-width":460,"1536x1536-height":231,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","2048x2048-width":460,"2048x2048-height":231,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","card_image-width":460,"card_image-height":231,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/02\/GenerateSpatialJoin_TemplateOption.png","wide_image-width":460,"wide_image-height":231}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>The Generate Spatial Join Attribute Rule GP tool dialog opens. Accessing the tool via the Attribute Rules Data Design View automatically selects the Parcels feature class as the <strong>Input Table <\/strong>for which the attribute rule will be created on.<\/p>\n<h3><strong>Tool Overview<\/strong><\/h3>\n"},{"acf_fc_layout":"image","image":{"ID":2718732,"id":2718732,"title":"GenerateSpatialJoin_ToolUI","filename":"GenerateSpatialJoin_ToolUI.png","filesize":31655,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\/generatespatialjoin_toolui","alt":"","author":"365172","description":"","caption":"","name":"generatespatialjoin_toolui","status":"inherit","uploaded_to":2642652,"date":"2025-03-05 22:58:08","modified":"2025-03-05 22:58:08","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":398,"height":590,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","medium-width":176,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","medium_large-width":398,"medium_large-height":590,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","large-width":398,"large-height":590,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","1536x1536-width":398,"1536x1536-height":590,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","2048x2048-width":398,"2048x2048-height":590,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI-314x465.png","card_image-width":314,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ToolUI.png","wide_image-width":398,"wide_image-height":590}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>Here are the parameters for the tool and how we\u2019ll fill them out:<\/p>\n<ol>\n<li>The optional <strong>Expression<\/strong> parameter allows us to specify a SQL expression to restrict which features from the Input Table participate with the attribute rule. Since we want all of the Parcel features to participate in the spatial joins, we\u2019ll leave this parameter with the default settings.<\/li>\n<li>The <strong>Join Classes<\/strong> parameter represents the attributes from the join features that will be joined to the attributes of the input features. Go ahead and select the Lots class. To keep things straightforward, we are using a single join class but we could have more!<\/li>\n<li>The <strong>Field Map<\/strong> parameter is next. It controls the mapping of fields from the Join Classes parameter to the Input Table parameter. It might look daunting, but don\u2019t be alarmed! Think of the field mappings as the linkages between the attributes from the Lots feature class to those in our Parcels class.\n<ol type=\"a\">\n<li>There are two objectives in our analysis:\n<ol>\n<li>Count the number of lots within each parcel.<\/li>\n<li>Find the average property value of lots within each parcel.<\/li>\n<\/ol>\n<\/li>\n<li><strong>Note:<\/strong> The Generate Spatial Join Attribute Rule Tool will automatically create new fields added to the field maps in the Input Table feature class.<\/li>\n<li>In the Field Map parameter go ahead and select the <strong>Edit <\/strong> In the Fields list go and select all the fields and click the <strong>Remove <\/strong>button\u2026bam we have a clean slate!<\/li>\n<li>Click on the dropdown arrow next <strong>Add Fields<\/strong> button and click <strong>Add Empty Field<\/strong>. Name the field NumberOfLots. Change the type to <strong>Long<\/strong>. For the <strong>Actions <\/strong>dropdown select <strong>Count<\/strong>. For the <strong>Source Fields<\/strong> choose OBJECTID<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2718782,"id":2718782,"title":"GenerateSpatialJoin_FieldMap","filename":"GenerateSpatialJoin_FieldMap.png","filesize":42973,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\/generatespatialjoin_fieldmap","alt":"","author":"365172","description":"","caption":"","name":"generatespatialjoin_fieldmap","status":"inherit","uploaded_to":2642652,"date":"2025-03-05 23:13:11","modified":"2025-03-05 23:13:11","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":553,"height":345,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","medium-width":418,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","medium_large-width":553,"medium_large-height":345,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","large-width":553,"large-height":345,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","1536x1536-width":553,"1536x1536-height":345,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","2048x2048-width":553,"2048x2048-height":345,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","card_image-width":553,"card_image-height":345,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap.png","wide_image-width":553,"wide_image-height":345}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p style=\"padding-left: 40px\">e. Now let\u2019s create a Field Map for average property values within each parcel. Click on the dropdown arrow next to the <strong>Add Fields<\/strong> button again and click <strong>Add Empty Field<\/strong>. Name the field AvgPropertyValue. Change the Type to <strong>Double<\/strong>. Under the <strong>Actions<\/strong> dropdown select <strong>Mean<\/strong>. For <strong>Source Fields<\/strong> choose <strong>PropertyValue<\/strong>.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2726622,"id":2726622,"title":"GenerateSpatialJoin_FieldMap_AvgPropertyValue","filename":"GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","filesize":55664,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\/generatespatialjoin_fieldmap_avgpropertyvalue","alt":"","author":"365172","description":"","caption":"","name":"generatespatialjoin_fieldmap_avgpropertyvalue","status":"inherit","uploaded_to":2642652,"date":"2025-03-10 23:36:05","modified":"2025-03-10 23:36:05","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":998,"height":620,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","medium-width":420,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","medium_large-width":768,"medium_large-height":477,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","large-width":998,"large-height":620,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","1536x1536-width":998,"1536x1536-height":620,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","2048x2048-width":998,"2048x2048-height":620,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue-749x465.png","card_image-width":749,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_FieldMap_AvgPropertyValue.png","wide_image-width":998,"wide_image-height":620}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<ol start=\"4\">\n<li>The optional <strong>Search Options <\/strong>parameter allows us to define the spatial queries from the Input Table and Join Classes parameter values. Every Join Class gets its own set of Search Options parameters.\n<ol type=\"a\">\n<li>The <strong>Join Class<\/strong> is the name of the class that the spatial query will be run on.<\/li>\n<li>The <strong>Input Geometry Type<\/strong> is the portion of the input geometry that will be used to query the join class. There are four geometry types:\n<ol type=\"i\">\n<li><strong>Geometry <\/strong>\u2013 the complete geometry of the input feature. This is default. For our example we will choose this geometry type.<\/li>\n<li><strong>Start<\/strong> \u2013 The first vertex within a polyline feature. (Note: this option is only available on join classes that are polylines).<\/li>\n<li><strong>End<\/strong> \u2013 The last vertex within a polyline feature. (Note: this option is only available on join classes that are polylines).<\/li>\n<li><strong>Centroid<\/strong> \u2013 The geometric center of the input feature.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ol start=\"3\" type=\"a\">\n<li style=\"list-style-type: none\">\n<ol start=\"3\" type=\"a\">\n<li>The <strong>Spatial Operator<\/strong> is the spatial operation that will be used in the query. There are several spatial operators available:\n<ol type=\"i\">\n<li><strong>Intersects <\/strong>\u2013 Features in the join class will be matched if they intersect with an input feature. This is default.<\/li>\n<li><strong>Crosses <\/strong>\u2013 Features in the join class will be matched if they cross with an input feature.<\/li>\n<li><strong>Contains<\/strong> \u2013 Features in the join class will be matched if an input feature contains the joined class features. This is the opposite of the Within option.\n<ul>\n<li>The spatial relationship in our example is based on the notion that a parcel <em>contains <\/em>lots so we&#8217;ll choose it as the Spatial Operator for our example.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<ol start=\"4\" type=\"i\">\n<li><strong>Envelope_Intersects<\/strong> \u2013 Features in the join class will be matched if their bounding boxes (envelopes) intersect with the bounding box of an input feature.<\/li>\n<li><strong>Overlaps<\/strong> \u2013 Features in the join class will be matched if they overlap with an input feature. The join class features are not completely contained by the input features.<\/li>\n<li><strong>Touches<\/strong> \u2013 Features in the join class will be matched if they have a boundary that touches an input feature. When the input and join features are polylines or polygons, the boundary of the join feature can only touch the boundary of the input feature and no part of the join feature can cross the boundary of the input feature.<\/li>\n<li><strong>Within<\/strong> \u2013 Features in the join class will be matched if an input feature is within them. This is the opposite of the Contains option.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ol start=\"4\" type=\"a\">\n<li>The <strong>Search Distance<\/strong> is the distance from the geometry that will be included in the query. To keep things simple, we will not specify a search distance (this is default). This means that there is no buffer between input features and join features for which they can be matched on.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n"},{"acf_fc_layout":"content","content":"<h3><strong>Review and Modify the Generated Rule<\/strong><\/h3>\n<p>Click on the <strong>OK<\/strong> button at the bottom of the dialog to generate the spatial join template attribute rule.<\/p>\n<p>In the Attribute Rules Data Design View, you should now see a new attribute rule called Spatial Join. Let\u2019s rename it to \u201cSpatial Join &#8211; Appraise Parcels\u201d. In the <strong>Details Pane<\/strong> add a description for the rule such as the following: \u201cDetermine the number of lots and the average property value within each parcel.\u201d<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":2719032,"id":2719032,"title":"GenerateSpatialJoin_ARDesignView","filename":"GenerateSpatialJoin_ARDesignView.png","filesize":34652,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\/generatespatialjoin_ardesignview","alt":"","author":"365172","description":"","caption":"","name":"generatespatialjoin_ardesignview","status":"inherit","uploaded_to":2642652,"date":"2025-03-06 00:13:49","modified":"2025-03-06 00:13:49","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":690,"height":146,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView-213x146.png","thumbnail-width":213,"thumbnail-height":146,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","medium-width":464,"medium-height":98,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","medium_large-width":690,"medium_large-height":146,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","large-width":690,"large-height":146,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","1536x1536-width":690,"1536x1536-height":146,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","2048x2048-width":690,"2048x2048-height":146,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","card_image-width":690,"card_image-height":146,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/03\/GenerateSpatialJoin_ARDesignView.png","wide_image-width":690,"wide_image-height":146}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>If you scroll down to the script expression in the Details Pane you can see the Arcade Script that was generated. It looks like this:<\/p>\n<p>&nbsp;<\/p>\n<details>\n<summary><strong>Click here to view a Generate Spatial Join Template Attribute Rule Arcade Expression<\/strong><\/summary>\n<pre><code style=\"color: #24292e;background: #F5F5F5;padding: 1em\"><span style=\"color: #6a737d\">\/* \r\nfield_mappings (Array): Source and target field mappings.\r\n  source_field (Text): The source field to be populated.\r\n  action (Text): The action to apply on the source fields. Count\/First\/Last\/Join\/Min\/Max\/Mean\/Range\/Sum\/StDev\/Mode.\r\n  delimiter (Text): The delimiter to join multiple fields when the action is 'Join'.\r\n  field_map (Array): The target classes and fields.\r\n    class_name (Text): The unique name referencing the target class.\r\n    target_fields (Array): The target field(s) to populate source_field.\r\ntarget_classes (Array): Target classes and search options.\r\n  class_name (Text): The unique name referencing the target class.\r\n  where_clause (Text): The optional string to filter class_name.\r\n  order_by_clause (Text): The optional string to apply ASC\/DESC sorting on class_name.\r\n  spatial_operator (Text): The optional string for spatial filtering. Intersects\/Within.\r\n  search_distance (Number): The optional buffer distance to apply to spatial_operator.\r\n  search_units (Text): The optional units to apply to search_distance.\r\n  input_geometry (Geometry): The optional shape to use for spatial querying.\r\n*\/<\/span>\r\n<span style=\"color: #d73a49\">var<\/span> rule_settings = {\r\n  <span style=\"color: #032f62\">'where_clause'<\/span>: <span style=\"color: #005cc5\">null<\/span>,\r\n  <span style=\"color: #032f62\">'field_mappings'<\/span>: [\r\n    {\r\n      <span style=\"color: #032f62\">'source_field'<\/span>: <span style=\"color: #032f62\">'NumberOfLots'<\/span>,\r\n      <span style=\"color: #032f62\">'action'<\/span>: <span style=\"color: #032f62\">'Count'<\/span>,\r\n      <span style=\"color: #032f62\">'delimiter'<\/span>: <span style=\"color: #032f62\">''<\/span>,\r\n      <span style=\"color: #032f62\">'field_map'<\/span>: [\r\n        {\r\n          <span style=\"color: #032f62\">'class_name'<\/span>: <span style=\"color: #032f62\">'Lots'<\/span>,\r\n          <span style=\"color: #032f62\">'target_fields'<\/span>: [\r\n            <span style=\"color: #032f62\">'OBJECTID'<\/span>,\r\n          ],\r\n        },\r\n      ],\r\n    },\r\n    {\r\n      <span style=\"color: #032f62\">'source_field'<\/span>: <span style=\"color: #032f62\">'AvgPropertyValue'<\/span>,\r\n      <span style=\"color: #032f62\">'action'<\/span>: <span style=\"color: #032f62\">'Mean'<\/span>,\r\n      <span style=\"color: #032f62\">'delimiter'<\/span>: <span style=\"color: #032f62\">''<\/span>,\r\n      <span style=\"color: #032f62\">'field_map'<\/span>: [\r\n        {\r\n          <span style=\"color: #032f62\">'class_name'<\/span>: <span style=\"color: #032f62\">'Lots'<\/span>,\r\n          <span style=\"color: #032f62\">'target_fields'<\/span>: [\r\n            <span style=\"color: #032f62\">'PropertyValue'<\/span>,\r\n          ],\r\n        },\r\n      ],\r\n    },\r\n  ],\r\n  <span style=\"color: #032f62\">'target_classes'<\/span>: [\r\n    {\r\n      <span style=\"color: #032f62\">'class_name'<\/span>: <span style=\"color: #032f62\">'Lots'<\/span>,\r\n      <span style=\"color: #032f62\">'where_clause'<\/span>: <span style=\"color: #005cc5\">null<\/span>,\r\n      <span style=\"color: #032f62\">'order_by_clause'<\/span>: <span style=\"color: #032f62\">'objectid ASC'<\/span>,\r\n      <span style=\"color: #032f62\">'spatial_operator'<\/span>: <span style=\"color: #032f62\">'Contains'<\/span>,\r\n      <span style=\"color: #032f62\">'search_distance'<\/span>: <span style=\"color: #005cc5\">null<\/span>,\r\n      <span style=\"color: #032f62\">'search_units'<\/span>: <span style=\"color: #005cc5\">null<\/span>,\r\n      <span style=\"color: #032f62\">'input_geometry'<\/span>: <span style=\"color: #e36209\">Geometry<\/span>(<span style=\"color: #e36209\">$feature<\/span>),\r\n    },\r\n  ],\r\n};\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">get_feature_set<\/span>(key) {\r\n  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Decode<\/span>(\r\n    key,\r\n    <span style=\"color: #032f62\">'Lots'<\/span>, <span style=\"color: #e36209\">FeatureSetByName<\/span>(<span style=\"color: #e36209\">$datastore<\/span>, <span style=\"color: #032f62\">'main.Lots'<\/span>, [<span style=\"color: #032f62\">'OBJECTID'<\/span>, <span style=\"color: #032f62\">'PropertyValue'<\/span>], <span style=\"color: #005cc5\">false<\/span>),\r\n    <span style=\"color: #005cc5\">null<\/span>\r\n  );\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">IsEmpty2<\/span>(value) {\r\n  <span style=\"color: #d73a49\">var<\/span> type = <span style=\"color: #e36209\">TypeOf<\/span>(value);\r\n  <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">''<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">true<\/span>; <span style=\"color: #6a737d\">\/\/ null<\/span>\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Boolean'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> !value;\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'String'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">IsEmpty<\/span>(value);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (\r\n    (type == <span style=\"color: #032f62\">'Array'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'Dictionary'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'FeatureSet'<\/span>)\r\n  ) {\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> x <span style=\"color: #d73a49\">in<\/span> value) {\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">false<\/span>;\r\n    }\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">true<\/span>;\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Number'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">IsNan<\/span>(value);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Point'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">IsNan<\/span>(value.x);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Multipoint'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Count<\/span>(value.points) == <span style=\"color: #005cc5\">0<\/span>;\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Polyline'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Count<\/span>(value.paths) == <span style=\"color: #005cc5\">0<\/span>;\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Polygon'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Count<\/span>(value.rings) == <span style=\"color: #005cc5\">0<\/span>;\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (type == <span style=\"color: #032f62\">'Extent'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">IsNan<\/span>(value.xmin);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (\r\n    (type == <span style=\"color: #032f62\">'Feature'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'DateOnly'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'Time'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'Date'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'FeatureSetCollection'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'Portal'<\/span>) ||\r\n    (type == <span style=\"color: #032f62\">'Function'<\/span>)\r\n  ) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">false<\/span>\r\n  }\r\n  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">features_to_featureset<\/span>(features) {\r\n  <span style=\"color: #6a737d\">\/\/ Converts features array to feature set.<\/span>\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">TypeOf<\/span>(features) == <span style=\"color: #032f62\">'FeatureSet'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> features;\r\n  }\r\n  <span style=\"color: #d73a49\">var<\/span> rows = [];\r\n  <span style=\"color: #d73a49\">var<\/span> feat, feat_dict;\r\n  <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> i <span style=\"color: #d73a49\">in<\/span> features) {\r\n    feat = features[i];\r\n    feat_dict = {\r\n      <span style=\"color: #032f62\">'__oid__'<\/span>: i + <span style=\"color: #005cc5\">1<\/span>, <span style=\"color: #6a737d\">\/\/ Incrementing OID field.<\/span>\r\n    };\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> j <span style=\"color: #d73a49\">in<\/span> feat) {\r\n      feat_dict[j] = feat[j];\r\n    }\r\n    <span style=\"color: #e36209\">Push<\/span>(rows, {\r\n      <span style=\"color: #032f62\">'attributes'<\/span>: feat_dict,\r\n    });\r\n  }\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">IsEmpty<\/span>(feat)) {\r\n    <span style=\"color: #d73a49\">return<\/span>;\r\n  }\r\n\r\n  <span style=\"color: #6a737d\">\/\/ Add OID field to schema.<\/span>\r\n  <span style=\"color: #d73a49\">var<\/span> feat_schema = <span style=\"color: #e36209\">Array<\/span>(<span style=\"color: #e36209\">Schema<\/span>(feat).fields);\r\n  <span style=\"color: #e36209\">Push<\/span>(feat_schema, {\r\n    <span style=\"color: #032f62\">'name'<\/span>: <span style=\"color: #032f62\">'__oid__'<\/span>,\r\n    <span style=\"color: #032f62\">'type'<\/span>: <span style=\"color: #032f62\">'esriFieldTypeInteger'<\/span>,\r\n  });\r\n  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">FeatureSet<\/span>({\r\n    <span style=\"color: #032f62\">'fields'<\/span>: feat_schema,\r\n    <span style=\"color: #032f62\">'features'<\/span>: rows,\r\n  });\r\n\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">count_features<\/span>(features, where_clause) {\r\n  <span style=\"color: #6a737d\">\/\/ count features that match where_clause<\/span>\r\n  <span style=\"color: #d73a49\">if<\/span> (IsEmpty2(features)) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">0<\/span>;\r\n  }\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">IsEmpty<\/span>(where_clause)) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Count<\/span>(features);\r\n  }\r\n  <span style=\"color: #d73a49\">var<\/span> fs = features_to_featureset(features);\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">IsEmpty<\/span>(fs)) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">0<\/span>;\r\n  }\r\n  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Count<\/span>(<span style=\"color: #e36209\">Filter<\/span>(fs, where_clause));\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">not_null<\/span>(x) {\r\n  <span style=\"color: #d73a49\">return<\/span> x != <span style=\"color: #005cc5\">null<\/span>;\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">get_unit_code<\/span>(unit) {\r\n  <span style=\"color: #6a737d\">\/\/ Converts unit string to unit code<\/span>\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">IsEmpty<\/span>(unit)) {\r\n    <span style=\"color: #d73a49\">return<\/span>\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">var<\/span> u = <span style=\"color: #e36209\">Lower<\/span>(<span style=\"color: #e36209\">Replace<\/span>(<span style=\"color: #e36209\">Replace<\/span>(<span style=\"color: #e36209\">Replace<\/span>(unit, <span style=\"color: #032f62\">' '<\/span>, <span style=\"color: #032f62\">''<\/span>), <span style=\"color: #032f62\">'-'<\/span>, <span style=\"color: #032f62\">''<\/span>), <span style=\"color: #032f62\">'_'<\/span>, <span style=\"color: #032f62\">''<\/span>));\r\n  <span style=\"color: #6a737d\">\/\/ US \/ INT suffix differentiates the unit code. If no suffix, then it defaults to US Survey.<\/span>\r\n  <span style=\"color: #d73a49\">var<\/span> international = <span style=\"color: #005cc5\">false<\/span>;\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">Right<\/span>(u, <span style=\"color: #005cc5\">2<\/span>) == <span style=\"color: #032f62\">'us'<\/span>) {\r\n    u = <span style=\"color: #e36209\">Left<\/span>(u, <span style=\"color: #e36209\">Count<\/span>(u) - <span style=\"color: #005cc5\">2<\/span>);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">Right<\/span>(u, <span style=\"color: #005cc5\">3<\/span>) == <span style=\"color: #032f62\">'int'<\/span> &amp;&amp; u != <span style=\"color: #032f62\">'point'<\/span>) {\r\n    u = <span style=\"color: #e36209\">Left<\/span>(u, <span style=\"color: #e36209\">Count<\/span>(u) - <span style=\"color: #005cc5\">3<\/span>);\r\n    international = <span style=\"color: #005cc5\">true<\/span>;\r\n  }\r\n  <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #e36209\">Right<\/span>(u, <span style=\"color: #005cc5\">1<\/span>) == <span style=\"color: #032f62\">'s'<\/span> &amp;&amp; u != <span style=\"color: #032f62\">'inches'<\/span>) { <span style=\"color: #6a737d\">\/\/ plural<\/span>\r\n    u = <span style=\"color: #e36209\">Left<\/span>(u, <span style=\"color: #e36209\">Count<\/span>(u) - <span style=\"color: #005cc5\">1<\/span>);\r\n  }\r\n  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">When<\/span>(\r\n    <span style=\"color: #6a737d\">\/\/ Metric<\/span>\r\n    u == <span style=\"color: #032f62\">'km'<\/span> || u == <span style=\"color: #032f62\">'kilometer'<\/span>, <span style=\"color: #005cc5\">9036<\/span>,\r\n    u == <span style=\"color: #032f62\">'m'<\/span> || u == <span style=\"color: #032f62\">'meter'<\/span>, <span style=\"color: #005cc5\">9001<\/span>,\r\n    u == <span style=\"color: #032f62\">'dm'<\/span> || u == <span style=\"color: #032f62\">'decimeter'<\/span>, <span style=\"color: #005cc5\">109005<\/span>,\r\n    u == <span style=\"color: #032f62\">'cm'<\/span> || u == <span style=\"color: #032f62\">'centimeter'<\/span>, <span style=\"color: #005cc5\">1033<\/span>,\r\n    u == <span style=\"color: #032f62\">'mm'<\/span> || u == <span style=\"color: #032f62\">'millimeter'<\/span>, <span style=\"color: #005cc5\">1025<\/span>,\r\n\r\n    <span style=\"color: #6a737d\">\/\/ US Survey \/ International<\/span>\r\n    u == <span style=\"color: #032f62\">'nmi'<\/span> || u == <span style=\"color: #032f62\">'nauticalmile'<\/span>, <span style=\"color: #e36209\">IIf<\/span>(international, <span style=\"color: #005cc5\">9030<\/span>, <span style=\"color: #005cc5\">109012<\/span>),\r\n    u == <span style=\"color: #032f62\">'mi'<\/span> || u == <span style=\"color: #032f62\">'mile'<\/span>, <span style=\"color: #e36209\">IIf<\/span>(international, <span style=\"color: #005cc5\">9093<\/span>, <span style=\"color: #005cc5\">9035<\/span>),\r\n    u == <span style=\"color: #032f62\">'yd'<\/span> || u == <span style=\"color: #032f62\">'yard'<\/span>, <span style=\"color: #e36209\">IIf<\/span>(international, <span style=\"color: #005cc5\">9096<\/span>, <span style=\"color: #005cc5\">109002<\/span>),\r\n    u == <span style=\"color: #032f62\">'ft'<\/span> || u == <span style=\"color: #032f62\">'foot'<\/span> || u == <span style=\"color: #032f62\">'feet'<\/span>, <span style=\"color: #e36209\">IIf<\/span>(international, <span style=\"color: #005cc5\">9002<\/span>, <span style=\"color: #005cc5\">9003<\/span>),\r\n    u == <span style=\"color: #032f62\">'in'<\/span> || u == <span style=\"color: #032f62\">'inch'<\/span> || u == <span style=\"color: #032f62\">'inches'<\/span>, <span style=\"color: #e36209\">IIf<\/span>(international, <span style=\"color: #005cc5\">109008<\/span>, <span style=\"color: #005cc5\">109009<\/span>),\r\n\r\n    <span style=\"color: #6a737d\">\/\/ Misc<\/span>\r\n    u == <span style=\"color: #032f62\">'dd'<\/span> || u == <span style=\"color: #032f62\">'deg'<\/span> || u == <span style=\"color: #032f62\">'degree'<\/span> || u == <span style=\"color: #032f62\">'decimaldegree'<\/span>, <span style=\"color: #005cc5\">9102<\/span>,\r\n    u == <span style=\"color: #032f62\">'pt'<\/span> || u == <span style=\"color: #032f62\">'point'<\/span>, <span style=\"color: #005cc5\">109016<\/span>,\r\n\r\n    <span style=\"color: #6a737d\">\/\/ Default<\/span>\r\n    <span style=\"color: #005cc5\">null<\/span>,\r\n  )\r\n\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">transpose_feature_set<\/span>(feature_set) {\r\n  <span style=\"color: #6a737d\">\/\/ Converts a feature set (row-store) to a dictionary of rows (column-store)<\/span>\r\n\r\n  <span style=\"color: #6a737d\">\/\/ Get the field names from the FeatureSet and create an array of arrays of the same length.<\/span>\r\n  <span style=\"color: #d73a49\">var<\/span> columns = [];\r\n  <span style=\"color: #d73a49\">var<\/span> fields = [];\r\n  <span style=\"color: #d73a49\">var<\/span> field_info = <span style=\"color: #e36209\">Schema<\/span>(feature_set).fields;\r\n  <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> i <span style=\"color: #d73a49\">in<\/span> field_info) {\r\n    <span style=\"color: #e36209\">Push<\/span>(columns, []);\r\n    <span style=\"color: #e36209\">Push<\/span>(fields, field_info[i].name);\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> row <span style=\"color: #d73a49\">in<\/span> feature_set) {\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> j <span style=\"color: #d73a49\">in<\/span> fields) {\r\n      <span style=\"color: #e36209\">Push<\/span>(columns[j], row[fields[j]]);\r\n    }\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">var<\/span> lookup = {};\r\n  <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> k <span style=\"color: #d73a49\">in<\/span> fields) {\r\n    lookup[fields[k]] = columns[k];\r\n  }\r\n  <span style=\"color: #d73a49\">return<\/span> lookup;\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">apply_merge_rule<\/span>(rule, delimiter, data) {\r\n  <span style=\"color: #6a737d\">\/\/ Applies rule to data array<\/span>\r\n\r\n  <span style=\"color: #6a737d\">\/\/ Nulls are always excluded from calculations.<\/span>\r\n  data = <span style=\"color: #e36209\">Filter<\/span>(data, not_null);\r\n  <span style=\"color: #d73a49\">if<\/span> (IsEmpty2(data)) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n  }\r\n\r\n  <span style=\"color: #6a737d\">\/\/ Assume array is a homogenous data type.<\/span>\r\n  <span style=\"color: #d73a49\">var<\/span> first_val = data[<span style=\"color: #005cc5\">0<\/span>];\r\n  <span style=\"color: #d73a49\">var<\/span> data_type = <span style=\"color: #e36209\">TypeOf<\/span>(data[<span style=\"color: #005cc5\">0<\/span>]);\r\n\r\n  <span style=\"color: #d73a49\">var<\/span> DateFunc = <span style=\"color: #e36209\">Decode<\/span>(data_type, <span style=\"color: #032f62\">'Date'<\/span>, <span style=\"color: #e36209\">Date<\/span>, <span style=\"color: #032f62\">'DateOnly'<\/span>, <span style=\"color: #e36209\">DateOnly<\/span>, <span style=\"color: #032f62\">'Time'<\/span>, <span style=\"color: #e36209\">Time<\/span>, <span style=\"color: #005cc5\">null<\/span>);\r\n  <span style=\"color: #d73a49\">var<\/span> StatFunc = <span style=\"color: #e36209\">Decode<\/span>(rule, <span style=\"color: #032f62\">'Min'<\/span>, <span style=\"color: #e36209\">Min<\/span>, <span style=\"color: #032f62\">'Max'<\/span>, <span style=\"color: #e36209\">Max<\/span>, <span style=\"color: #032f62\">'Mean'<\/span>, <span style=\"color: #e36209\">Average<\/span>, <span style=\"color: #005cc5\">null<\/span>);\r\n\r\n  <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Count'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Count<\/span>(data);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'First'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> data[<span style=\"color: #005cc5\">0<\/span>];\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Last'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> data[<span style=\"color: #005cc5\">-1<\/span>];\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Join'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Concatenate<\/span>(data, delimiter);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (StatFunc != <span style=\"color: #005cc5\">null<\/span>) {\r\n    <span style=\"color: #d73a49\">if<\/span> (data_type == <span style=\"color: #032f62\">'Number'<\/span>) {\r\n      <span style=\"color: #d73a49\">return<\/span> StatFunc(data);\r\n    } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (DateFunc != <span style=\"color: #005cc5\">null<\/span>) {\r\n      <span style=\"color: #6a737d\">\/\/ Convert dates to number for statistic and then back to date.<\/span>\r\n      <span style=\"color: #d73a49\">var<\/span> date_val = DateFunc(StatFunc(<span style=\"color: #e36209\">Map<\/span>(data, <span style=\"color: #e36209\">Number<\/span>)));\r\n      <span style=\"color: #d73a49\">if<\/span> (data_type == <span style=\"color: #032f62\">'Date'<\/span>) {\r\n        <span style=\"color: #6a737d\">\/\/ Remove timezone if input is na\u00efve, otherwise convert to UTC.<\/span>\r\n        <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">IIf<\/span>(\r\n          <span style=\"color: #e36209\">TimeZone<\/span>(first_val) == <span style=\"color: #032f62\">'Unknown'<\/span>,\r\n          <span style=\"color: #e36209\">ChangeTimeZone<\/span>(<span style=\"color: #e36209\">ToUTC<\/span>(date_val), <span style=\"color: #032f62\">'Unknown'<\/span>),\r\n          <span style=\"color: #e36209\">ToUTC<\/span>(date_val)\r\n        );\r\n      } <span style=\"color: #d73a49\">else<\/span> {\r\n        <span style=\"color: #d73a49\">return<\/span> date_val;\r\n      }\r\n    } <span style=\"color: #d73a49\">else<\/span> {\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n    }\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Range'<\/span>) {\r\n    <span style=\"color: #d73a49\">if<\/span> (data_type == <span style=\"color: #032f62\">'Number'<\/span>) {\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Max<\/span>(data) - <span style=\"color: #e36209\">Min<\/span>(data);\r\n    } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (data_type == <span style=\"color: #032f62\">'Time'<\/span>) {\r\n      <span style=\"color: #d73a49\">var<\/span> total_ms = <span style=\"color: #e36209\">Map<\/span>(data, <span style=\"color: #e36209\">Number<\/span>);\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Time<\/span>(<span style=\"color: #e36209\">Max<\/span>(total_ms) - <span style=\"color: #e36209\">Min<\/span>(total_ms));\r\n    } <span style=\"color: #d73a49\">else<\/span> {\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n    }\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Sum'<\/span>) {\r\n    <span style=\"color: #d73a49\">if<\/span> (data_type == <span style=\"color: #032f62\">'Number'<\/span>) {\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">Sum<\/span>(data);\r\n    } <span style=\"color: #d73a49\">else<\/span> {\r\n      <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n    }\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">if<\/span> (data_type != <span style=\"color: #032f62\">'Number'<\/span>) {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">var<\/span> val;\r\n  <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'StDev'<\/span>) {\r\n    val = <span style=\"color: #e36209\">StDev<\/span>(data);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Median'<\/span>) {\r\n    data = <span style=\"color: #e36209\">Sort<\/span>(data);\r\n    <span style=\"color: #d73a49\">var<\/span> n = <span style=\"color: #e36209\">Count<\/span>(data);\r\n    val = <span style=\"color: #e36209\">IIf<\/span>(n % <span style=\"color: #005cc5\">2<\/span> == <span style=\"color: #005cc5\">0<\/span>, <span style=\"color: #e36209\">Average<\/span>(data[n \/ <span style=\"color: #005cc5\">2<\/span> - <span style=\"color: #005cc5\">1<\/span>], data[n \/ <span style=\"color: #005cc5\">2<\/span>]), data[(n - <span style=\"color: #005cc5\">1<\/span>) \/ <span style=\"color: #005cc5\">2<\/span>]);\r\n  } <span style=\"color: #d73a49\">else<\/span> <span style=\"color: #d73a49\">if<\/span> (rule == <span style=\"color: #032f62\">'Mode'<\/span>) {\r\n    data = <span style=\"color: #e36209\">Sort<\/span>(data);\r\n    <span style=\"color: #d73a49\">var<\/span> counter = <span style=\"color: #005cc5\">0<\/span>;\r\n    <span style=\"color: #d73a49\">var<\/span> prev = data[<span style=\"color: #005cc5\">0<\/span>];\r\n    <span style=\"color: #d73a49\">var<\/span> hi_count = <span style=\"color: #005cc5\">1<\/span>;\r\n    <span style=\"color: #d73a49\">var<\/span> hi_val = prev;\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> i <span style=\"color: #d73a49\">in<\/span> data) {\r\n      <span style=\"color: #d73a49\">if<\/span> (data[i] == prev) {\r\n        <span style=\"color: #d73a49\">if<\/span> (++counter &gt; hi_count) {\r\n          hi_count = counter;\r\n          hi_val = data[i];\r\n        }\r\n      } <span style=\"color: #d73a49\">else<\/span> {\r\n        counter = <span style=\"color: #005cc5\">1<\/span>;\r\n      }\r\n      prev = data[i];\r\n    }\r\n    val = hi_val;\r\n  } <span style=\"color: #d73a49\">else<\/span> {\r\n    <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #005cc5\">null<\/span>;\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #e36209\">IIf<\/span>(<span style=\"color: #e36209\">IsNan<\/span>(val), <span style=\"color: #005cc5\">null<\/span>, val);\r\n\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">apply_sql_spatial_filter<\/span>(feature_set, options) {\r\n  <span style=\"color: #6a737d\">\/\/ Applies optional spatial\/attribute filters and OrderBy clause to feature_set.<\/span>\r\n  <span style=\"color: #d73a49\">if<\/span> (feature_set == <span style=\"color: #005cc5\">null<\/span>){\r\n    <span style=\"color: #d73a49\">return<\/span>;\r\n  }\r\n  <span style=\"color: #d73a49\">var<\/span> spatialFilter = <span style=\"color: #e36209\">Decode<\/span>(\r\n    <span style=\"color: #e36209\">Lower<\/span>(<span style=\"color: #e36209\">DefaultValue<\/span>(options, <span style=\"color: #032f62\">'spatial_operator'<\/span>, <span style=\"color: #032f62\">''<\/span>)),\r\n    <span style=\"color: #032f62\">'intersects'<\/span>, <span style=\"color: #e36209\">Intersects<\/span>,\r\n    <span style=\"color: #032f62\">'contains'<\/span>, <span style=\"color: #e36209\">Contains<\/span>,\r\n    <span style=\"color: #032f62\">'crosses'<\/span>, <span style=\"color: #e36209\">Crosses<\/span>,\r\n    <span style=\"color: #032f62\">'envelopeintersects'<\/span>, <span style=\"color: #e36209\">EnvelopeIntersects<\/span>,\r\n    <span style=\"color: #032f62\">'overlaps'<\/span>, <span style=\"color: #e36209\">Overlaps<\/span>,\r\n    <span style=\"color: #032f62\">'touches'<\/span>, <span style=\"color: #e36209\">Touches<\/span>,\r\n    <span style=\"color: #032f62\">'within'<\/span>, <span style=\"color: #e36209\">Within<\/span>,\r\n    <span style=\"color: #005cc5\">null<\/span>\r\n  );\r\n\r\n  <span style=\"color: #d73a49\">var<\/span> geo = <span style=\"color: #e36209\">DefaultValue<\/span>(options, <span style=\"color: #032f62\">'input_geometry'<\/span>, <span style=\"color: #005cc5\">null<\/span>);\r\n  <span style=\"color: #d73a49\">if<\/span> (!<span style=\"color: #e36209\">IsEmpty<\/span>(spatialFilter) &amp;&amp; !IsEmpty2(geo)) {\r\n    <span style=\"color: #d73a49\">if<\/span> (!<span style=\"color: #e36209\">IsEmpty<\/span>(<span style=\"color: #e36209\">DefaultValue<\/span>(options, <span style=\"color: #032f62\">'search_distance'<\/span>, <span style=\"color: #005cc5\">null<\/span>))) {\r\n      geo = <span style=\"color: #e36209\">Buffer<\/span>(geo, options.search_distance, get_unit_code(options.search_units));\r\n    }\r\n    feature_set = spatialFilter(feature_set, geo);\r\n  }\r\n  <span style=\"color: #d73a49\">if<\/span> (!<span style=\"color: #e36209\">IsEmpty<\/span>(<span style=\"color: #e36209\">DefaultValue<\/span>(options, <span style=\"color: #032f62\">'where_clause'<\/span>, <span style=\"color: #005cc5\">null<\/span>))) {\r\n    feature_set = <span style=\"color: #e36209\">Filter<\/span>(feature_set, options.where_clause);\r\n  }\r\n  <span style=\"color: #d73a49\">if<\/span> (!<span style=\"color: #e36209\">IsEmpty<\/span>(<span style=\"color: #e36209\">DefaultValue<\/span>(options, <span style=\"color: #032f62\">'order_by_clause'<\/span>, <span style=\"color: #005cc5\">null<\/span>))) {\r\n    feature_set = <span style=\"color: #e36209\">OrderBy<\/span>(feature_set, options.order_by_clause);\r\n  }\r\n  <span style=\"color: #d73a49\">return<\/span> feature_set;\r\n}\r\n\r\n<span style=\"color: #d73a49\">if<\/span> (count_features([<span style=\"color: #e36209\">$feature<\/span>], <span style=\"color: #e36209\">DefaultValue<\/span>(rule_settings, <span style=\"color: #032f62\">'where_clause'<\/span>, <span style=\"color: #005cc5\">null<\/span>)) != <span style=\"color: #005cc5\">1<\/span>) {\r\n  <span style=\"color: #d73a49\">return<\/span>;\r\n}\r\n\r\n<span style=\"color: #d73a49\">function<\/span> <span style=\"color: #6f42c1\">calculate<\/span>() {\r\n  <span style=\"color: #d73a49\">var<\/span> target_rows = {};\r\n  <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> target_idx <span style=\"color: #d73a49\">in<\/span> rule_settings.target_classes) {\r\n    <span style=\"color: #d73a49\">var<\/span> target = rule_settings.target_classes[target_idx];\r\n    target_rows[target.class_name] = transpose_feature_set(\r\n      apply_sql_spatial_filter(\r\n        get_feature_set(target.class_name),\r\n        target,\r\n      )\r\n    )\r\n  }\r\n\r\n  <span style=\"color: #d73a49\">var<\/span> result = {};\r\n  <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> fms_idx <span style=\"color: #d73a49\">in<\/span> rule_settings.field_mappings) {\r\n    <span style=\"color: #d73a49\">var<\/span> fms = rule_settings.field_mappings[fms_idx];\r\n\r\n    <span style=\"color: #6a737d\">\/\/ Each field can be populated by any number of join classes and fields. Merge into a single array.<\/span>\r\n    <span style=\"color: #d73a49\">var<\/span> rows = [];\r\n    <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> fm_idx <span style=\"color: #d73a49\">in<\/span> fms.field_map) {\r\n      <span style=\"color: #d73a49\">var<\/span> fm = fms.field_map[fm_idx];\r\n      <span style=\"color: #d73a49\">for<\/span> (<span style=\"color: #d73a49\">var<\/span> i <span style=\"color: #d73a49\">in<\/span> fm.target_fields) {\r\n        rows = <span style=\"color: #e36209\">Splice<\/span>(rows, <span style=\"color: #e36209\">DefaultValue<\/span>(target_rows, [fm.class_name, fm.target_fields[i]], []));\r\n      }\r\n    }\r\n    <span style=\"color: #d73a49\">if<\/span> (!IsEmpty2(rows)) {\r\n      result[fms.source_field] = apply_merge_rule(fms.action, fms.delimiter, rows);\r\n    }\r\n  }\r\n  <span style=\"color: #d73a49\">return<\/span> result;\r\n}\r\n\r\n<span style=\"color: #d73a49\">return<\/span> {\r\n  <span style=\"color: #032f62\">'result'<\/span>: {\r\n    <span style=\"color: #032f62\">'attributes'<\/span>: calculate()\r\n  }\r\n}\r\n<\/code><\/pre>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"content","content":"<p>In the Ribbon click on the <strong>Save<\/strong> button. Close the Attribute Rules Data Design View and head back to the map with the parcel and lots layers.<\/p>\n<p>In the <strong>Contents pane<\/strong> right click on the Parcels layer and open the <strong>Attributes Table<\/strong>. Notice the two new fields we created in the tool \u2013 NumberOfLots and AvgPropertyValue. Update the <strong>ParcelType<\/strong> for <code>ParcelID=1<\/code> from &#8220;Unknown&#8221; to &#8220;Residential&#8221;<\/p>\n<p>The number of lots and average property value are calculated for <code>ParcelID=1<\/code>.<\/p>\n"},{"acf_fc_layout":"content","content":"<h2><strong>FAQs<\/strong><\/h2>\n<p><strong>Do I need a specific ArcGIS Pro license type to use template attribute rules?<\/strong><\/p>\n<p>You will need either an ArcGIS Pro Standard or Advanced licensing type to access template attribute rules.<\/p>\n<p><strong>What are the differences between Attribute Rule Templates and Ready to Use Rules?<\/strong><\/p>\n<p>Template attribute rules can be used to generate calculation attribute rules using geoprocessing tools After generating a template attribute rule a user can modify the Arcade script associated with it and any other attribute rule properties via the Details pane.<\/p>\n<p>Ready to Use Rules require a Data Reviewer license in addition to an ArcGIS Standard or Advanced licensing type. Ready to Use Rules can be used to generate Constraint and Validation rules via a user interface in the Attribute Rule Data Design View details pane. These rules are used to detect features that do not comply with established data quality requirements defined by your organization. The underlying arcade expressions for review rules is hidden. To learn more about reviewer rules please visit the Manage reviewer rules in a geodatabase help link.<\/p>\n<p><strong>Where can I learn more about the Generate Spatial Join template attribute rule?<\/strong><\/p>\n<p>To learn more about the Generate Spatial Join template attribute rule, review following online help documents:<\/p>\n<ul>\n<li><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/data\/geodatabases\/overview\/template-attribute-rules.htm#ESRI_SECTION1_7B0D855F931C421CB63B0F2421DF297A\">Template Attribute Rules &#8211; Generate Spatial Join<\/a><\/li>\n<li><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/tool-reference\/data-management\/generate-spatial-join-attribute-rule.htm\">Generate Spatial Join Attribute Rule Geoprocessing Tool<\/a><\/li>\n<\/ul>\n"}],"related_articles":[{"ID":2643142,"post_author":"365172","post_date":"2025-01-14 12:42:19","post_date_gmt":"2025-01-14 20:42:19","post_content":"","post_title":"Template Attribute Rules - Generate ID","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"attribute-rules-generate-id","to_ping":"","pinged":"","post_modified":"2025-09-25 10:12:01","post_modified_gmt":"2025-09-25 17:12:01","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2643142","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":2642312,"post_author":"365172","post_date":"2025-01-14 12:44:28","post_date_gmt":"2025-01-14 20:44:28","post_content":"","post_title":"Template Attribute Rules - Generate Symbol Rotation","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"attribute-rules-generate-symbol-rotation","to_ping":"","pinged":"","post_modified":"2025-09-25 10:26:16","post_modified_gmt":"2025-09-25 17:26:16","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2642312","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"show_article_image":false,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/04\/GenerateSpatialJoin_Parcels-Card.png","wide_image":false},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Template Attribute Rules - Generate Spatial Join<\/title>\n<meta name=\"description\" content=\"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Template Attribute Rules - Generate Spatial Join\" \/>\n<meta property=\"og:description\" content=\"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-25T17:17:18+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\"},\"author\":{\"name\":\"Mihail Kaburis\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3db9f2b407fc4699dd0b4570bea12d36\"},\"headline\":\"Template Attribute Rules &#8211; Generate Spatial Join\",\"datePublished\":\"2025-04-07T22:35:17+00:00\",\"dateModified\":\"2025-09-25T17:17:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"ArcGIS Pro\",\"attribute rules\",\"data management\",\"Template Attribute Rules\"],\"articleSection\":[\"Data Management\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\",\"name\":\"Template Attribute Rules - Generate Spatial Join\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2025-04-07T22:35:17+00:00\",\"dateModified\":\"2025-09-25T17:17:18+00:00\",\"description\":\"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Template Attribute Rules &#8211; Generate Spatial Join\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3db9f2b407fc4699dd0b4570bea12d36\",\"name\":\"Mihail Kaburis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/01\/uc_2024_profile_stamford-468x465.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/01\/uc_2024_profile_stamford-468x465.jpg\",\"caption\":\"Mihail Kaburis\"},\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/mkaburis\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Template Attribute Rules - Generate Spatial Join","description":"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join","og_locale":"en_US","og_type":"article","og_title":"Template Attribute Rules - Generate Spatial Join","og_description":"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2025-09-25T17:17:18+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join"},"author":{"name":"Mihail Kaburis","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3db9f2b407fc4699dd0b4570bea12d36"},"headline":"Template Attribute Rules &#8211; Generate Spatial Join","datePublished":"2025-04-07T22:35:17+00:00","dateModified":"2025-09-25T17:17:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join"},"wordCount":7,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["ArcGIS Pro","attribute rules","data management","Template Attribute Rules"],"articleSection":["Data Management"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join","name":"Template Attribute Rules - Generate Spatial Join","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2025-04-07T22:35:17+00:00","dateModified":"2025-09-25T17:17:18+00:00","description":"Generate Spatial Join template attribute rules populate fields within an input dataset based on spatial relationships with other datasets.","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-pro\/data-management\/attribute-rules-generate-spatial-join#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Template Attribute Rules &#8211; Generate Spatial Join"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/3db9f2b407fc4699dd0b4570bea12d36","name":"Mihail Kaburis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/01\/uc_2024_profile_stamford-468x465.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/01\/uc_2024_profile_stamford-468x465.jpg","caption":"Mihail Kaburis"},"url":"https:\/\/www.esri.com\/arcgis-blog\/author\/mkaburis"}]}},"text_date":"April 7, 2025","author_name":"Mihail Kaburis","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/mkaburis","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Newsroom-Keyart-Wide-1920-x-1080.jpg","primary_product":"ArcGIS Pro","tag_data":[{"term_id":42181,"name":"ArcGIS Pro","slug":"arcgis-pro","term_group":0,"term_taxonomy_id":42181,"taxonomy":"post_tag","description":"","parent":0,"count":323,"filter":"raw"},{"term_id":302212,"name":"attribute rules","slug":"attribute-rules","term_group":0,"term_taxonomy_id":302212,"taxonomy":"post_tag","description":"","parent":0,"count":35,"filter":"raw"},{"term_id":86442,"name":"data management","slug":"data-management","term_group":0,"term_taxonomy_id":86442,"taxonomy":"post_tag","description":"","parent":0,"count":67,"filter":"raw"},{"term_id":777832,"name":"Template Attribute Rules","slug":"template-attribute-rules","term_group":0,"term_taxonomy_id":777832,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"}],"category_data":[{"term_id":23851,"name":"Data Management","slug":"data-management","term_group":0,"term_taxonomy_id":23851,"taxonomy":"category","description":"","parent":0,"count":920,"filter":"raw"}],"product_data":[{"term_id":36561,"name":"ArcGIS Pro","slug":"arcgis-pro","term_group":0,"term_taxonomy_id":36561,"taxonomy":"product","description":"","parent":0,"count":2036,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=arcgis-pro","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/2642652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/365172"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=2642652"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/2642652\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=2642652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=2642652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=2642652"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=2642652"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=2642652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}