<?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 query in Oracle in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246577#M14031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't have access to the administrator account (sde). All tables and layers I created was under "MY_ACCOUNT.[table_name]" not "SDE.[table_name]". I also log in with "MY_ACCOUNT" in sqlplus. Do you think it has something to do with calling sde.st_astext(geometry)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Oct 2011 11:10:18 GMT</pubDate>
    <dc:creator>KhoaTran1</dc:creator>
    <dc:date>2011-10-21T11:10:18Z</dc:date>
    <item>
      <title>spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246573#M14027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to get the latitude and longitude of a geometry type point from an Oracle database. I've successfully set up the Oracle client to use sqlplus, get connected to the database through command line. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using ArcCatalog, the data type of my column (stop_pos) is GEOMETRY (Geometry Type: Point). However, when I do a 'DESCRIBE' through sqlplus, the type of the stop_pos column is NUMBER(38), which according to my understanding is the stop_pos.fid since I did a "SELECT stop_pos from MY_TABLE;", it gave me a list of id, equivalent to the stop_pos.fid in ArcCatalog.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to my understanding, there should be another table other than MY_TABLE in charge of handling spatial data. I've looked at "ST_GEOMETRY" and "SDO_GEOMETRY." Some posts even mentioned about USER_SDO_GEOM_METADATA but I'm unable to find any table or column with those names. I'm new to these stuff and wonder if anyone can give me a SELECT statement example query which I can get the lat and lon of the point (in my example, it was stop_pos).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 23:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246573#M14027</guid>
      <dc:creator>KhoaTran1</dc:creator>
      <dc:date>2011-10-19T23:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246574#M14028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In order to use the coordinate properties of an object-relational geometry type you need to *use*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;an object-relational geometry type.&amp;nbsp; Your layer is using SDEBINARY or SDELOB storage (which use&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;an integer key to Fn and Sn tables), not ST_GEOMETRY or SDO_GEOMETRY.&amp;nbsp; If you execute the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'sdelayer -o describe_long' command on the table, you will see the storage format.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The default storage option is set in the DEFAULTS keyword of the DBTUNE table, but the default &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DBTUNE contains keywords which will generate all supported storage types (this can be changed &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by the administrator, so there's no guarantee that's still the case in your instance).&amp;nbsp; While it's&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;possible to convert storage type to SDELOB, ST_GEOMETRY, or SDO_GEOMETRY, I generally&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;recommend creating a new table and transferring the contents to this table (there are many &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ways to do this, but you options may be limited by whether the table is registered with the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geodatabase or if it's versioned).&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>Thu, 20 Oct 2011 00:53:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246574#M14028</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-10-20T00:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246575#M14029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Vince. I followed your suggestions and re-created the table using ST_GEOMETRY. Now, I did a 'DESCRIBE' in sqlplus and the stop_pos column type is SDE.ST_GEOMETRY, followed by an OBJECTID. I did an SELECT query "SELECT stop_pos from MY_TABLE where OBJECTID='1'" and the return message was "SP2-0678: Column or attribute type can not be displayed by SQL*Plus." It's very self-explanatory message so I went ahead and looked for ST_Geometry function calls. One of them was ST_AsText (&lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisserver/9.3/java/index.htm#geodatabases/st_astext.htm"&gt;http://webhelp.esri.com/arcgisserver/9.3/java/index.htm#geodatabases/st_astext.htm&lt;/A&gt;&lt;SPAN&gt;). However, once I queried "SELECT [sde.]st_astext(stop_pos)", the error message was "ORA-00942: table or view does not exist". Any pointers?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 18:00:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246575#M14029</guid>
      <dc:creator>KhoaTran1</dc:creator>
      <dc:date>2011-10-20T18:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246576#M14030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Works fine for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
SQL&amp;gt; select sde.st_astext(shape) from envtest2;
 
SDE.ST_ASTEXT(SHAPE)
--------------------------------------------------------------------------------
POINT&amp;nbsp; ( 4.97444600 12.51409000)
POINT&amp;nbsp; ( 14.33015500 -12.69905900)
POINT&amp;nbsp; ( -5.24724800 -7.37888000)
POINT&amp;nbsp; ( 0.17672500 17.48991500)
POINT&amp;nbsp; ( 11.33672200 -4.02122600)
POINT&amp;nbsp; ( 18.29875200 19.66650600)
POINT&amp;nbsp; ( -13.42461700 8.07447900)
POINT&amp;nbsp; ( 5.70494200 -16.03418000)
POINT&amp;nbsp; ( 0.77471700 -18.01138300)
POINT&amp;nbsp; ( -19.03184400 12.74311800)
POINT&amp;nbsp; ( -15.18393200 9.95293200)
...
 
