<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to join table to a feature layer? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1240331#M8147</link>
    <description>&lt;P&gt;I have a feature layer "assets" (points) that contains a field "categories_id" which is populated by IDs that refer to the "id" field of the "categories" table (no spatial data). There is another field in this second table which contains a "name" string field. The "assets.categories_id" field is related to the "categories.id".&lt;/P&gt;&lt;P&gt;I would like to count how many different categories (categories_id) exist in the "asset" table and get the name from the "categories" tables.&lt;/P&gt;&lt;P&gt;asset table:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;id&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;site_id&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;categories_id&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;info&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;text1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;text2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;text3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;categories table:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;id&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize I can use the "group_by_fields_for_statistics" and "out_statistics" parameters from the FeatureLayer.query function to get the count of every assets.categories_id, but I also need to get the name. What is the best way to accomplish this? Get the stats then do a join?&lt;/P&gt;&lt;P&gt;As a side question: I also wish to do a similar operation with two feature layers (sites and assets). Is there a way to &lt;SPAN&gt;join features based on field value (a basic SQL JOIN) rather than the spatial_relationship (as described &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.analysis.html#join-features" target="_self"&gt;here&lt;/A&gt;&lt;SPAN&gt;) ? Anyway to do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 20:13:14 GMT</pubDate>
    <dc:creator>mikaël</dc:creator>
    <dc:date>2022-12-12T20:13:14Z</dc:date>
    <item>
      <title>How to join table to a feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1240331#M8147</link>
      <description>&lt;P&gt;I have a feature layer "assets" (points) that contains a field "categories_id" which is populated by IDs that refer to the "id" field of the "categories" table (no spatial data). There is another field in this second table which contains a "name" string field. The "assets.categories_id" field is related to the "categories.id".&lt;/P&gt;&lt;P&gt;I would like to count how many different categories (categories_id) exist in the "asset" table and get the name from the "categories" tables.&lt;/P&gt;&lt;P&gt;asset table:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;id&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;site_id&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;categories_id&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;info&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;text1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;text2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="16.666666666666668%"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;text3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;categories table:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;id&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;category 4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize I can use the "group_by_fields_for_statistics" and "out_statistics" parameters from the FeatureLayer.query function to get the count of every assets.categories_id, but I also need to get the name. What is the best way to accomplish this? Get the stats then do a join?&lt;/P&gt;&lt;P&gt;As a side question: I also wish to do a similar operation with two feature layers (sites and assets). Is there a way to &lt;SPAN&gt;join features based on field value (a basic SQL JOIN) rather than the spatial_relationship (as described &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.analysis.html#join-features" target="_self"&gt;here&lt;/A&gt;&lt;SPAN&gt;) ? Anyway to do that?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 20:13:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1240331#M8147</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2022-12-12T20:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to join table to a feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1240345#M8148</link>
      <description>&lt;P&gt;I just found this&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.geoanalytics.summarize_data.html" target="_self"&gt;arcgis.geoanalytics.summarize_data module&lt;/A&gt;. Gonna play around with it, see if it meets my needs.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 20:35:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1240345#M8148</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2022-12-12T20:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to join table to a feature layer?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1242136#M8175</link>
      <description>&lt;P&gt;I can't seem to get what I want from the API. I can't seem to figure it out. How can something as simple as joining tables or layers and grouping them to get a count per group is so complicated.&lt;/P&gt;&lt;P&gt;Plus, the documentation on the API is really poor, with lots of errors.&lt;/P&gt;&lt;P&gt;I'm just gonna query the tables and layers and do the operations locally, but it's too bad, I wished I could've done it directly on the data and return the values I wanted.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 20:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-join-table-to-a-feature-layer/m-p/1242136#M8175</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2022-12-16T20:35:06Z</dc:date>
    </item>
  </channel>
</rss>

