2 Replies Latest reply: Jan 4, 2013 5:37 AM by Ivan Bush RSS

    Getting No Distance from SDO_NN_DISTANCE(1) function

    982711
      Hi,

      I have a Oracle Spatial Query using sdo_nn distance function.
      I provide the X and Y coordinates as the input parameter to the funtion, in some cases I am getting the correct distance from the query but in some cases I am not getting anything in result of distance.

      PFB the Query on Nearest Aggregation Node:

      SELECT e.EQUIPMENT_NAME, round(SDO_NN_DISTANCE(1), 2) from EQUIPMENT e
      WHERE
      MDSYS.sdo_nn
      (e.shape,
      MDSYS.SDO_GEOMETRY(2001,81989,MDSYS.sdo_point_type(516786.211,173768.641,NULL),NULL,NULL),
      'sdo_num_res=1',1) = 'TRUE';

      Distance coming for below coordinates
      516781.372, 173769.726
      516779.265, 173767.098
      516776.47, 173761.633
      516780.663, 173764.303


      Distance not coming for below coordinates
      516785.147, 173765.033
      516784.167, 173762.655
      516782.79, 173764.115
      516778.66, 173761.654

      Kindly provide some guidance on the same.