<?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: Spatially joining polygons centroid within in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292127#M22577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;for the suggestions. My datasets are large with 2m parcels and 200k regions so the dictionary option will be very slow I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems strange that there isn't a join option opposite to &lt;EM&gt;"&lt;/EM&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;EM&gt;HAVE_THEIR_CENTER_IN —The features in the join features will be matched if a target feature's center falls within them&lt;/EM&gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;that is "&lt;SPAN&gt;&lt;EM&gt;HAVE_THEIR_CENTER_IN —The features in the join features will be matched if the &lt;STRONG&gt;join features center falls within the target feature&lt;/STRONG&gt;&lt;/EM&gt;."&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Dec 2017 21:02:59 GMT</pubDate>
    <dc:creator>DavidMatthews2</dc:creator>
    <dc:date>2017-12-27T21:02:59Z</dc:date>
    <item>
      <title>Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292124#M22574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 15px;"&gt;I have two polygon feature classes that I want to do a spatial join between and sum certain fields. The target feature&amp;nbsp; has larger polygons (regions) covering the second feature of smaller polygons (property parcels). I would like to use the centroid of the property parcels to do the join as they are not always fully contained in the regions but 'has their centre in' only joins the opposite way, with the target feature being the smaller polygons.&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 15px;"&gt;Is there anyway to do this without creating a point feature from my parcels and using 'contains' as my join?&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 15px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px; font-size: 15px;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 10:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292124#M22574</guid>
      <dc:creator>DavidMatthews2</dc:creator>
      <dc:date>2017-12-27T10:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292125#M22575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;switch the order of the join, then do a an attribute join in the opposite direction perhaps&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 10:49:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292125#M22575</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-27T10:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292126#M22576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You posted this in the Python space. Are you looking for a script to do this? In case the simple way as Dan mentioned, doing a manual spatial join does not work for you, there is always a scripting solution. However, that will take a&amp;nbsp;some time to complete. How much coding experience do you have and what have you tried so far?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that you want to obtain statistical information&amp;nbsp;from multiple parcels for each region and add that data to the regions, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How large are your datasets? How many features do you have in both featureclasses?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a general outline of what could work I would be thinking along the lines of:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Creating a dictionary with the centroids of the parcels and corresponding numerics data on which to apply the statistics oid&amp;nbsp;: [centroid, numeric fields]&lt;/LI&gt;&lt;LI&gt;Creating a dictionary of the regions (oid&amp;nbsp;: polygon)&lt;/LI&gt;&lt;LI&gt;Loop through the regions and for each region looop through the parcels and check if the data is inside and populate a dictionary with a list of the&amp;nbsp;parcel numeric data per region&lt;/LI&gt;&lt;LI&gt;Perform the statistics on the list pf parcels per region&lt;/LI&gt;&lt;LI&gt;Add the resulting statistics to the regions&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the datasets are large,&amp;nbsp;it would be better to use select by location for each region in order to optimize the performance. This&amp;nbsp;steps above only apply when the regions do not overlap and when a parcel centroid will only fall inside a single region, otherwise a parcel will be taken into account multiple times.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 11:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292126#M22576</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-12-27T11:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292127#M22577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;for the suggestions. My datasets are large with 2m parcels and 200k regions so the dictionary option will be very slow I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems strange that there isn't a join option opposite to &lt;EM&gt;"&lt;/EM&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;EM&gt;HAVE_THEIR_CENTER_IN —The features in the join features will be matched if a target feature's center falls within them&lt;/EM&gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;that is "&lt;SPAN&gt;&lt;EM&gt;HAVE_THEIR_CENTER_IN —The features in the join features will be matched if the &lt;STRONG&gt;join features center falls within the target feature&lt;/STRONG&gt;&lt;/EM&gt;."&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 21:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292127#M22577</guid>
      <dc:creator>DavidMatthews2</dc:creator>
      <dc:date>2017-12-27T21:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292128#M22578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;given the size... I would consider tiling the data first, this is a classic case where tiling would be easy since it should be fairly obvious which polygon belongs to what... even with overlap if needed.&amp;nbsp; The mere size of the files will bog processing down, so the workflows suggested should account for most situations and you can deal with the remaining separately.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 22:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292128#M22578</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-27T22:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292129#M22579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you already mentioned, having 2M elements in a dictionary will be very slow, since a dictionary takes about 3x the size as overhead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to what&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;&amp;nbsp; already mentioned, if there is any attribute that can be identified in both datasets (like a&amp;nbsp;neighborhood or something a little bigger) you could base the "tiles" on those areas.If there is no common attribute then tile the area like Dan mentioned (perhaps with a little overlap just in case) and process those. Doing 200k select by locations on a dataset of 2M features will really take a lot of time and that is not the way to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to post a part of the data (say 1 region and the corresponding parcels for that region)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2017 11:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292129#M22579</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-12-28T11:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292130#M22580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to have a look at the Geoprocessing Tool arcpy.TabulateIntersection_analysis, probably followed by Sort and SummaryStatistics to select best match (first row). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jan 2018 10:39:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292130#M22580</guid>
      <dc:creator>MarianneRohrbach</dc:creator>
      <dc:date>2018-01-03T10:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292131#M22581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amen to what David said. Why is there no "have their center in". Is there a workaround? Sure. But I have a better workaround: have ESRI actually make logical design decisions, and better software.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:46:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292131#M22581</guid>
      <dc:creator>RobertStevens</dc:creator>
      <dc:date>2019-08-09T15:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292132#M22582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[Edit: "A's centroids are always within B (but B's centroids are not always in A)" is wrong and should state "B's centroids are always within A (but A's centroids are not always in B)"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is no question:&lt;/P&gt;&lt;P&gt;I have the same problem as David however, the "do it the opposite wy and do an attribute join" solution is not an option for me. This is because my targets (A) are only partially in my joins (B) and the other way round. They just interesct. However they intersect with neighbouring features aswell. The only usefull spatial relation to join them is the centroid. A's centroids are always within B (but B's centroids are not always in A). Since I am far from being a coder I will have to convert the join features into points as David suggests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that sense, I would like to suggest that Esri adds the needed match option in an upcoming uptdate. It seems fundamental anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2019 10:39:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292132#M22582</guid>
      <dc:creator>Jan_PeterGlock1</dc:creator>
      <dc:date>2019-09-18T10:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292133#M22583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you explain why you would want to multiplicate potentially large B features to join attributes of A ? When joining this way you will end up with duplicated B geometries for every A with centroid in B and lost A geometry.&lt;BR /&gt;What is the use case for such a requirement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 13:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292133#M22583</guid>
      <dc:creator>MarianneRohrbach</dc:creator>
      <dc:date>2019-09-23T13:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292134#M22584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank your for your comment Marianne. In fact I made a mistake stating that "A's centroids are always within B (but B's centroids are not always in A)". It is just the other way round: B's centroids are always in A but A's centroids not in B.&lt;/P&gt;&lt;P&gt;My aim is to have the attributes of B and the geometry of A. For "have their centroid in" i get "if A's centroid falls into B." As said, this does not work for me.&lt;/P&gt;&lt;P&gt;I am working with two different representations of city blocks from different sources, where one of them (A has the geometry I need) and B has information on the building density.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/292134#M22584</guid>
      <dc:creator>Jan_PeterGlock1</dc:creator>
      <dc:date>2019-09-23T15:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/1058272#M61136</link>
      <description>&lt;P&gt;This is an analysis that pretty much every government needs to do at some point. We have zoning, or regions, or sectors, or whatever, and we need to know which parcels fall into which zone but the edges usually don't match exactly&lt;/P&gt;</description>
      <pubDate>Sat, 15 May 2021 02:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/1058272#M61136</guid>
      <dc:creator>JohannLall2</dc:creator>
      <dc:date>2021-05-15T02:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially joining polygons centroid within</title>
      <link>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/1077500#M61676</link>
      <description>&lt;P&gt;Because the join&amp;nbsp; is&amp;nbsp; made in order to dissolve and/or ignore the joined features in a suitable way (sum, average etc) and ultimately to retain just one copy of the larger geometry.&amp;nbsp; With disparate data sources there is a problem when boundaries of two polygonal sets do not quite match. Neither &lt;STRONG&gt;completely within&lt;/STRONG&gt; nor&lt;STRONG&gt; intersect&lt;/STRONG&gt; address this issue, whereas having the centroid of the smaller polygons with the larger does. Clear?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 14:49:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/spatially-joining-polygons-centroid-within/m-p/1077500#M61676</guid>
      <dc:creator>RobertStevens</dc:creator>
      <dc:date>2021-07-10T14:49:15Z</dc:date>
    </item>
  </channel>
</rss>

