<?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 Using a sub-query instead of a variable in STIntersection? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437741#M24993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm executing the query bellow to intersect a soil layer with a polygon (a parcel) with no problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to replace the @parcel in the select statement with something like a sub-query. I was naive to think that putting a &lt;/SPAN&gt;&lt;STRONG&gt;SELECT Shape&lt;/STRONG&gt;&lt;SPAN&gt; from another layer would do the trick, but it fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Arnon&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;DECLARE @parcel geometry 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =geometry::STGeomFromText('POLYGON ((170018 1068876, &amp;lt;more coordinates&amp;gt;))',1);
SELECT Shape.STIntersection(@parcel)
FROM soils
WHERE Shape.STIntersects(@parcel)=1&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:35:59 GMT</pubDate>
    <dc:creator>ArnonTsairi</dc:creator>
    <dc:date>2021-12-11T19:35:59Z</dc:date>
    <item>
      <title>Using a sub-query instead of a variable in STIntersection?</title>
      <link>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437741#M24993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm executing the query bellow to intersect a soil layer with a polygon (a parcel) with no problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to replace the @parcel in the select statement with something like a sub-query. I was naive to think that putting a &lt;/SPAN&gt;&lt;STRONG&gt;SELECT Shape&lt;/STRONG&gt;&lt;SPAN&gt; from another layer would do the trick, but it fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Arnon&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;DECLARE @parcel geometry 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =geometry::STGeomFromText('POLYGON ((170018 1068876, &amp;lt;more coordinates&amp;gt;))',1);
SELECT Shape.STIntersection(@parcel)
FROM soils
WHERE Shape.STIntersects(@parcel)=1&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437741#M24993</guid>
      <dc:creator>ArnonTsairi</dc:creator>
      <dc:date>2021-12-11T19:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using a sub-query instead of a variable in STIntersection?</title>
      <link>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437742#M24994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The OGC intent was certainly to permit subqueries, but there's still the SRID issue with&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which to contend. A Microsoft forum would probably be a better place to find experts on&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GEOMETRY behavior in SQL-Server 2008.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcSDE just uses an envelope search as a filter and then uses Esri's libraries for topological&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;comparison (whether it's GEOMETRY/GEOGRAPHY, ST_GEOMETRY, SDO_GEOMETRY,&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PG_GEOMETRY , SDEBINARY, or SDELOB storage).&amp;nbsp; Shape library comparisons are done at &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the precision specified by the layer coordinate reference (inverse of xyscale).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 11:13:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437742#M24994</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-04-06T11:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a sub-query instead of a variable in STIntersection?</title>
      <link>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437743#M24995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Eventually I abandoned (for now) the subquery idea. Instead I'm using a join with STIntersects in the join criteria. This makes the shapes of both layers available for intersection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Basic, I guess...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 10:48:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/using-a-sub-query-instead-of-a-variable-in/m-p/437743#M24995</guid>
      <dc:creator>ArnonTsairi</dc:creator>
      <dc:date>2011-04-12T10:48:18Z</dc:date>
    </item>
  </channel>
</rss>

