<?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 Need Help with using SDO_NN in a query task in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/need-help-with-using-sdo-nn-in-a-query-task/m-p/513001#M2456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, big problems. Got a system going to test on Friday and suddenly found out that it's not working properly. I'm using SDO_NN with sdo_batch_size as the layer I'm querying has other criteria (with sdo_num_res I get less than the desired results as SDO_NN runs before pure textual condition). Unfortunately, through ArcGIS Server the results I'm getting back are incorrect and it's missing an obvious nearest feature. To make matters worse, when I tested out a sample WHERE clause in ArcMap it also displayed the wrong set of features, but when I then did a "select all" features, the highlights were clustered around the centre point of the SDO_NN.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the sample SDO_NN WHERE clause:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;SDO_NN(SHAPE, MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(357582,174474,0),NULL,NULL), 'sdo_batch_size=0') = 'TRUE' AND ROWNUM &amp;lt;= 10&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have also tried the following, containing a sub-query, which appears to give the right results, but takes ages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;MI_PRINX IN (SELECT OBJECTID FROM COMMUNITY.CV_COMMUNITY_VENUES WHERE SDO_NN(CV_COMMUNITY_VENUES.SHAPE, MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(357582,174474,0),NULL,NULL), 'sdo_batch_size=0') = 'TRUE') AND ROWNUM &amp;lt;= 10&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incidentally, the source layer either has a definition query, or is a view, containing the condition specifying that a publish flag field is true, as some data cannot be published yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone has had experience of this, has an example of successful use of this, or knows of a way of getting ArcGIS Server to return the nearest X features relative to a point, please comment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jul 2011 06:00:41 GMT</pubDate>
    <dc:creator>AndrewClark</dc:creator>
    <dc:date>2011-07-06T06:00:41Z</dc:date>
    <item>
      <title>Need Help with using SDO_NN in a query task</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/need-help-with-using-sdo-nn-in-a-query-task/m-p/513001#M2456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, big problems. Got a system going to test on Friday and suddenly found out that it's not working properly. I'm using SDO_NN with sdo_batch_size as the layer I'm querying has other criteria (with sdo_num_res I get less than the desired results as SDO_NN runs before pure textual condition). Unfortunately, through ArcGIS Server the results I'm getting back are incorrect and it's missing an obvious nearest feature. To make matters worse, when I tested out a sample WHERE clause in ArcMap it also displayed the wrong set of features, but when I then did a "select all" features, the highlights were clustered around the centre point of the SDO_NN.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the sample SDO_NN WHERE clause:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;SDO_NN(SHAPE, MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(357582,174474,0),NULL,NULL), 'sdo_batch_size=0') = 'TRUE' AND ROWNUM &amp;lt;= 10&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have also tried the following, containing a sub-query, which appears to give the right results, but takes ages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;MI_PRINX IN (SELECT OBJECTID FROM COMMUNITY.CV_COMMUNITY_VENUES WHERE SDO_NN(CV_COMMUNITY_VENUES.SHAPE, MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(357582,174474,0),NULL,NULL), 'sdo_batch_size=0') = 'TRUE') AND ROWNUM &amp;lt;= 10&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incidentally, the source layer either has a definition query, or is a view, containing the condition specifying that a publish flag field is true, as some data cannot be published yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone has had experience of this, has an example of successful use of this, or knows of a way of getting ArcGIS Server to return the nearest X features relative to a point, please comment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2011 06:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/need-help-with-using-sdo-nn-in-a-query-task/m-p/513001#M2456</guid>
      <dc:creator>AndrewClark</dc:creator>
      <dc:date>2011-07-06T06:00:41Z</dc:date>
    </item>
  </channel>
</rss>

