<?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 Spatially Enabled Dataframe join not producing results in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1420576#M9995</link>
    <description>&lt;P&gt;I have a notebook server that has arcgis for python installed, version 1.9.1. I have a separate server and a local environment using the version of arcgis for python, version=2.1.0.4 &amp;amp;&amp;nbsp;2.2.0.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some read I cannot get the spatial join to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two layers one layer is coming from a feature service and the other returned from a batch geocoder.&lt;/P&gt;&lt;P&gt;The municipal layer&amp;nbsp;I'm using&amp;nbsp;&lt;SPAN&gt;FeatureLayer to grab it then using&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pd&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DataFrame&lt;/SPAN&gt;&lt;SPAN&gt;.spatial.from_layer to turn it into a spatial dataframe. The second is from a batch geocoder that gets returned to as a featureset then transformed to sdf through one of the methods. I then try to go a spatial join but it doesn't return full matches only partial ones.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The municipal layer is a mix of polygons and multi-polygons. The geocoded addresses are points. I have no clue why it's working on the older version of arcgis for python but not on the new one. In the code snippet below I have swapped out the muni_sdf and the geocode_results_sdf as the method caller and input with no real change in results.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#batch geocoded addresses 
results_featureset = batch_geocode(address_list, geocoder=our_geocoder, location_type='rooftop', match_out_of_range = False, out_sr= 3435, as_featureset=True)

geocode_results_sdf = geocode_results.sdf

#muni layer 
municipality = 'layer url'
municipality_feat = FeatureLayer(municipality)
muni_sdf = pd.DataFrame.spatial.from_layer(municipality_feat)

spatial_relationship = 'within'  # Change spatial relationship to 'within' or 'intersect' with no change in results 
joined_sdf = muni_sdf.spatial.join(geocode_results_sdf , how="inner", op=spatial_relationship)

print(joined_sdf)  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2024 17:25:27 GMT</pubDate>
    <dc:creator>sigccil</dc:creator>
    <dc:date>2024-05-08T17:25:27Z</dc:date>
    <item>
      <title>Spatially Enabled Dataframe join not producing results</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1420576#M9995</link>
      <description>&lt;P&gt;I have a notebook server that has arcgis for python installed, version 1.9.1. I have a separate server and a local environment using the version of arcgis for python, version=2.1.0.4 &amp;amp;&amp;nbsp;2.2.0.2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some read I cannot get the spatial join to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two layers one layer is coming from a feature service and the other returned from a batch geocoder.&lt;/P&gt;&lt;P&gt;The municipal layer&amp;nbsp;I'm using&amp;nbsp;&lt;SPAN&gt;FeatureLayer to grab it then using&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;pd&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DataFrame&lt;/SPAN&gt;&lt;SPAN&gt;.spatial.from_layer to turn it into a spatial dataframe. The second is from a batch geocoder that gets returned to as a featureset then transformed to sdf through one of the methods. I then try to go a spatial join but it doesn't return full matches only partial ones.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The municipal layer is a mix of polygons and multi-polygons. The geocoded addresses are points. I have no clue why it's working on the older version of arcgis for python but not on the new one. In the code snippet below I have swapped out the muni_sdf and the geocode_results_sdf as the method caller and input with no real change in results.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#batch geocoded addresses 
results_featureset = batch_geocode(address_list, geocoder=our_geocoder, location_type='rooftop', match_out_of_range = False, out_sr= 3435, as_featureset=True)

geocode_results_sdf = geocode_results.sdf

#muni layer 
municipality = 'layer url'
municipality_feat = FeatureLayer(municipality)
muni_sdf = pd.DataFrame.spatial.from_layer(municipality_feat)

spatial_relationship = 'within'  # Change spatial relationship to 'within' or 'intersect' with no change in results 
joined_sdf = muni_sdf.spatial.join(geocode_results_sdf , how="inner", op=spatial_relationship)

print(joined_sdf)  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 17:25:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1420576#M9995</guid>
      <dc:creator>sigccil</dc:creator>
      <dc:date>2024-05-08T17:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially Enabled Dataframe join not producing results</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1457922#M10008</link>
      <description>&lt;P&gt;If you plop both spatial data frames on a map widget does the data look correct? Hard to do much without seeing the actual data.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 13:35:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1457922#M10008</guid>
      <dc:creator>JohnEvans6</dc:creator>
      <dc:date>2024-05-13T13:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Spatially Enabled Dataframe join not producing results</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1465900#M10013</link>
      <description>&lt;P&gt;I'm developing the main app outside of a notebook or pro. I'm using the notebook only to test to check my work so, in a sense yes it's correct in the notebook because it's the same code I'm using for the app I'm building.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 15:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatially-enabled-dataframe-join-not-producing/m-p/1465900#M10013</guid>
      <dc:creator>sigccil</dc:creator>
      <dc:date>2024-05-14T15:20:33Z</dc:date>
    </item>
  </channel>
</rss>

