<?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 oracle sql query for fetching data from table having a polygon st_geometry  datatype in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/oracle-sql-query-for-fetching-data-from-table/m-p/1004811#M6871</link>
    <description>&lt;P&gt;Dears&lt;/P&gt;&lt;P&gt;We have a featureclass containing city names and it’s border as polygon shape.The column is st_geometry. We are trying to fetch the city based on the coordinates using the below st geometry query. Even though the coordinates are exactly with in the border the query is not fetching any records.&lt;/P&gt;&lt;P&gt;select NAME1 from GTSOWNER.CM_BOUNDARY3_PG&amp;nbsp; where sde.st_within (sde.st_point(45.576579,26.460792,32637),shape)=1;&lt;/P&gt;&lt;P&gt;Tried with multiple options without any luck&lt;/P&gt;&lt;P&gt;The database is oracle. the arcGIs version is 10.2&lt;/P&gt;&lt;P&gt;Adeeb&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArcCatelog table descirption" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/989iC5C5BCD4AB30D8ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="ArcCatelog table descirption" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;ArcCatelog table descirption&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arcatelog -coordinate system" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/990i3FBACB2BB71AC68C/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="arcatelog -coordinate system" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;arcatelog -coordinate system&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table data" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/991i1E4CDC471583C606/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Table data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Table data&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 20:29:14 GMT</pubDate>
    <dc:creator>AdeebFarhan</dc:creator>
    <dc:date>2020-11-25T20:29:14Z</dc:date>
    <item>
      <title>oracle sql query for fetching data from table having a polygon st_geometry  datatype</title>
      <link>https://community.esri.com/t5/geodatabase-questions/oracle-sql-query-for-fetching-data-from-table/m-p/1004811#M6871</link>
      <description>&lt;P&gt;Dears&lt;/P&gt;&lt;P&gt;We have a featureclass containing city names and it’s border as polygon shape.The column is st_geometry. We are trying to fetch the city based on the coordinates using the below st geometry query. Even though the coordinates are exactly with in the border the query is not fetching any records.&lt;/P&gt;&lt;P&gt;select NAME1 from GTSOWNER.CM_BOUNDARY3_PG&amp;nbsp; where sde.st_within (sde.st_point(45.576579,26.460792,32637),shape)=1;&lt;/P&gt;&lt;P&gt;Tried with multiple options without any luck&lt;/P&gt;&lt;P&gt;The database is oracle. the arcGIs version is 10.2&lt;/P&gt;&lt;P&gt;Adeeb&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArcCatelog table descirption" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/989iC5C5BCD4AB30D8ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="ArcCatelog table descirption" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;ArcCatelog table descirption&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arcatelog -coordinate system" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/990i3FBACB2BB71AC68C/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="arcatelog -coordinate system" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;arcatelog -coordinate system&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table data" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/991i1E4CDC471583C606/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Table data" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Table data&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 20:29:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/oracle-sql-query-for-fetching-data-from-table/m-p/1004811#M6871</guid>
      <dc:creator>AdeebFarhan</dc:creator>
      <dc:date>2020-11-25T20:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: oracle sql query for fetching data from table having a polygon st_geometry  datatype</title>
      <link>https://community.esri.com/t5/geodatabase-questions/oracle-sql-query-for-fetching-data-from-table/m-p/1004934#M6872</link>
      <description>&lt;P&gt;Always make sure you define the correct spatial reference ID in table creation and population, then use that same spatial reference to define the geometry you construct in the query.&amp;nbsp; The comparison operators all do an initial test of "Do the spatial references match?" and if that fails don't bother to attempt further comparison.&lt;/P&gt;&lt;P&gt;You've skirted this problem, then run into the other side of the equation: You've requested a geometry 52.7 meters from the origin of UTM Zone 37N, which is in the&amp;nbsp;Rahole National Reserve in Kenya, instead of a place 242 km northwest of&amp;nbsp;Riyadh, Saudi Arabia.&lt;/P&gt;&lt;P&gt;You need to use SDE.ST_Transform()&amp;nbsp; to convert the lon/lat pair to EPSG 32637, something like:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;SELECT name1 
FROM   gtsowner.cm_boundary3_pg  
WHERE  sde.ST_Within(
          sde.ST_Transform(
             sde.ST_Point(45.576579,26.460792,4326),
             32637),
          shape)=1;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;except you need to use the &lt;STRONG&gt;spatial reference&lt;/STRONG&gt; IDs (which are defined locally, so I can't know what yours might be), not the &lt;STRONG&gt;coordinate system&lt;/STRONG&gt;&amp;nbsp;IDs.&amp;nbsp; You might need to create a layer with the 4326 coordinate system so that a spatial reference exists (if you haven't already).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 03:33:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/oracle-sql-query-for-fetching-data-from-table/m-p/1004934#M6872</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2020-11-26T03:33:58Z</dc:date>
    </item>
  </channel>
</rss>

