<?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: Spatial Queries, Spatially Enabled DataFrames  in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786915#M1409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Aaron. Is there anywhere where these types of spatial queries are documented, or examples as I can only find SQL queries on Spatially enabled Dataframes&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2019 15:04:21 GMT</pubDate>
    <dc:creator>OisinSlevin</dc:creator>
    <dc:date>2019-01-16T15:04:21Z</dc:date>
    <item>
      <title>Spatial Queries, Spatially Enabled DataFrames</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786913#M1407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi Guys,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Attempting to use the new "Spatially Enabled DataFrame&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;" after getting familiar with Spatial Dataframes.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;The new version seems to have some functionality of "Spatial" queries stripped out ? There's no "within", "contains", "touches" etc. at a DataFrame level only at Series level?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;gis = GIS("url", "user", password)&lt;BR /&gt;content=gis.content.get("ID")&amp;nbsp;&lt;/P&gt;&lt;P&gt;layers=&lt;SPAN&gt;content&lt;/SPAN&gt;.layers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;points=pd.DataFrame.spatial.from_layer(&lt;SPAN&gt;layers&lt;/SPAN&gt;[0])&lt;/P&gt;&lt;P&gt;polygons=&lt;SPAN&gt;pd.DataFrame.spatial.from_layer(&lt;/SPAN&gt;&lt;SPAN&gt;layers&lt;/SPAN&gt;&lt;SPAN&gt;[1])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if&amp;nbsp;I try to take a polygon and find what points are within it I can no longer run a single query&lt;BR /&gt;as such :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Using SpatialDataFrame I Can use this piece of code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;a_polygon=polygons.ix[0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;result = points.within(&lt;SPAN&gt;a_polygon&lt;/SPAN&gt;.SHAPE) &lt;STRONG&gt;## returns true/false for each point denoting if inside the polygon.&lt;/STRONG&gt;&lt;BR /&gt;points_inside_polygon= &lt;SPAN&gt;points&lt;/SPAN&gt;.loc[result] &lt;STRONG&gt;## gives total list of points inside of the polygon.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;is there still a way to run a group query as I can only run a one by one test ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Ex:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;points.ix[0].SHAPE.within(polygons.ix[0].SHAPE)&amp;nbsp;&lt;STRONG&gt;## returns true/false if single point is within the polygon&amp;nbsp;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Using version 1.5.2 of ArcGis.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also all the examples using the spatially Enabled DataFrame&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from your documentation are using simple SQL queries on the text fields. Spatial queries should be based on the geometries not the fields associated with geometries.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 14:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786913#M1407</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2019-01-16T14:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Queries, Spatially Enabled DataFrames</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786914#M1408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try doing something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class=""&gt;// polygons that contain a point
contains&lt;/SPAN&gt; &lt;SPAN class="" style="color: #666666;"&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;dataframe&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #ba2121;"&gt;"SHAPE"&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;geom&lt;/SPAN&gt;&lt;SPAN class="" style="color: #666666;"&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;contains&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;some_point_geometry&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786914#M1408</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T08:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Queries, Spatially Enabled DataFrames</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786915#M1409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Aaron. Is there anywhere where these types of spatial queries are documented, or examples as I can only find SQL queries on Spatially enabled Dataframes&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 15:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786915#M1409</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2019-01-16T15:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Queries, Spatially Enabled DataFrames</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786916#M1410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oisin, I believe they are documented here&amp;nbsp;&lt;A class="link-titled" href="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#geoseriesaccessor" title="https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.features.toc.html#geoseriesaccessor"&gt;arcgis.features module — arcgis 1.5.2 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure about any examples, beyond&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/" title="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/"&gt;Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&amp;nbsp;which doesn't seem to show using the&amp;nbsp;&lt;EM&gt;geom&lt;/EM&gt; accessor.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 15:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786916#M1410</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-01-16T15:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Queries, Spatially Enabled DataFrames</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786917#M1411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all the same, its seems crazy to me to have a spatial system and only show examples of data queries using sql. I've been digging through the docs&amp;nbsp;&lt;A class="" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fesri.github.io%2Farcgis-python-api%2Fapidoc%2Fhtml%2Farcgis.features.toc.html%23geoseriesaccessor" rel="nofollow" style="color: #287433; background-color: #ffffff; border: 0px; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;arcgis.features module — arcgis 1.5.2 documentation&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; already. and the introduction piece is utterly useless of spatial data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 15:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/spatial-queries-spatially-enabled-dataframes/m-p/786917#M1411</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2019-01-16T15:50:23Z</dc:date>
    </item>
  </channel>
</rss>

