<?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 Re: SpatialJoin with two and more fields and mergeRule not working as expected in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052885#M60951</link>
    <description>&lt;P data-unlink="true"&gt;Hi, thank you very much for your answer. Yes, I believe INTERSECT is the best option for me. According to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/select-by-location-graphical-examples.htm" target="_self"&gt;this site.&lt;/A&gt;&amp;nbsp;There is an issue that can arise (options I and J when selecting polygon with polygon).&lt;/P&gt;&lt;P data-unlink="true"&gt;This is hardly a case since all target polygons are made by hand. It would be great to have some option INTERSECT WITHOUT TOUCHING &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;As with other options, WITHIN and CONTAINS are too strict. I need the join feature to be matched whenever both join and target inner parts overlap.&lt;/P&gt;&lt;P data-unlink="true"&gt;As a result, I would like to get target features with lists of values of desired attributes in corresponding cells delimited by comma.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 19:35:06 GMT</pubDate>
    <dc:creator>TadeášDěd</dc:creator>
    <dc:date>2021-04-29T19:35:06Z</dc:date>
    <item>
      <title>SpatialJoin with two and more fields and mergeRule not working as expected</title>
      <link>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052738#M60943</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why is below code giving me very wierd results? I want to do SpatialJoin. Target polygon feature is "zapojporost" with target field "cislo". I want DRUH_POZEMKU and&amp;nbsp;TEXT_KM from input feature to be merged to corresponding cells.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a result I always get mixed up results. In some fields, there is no value. In field "cislo" I even get different number and I thought that when it was target feature, it could not be changed by SpatialJoin. Thank you for any tips.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KN_Feature = "PARCELY_KN_JOIN"&lt;BR /&gt;areaVysledek = "area_Vysledek"&lt;BR /&gt;zapojporostFeature = "zapojporost"&lt;/P&gt;&lt;P&gt;fms1 = arcpy.FieldMappings()&lt;BR /&gt;&lt;BR /&gt;fms1.addTable(KN_Feature)&lt;BR /&gt;fms1.addTable(zapojporostFeature)&lt;BR /&gt;keepers = ["cislo","KATUZE_KOD","TEXT_KM","DRUH_POZEMKU"] # etc.&lt;BR /&gt;# Remove all output fields you don't want.&lt;BR /&gt;for field in fms1.fields:&lt;BR /&gt;if field.name not in keepers:&lt;BR /&gt;fms1.removeFieldMap(fms1.findFieldMapIndex(field.name))&lt;BR /&gt;&lt;BR /&gt;parcela_index = fms1.findFieldMapIndex("TEXT_KM")&lt;BR /&gt;fieldmap = fms1.getFieldMap(parcela_index)&lt;BR /&gt;field = fieldmap.outputField&lt;BR /&gt;field.name = "parcelaCislo"&lt;BR /&gt;field.aliasName = "parcela č."&lt;BR /&gt;fieldmap.outputField = field&lt;BR /&gt;fieldmap.mergeRule = "Join"&lt;BR /&gt;fieldmap.joinDelimiter = ", "&lt;BR /&gt;fms1.replaceFieldMap(parcela_index, fieldmap)&lt;BR /&gt;&lt;BR /&gt;drupoz_index = fms1.findFieldMapIndex("DRUH_POZEMKU")&lt;BR /&gt;fieldmap1 = fms1.getFieldMap(drupoz_index)&lt;BR /&gt;field1 = fieldmap1.outputField&lt;BR /&gt;field1.name = "druhPozemku1"&lt;BR /&gt;field1.aliasName = "druh pozemku"&lt;BR /&gt;fieldmap1.outputField = field1&lt;BR /&gt;fieldmap1.mergeRule = "Join"&lt;BR /&gt;fieldmap1.joinDelimiter = ", "&lt;BR /&gt;fms1.replaceFieldMap(drupoz_index, fieldmap1)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# SpatailJoin pro plochy&lt;BR /&gt;arcpy.analysis.SpatialJoin(zapojporostFeature, "PARCELY_KN_JOIN", areaVysledek, 'JOIN_ONE_TO_ONE',"KEEP_ALL",fms1)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 19:24:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052738#M60943</guid>
      <dc:creator>TadeášDěd</dc:creator>
      <dc:date>2021-04-29T19:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialJoin with two and more fields and mergeRule not working as expected</title>
      <link>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052794#M60945</link>
      <description>&lt;P&gt;Are you sure INTERSECT (default) is the match option you want?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 16:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052794#M60945</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-04-29T16:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialJoin with two and more fields and mergeRule not working as expected</title>
      <link>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052885#M60951</link>
      <description>&lt;P data-unlink="true"&gt;Hi, thank you very much for your answer. Yes, I believe INTERSECT is the best option for me. According to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/select-by-location-graphical-examples.htm" target="_self"&gt;this site.&lt;/A&gt;&amp;nbsp;There is an issue that can arise (options I and J when selecting polygon with polygon).&lt;/P&gt;&lt;P data-unlink="true"&gt;This is hardly a case since all target polygons are made by hand. It would be great to have some option INTERSECT WITHOUT TOUCHING &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;As with other options, WITHIN and CONTAINS are too strict. I need the join feature to be matched whenever both join and target inner parts overlap.&lt;/P&gt;&lt;P data-unlink="true"&gt;As a result, I would like to get target features with lists of values of desired attributes in corresponding cells delimited by comma.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 19:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatialjoin-with-two-and-more-fields-and-mergerule/m-p/1052885#M60951</guid>
      <dc:creator>TadeášDěd</dc:creator>
      <dc:date>2021-04-29T19:35:06Z</dc:date>
    </item>
  </channel>
</rss>

