3 Replies Latest reply: Jan 10, 2014 9:56 AM by Ying Hu-Oracle RSS

    Oracle spatial relationships works differently from one version to another

    76199585-68de-4da5-902d-4abe8996fc57

      Hi, recently we migrate versión of Oracle, from 11.1.0.6 to 11.2.0.4, and we have some troubles with relationships in Oracle, in previous version the next script return COVERS but in actual version return TOUCH, we have many functions in Oracle using the function SDO_RELATE so its very dificult to change plsql code, my question is why is diferent the logic of relationships with this new version? or we have to do something to configure this?

       

      I appreciate all the help...

      (the script uses information that is not in the database)

       

      DECLARE

      PTX1 NUMBER;

      PTY1 NUMBER;

      PTX2 NUMBER;

      PTY2 NUMBER;

      RESULTADO VARCHAR2(100);

      SDO_GEOM_LINEA  SDO_GEOMETRY;

      SDO_GEOM_PREDIO SDO_GEOMETRY;

      BEGIN

         PTX1 := 560144.777960335;

          PTY1 := 1857775.09679448;

          PTX2 := 560141.702578807;

          PTY2 := 1857762.185737;

        

          SDO_GEOM_PREDIO:= SDO_UTIL.FROM_WKTGEOMETRY('POLYGON((560121.962326818 1857765.46802773, 560123.085106786 1857777.05962037, 560144.777960335 1857775.09679448, 560141.702578807 1857762.185737, 560121.962326818 1857765.46802773))');

          SDO_GEOM_PREDIO.SDO_SRID:=90180;

       

          SDO_GEOM_LINEA := SDO_GEOMETRY(2002,90180,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(PTX1,PTY1,PTX2,PTY2));

       

          SELECT SDO_GEOM.RELATE(SDO_GEOM_PREDIO,'DETERMINE',SDO_GEOM_LINEA,0.005) INTO RESULTADO

          FROM DUAL;

       

          DBMS_OUTPUT.PUT_LINE('ELEMENTOS: '||RESULTADO);   

         

      END;