50 rows selected.
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The last time I had a customer getting ORA-00942 on ST functions, they had somehow managed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to revoke permissions from most of the SDE operators and deleted half the triggers. It was pretty&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ugly to get that instance running again.&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>Sat, 11 Dec 2021 12:16:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246576#M14030</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2021-12-11T12:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246577#M14031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't have access to the administrator account (sde). All tables and layers I created was under "MY_ACCOUNT.[table_name]" not "SDE.[table_name]". I also log in with "MY_ACCOUNT" in sqlplus. Do you think it has something to do with calling sde.st_astext(geometry)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 11:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246577#M14031</guid>
      <dc:creator>KhoaTran1</dc:creator>
      <dc:date>2011-10-21T11:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246578#M14032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The spatial type functions are owned by SDE and granted to PUBLIC.&amp;nbsp; You should never&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;load spatial data as the SDE user (in my example, I wasn't SDE, which was why the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prefix was required).&amp;nbsp; If you can't use the ST functions, you can't use ST_GEOMETRY.&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>Fri, 21 Oct 2011 11:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246578#M14032</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-10-21T11:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246579#M14033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried again and still not working. The weird thing is I'm able to execute "SELECT st_x(stop_pos) from MY_TABLE where OBJECTID='1'" and it returns the correct x-value in double. Does it make sense to you? I don't. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anything I can do to use ST_Geometry then? On another note, I was about to post another NEW thread but I guess my table creation can be wrong, so I'll post it here in the same thread. So, on previous posts, you suggested me to use ST_GEOMETRY instead of SDEBINARY/SDELOB (I can't execute sdelayer -o describe to know the exact type). So I created a new table with the ST_GEOMETRY storage. Below is my code using ArcSDE Java API. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeLayer layer = new SeLayer(conn);
 layer.setSpatialColumnName(colName);
 layer.setTableName(tableName);
 layer.setShapeTypes(shapeType);
 layer.setGridSizes(1100.0, 0.0, 0.0);;
 layer.setDescription(description);

// layer.setStorageTypes(SeLayer.SE_STORAGE_SQL_TYPE);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeExtent ext = new SeExtent(-180, -90, 180, 90);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.setExtent(ext);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.setCreationKeyword("DEFAULTS");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Define the layer's Coordinate Reference
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SeCoordinateReference coordref = new SeCoordinateReference();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; long wgs84 = new Long(4326);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coordref.setCoordSysByID(new SeObjectId(wgs84));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coordref.setXY(-210,-120,1000000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.setCoordRef(coordref);
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer.create(3, 4); &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've read many of your posts in this forum regarding setting the correct parameters, as well as ESRI documentation. And the code works fine if I use the 'DEFAULTS' storage. After adding the commented line in the code (i.e. layer.setStorageTypes(SeLayer.SE_STORAGE_SQL_TYPE);), the type of colName is 'SDE.ST_GEOMETRY' when I did a 'DESCRIBE' in sqlplus. I can get the x and y coor using st_x and st_y. However, I can't view those points in ArcCatalog, which I suspect my parameters are wrong, leading to the sde.st_astext error???? Maybe? So, could you please tell me if my parameters are correct and if not, what should I change?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: I also tried layer.setCreationKeyword("ST_GEOMETRY") and the result is the same as setStorageTypes&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:16:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246579#M14033</guid>
      <dc:creator>KhoaTran1</dc:creator>
      <dc:date>2021-12-11T12:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: spatial query in Oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246580#M14034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Creating a layer through the ArcSDE API is an advanced skill that I don't recommend until you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;can use the command-line tools in your sleep to create layers that are visible by ArcGIS (and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the command-line tools themselves are an advanced skill over the ArcCatalog GUI).&amp;nbsp; Given a &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;spatial index grid size of 1100 degrees, you've still got some learning curve yet to climb.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I prefer to create ST_GEOMETRY or SDO_GEOMETRY storage layers using SQL, then add them&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to ArcSDE with 'sdelayer -o register'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the ST functions aren't working, you'll need to ask with the keeper of the SDE user keys to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;contact Tech Support for help in straightening that out.&amp;nbsp; I don't have an example of the SQL &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query done by ArcGIS handy, but if some ST queries aren't functioning, then the draw failure&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is likely due to the lack of function support, not spatial index grid size or coordref precision.&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>Fri, 21 Oct 2011 14:19:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-query-in-oracle/m-p/246580#M14034</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-10-21T14:19:21Z</dc:date>
    </item>
  </channel>
</rss>

