6 Replies Latest reply: Apr 6, 2011 8:36 AM by Franz RSS

    SDO_CS.TRANSFORM: ORA-13285

    Franz
      Hi all,

      I'm trying to calculate staring and ending point of lines.
      I'm using Oracle 11g R2 EE.

      To do that I use the following workflow:
      1) SDO_CS.TRANSFORM - I transfrom geometry to use LRS functions
      2) SDO_LRS.CONVERT_TO_LRS_GEOM - I convert to lrs
      3) SDO_LRS.GEOM_SEGMENT_END_PT - I get end point
      4) SDO_LRS.CONVERT_TO_STD_GEOM - I go back to standard geometry

      In many cases my function works properly, but sometimes I have problems with SDO_CS.TRANSFORM.

      Here it is an example of the problem:

      SELECT SDO_CS.TRANSFORM(
      MDSYS.SDO_GEOMETRY(2002,352257,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,4,3,1,2,1,5,2,2,9,2,1),MDSYS.SDO_ORDINATE_ARRAY(
      737347.58,142362.83,
      737353.37,142362.09,
      737360.96,142361.36,
      737361.82,142361.45,
      737362.56,142361.88,
      737371.36,142369.73,
      737384.97,142382.38,
      737387.44,142383.8,
      737390.28,142384.55,
      737392.36,142384.33,
      737395.58,142382.28))
      ) FROM DUAL;

      At my site it fails with this error:

      ORA-13285: Errore di trasformazione delle coordinate geometriche
      ORA-06512: a "MDSYS.SDO_CS", line 75
      ORA-06512: a "MDSYS.SDO_CS", line 112
      ORA-06512: a "MDSYS.SDO_CS", line 2678
      +13285. 00000 - "Geometry coordinate transformation error"+
      *Cause:    A coordinate pair was out of valid range for a conversion/projection.+
      *Action:   Check that data to be transformed is consistent with the desired+
      conversion/projection.
                
      The strange thing is that if I change the triplet "5,2,2" in SDO_ELEM_INFO_ARRAY in "5,2,1", it works fine.

      Any suggestion on ho to build a workaround?
        • 1. Re: SDO_CS.TRANSFORM: ORA-13285
          NoelKhan
          Franz,

          . . . .If arcs are causing a problem, you could stroke them using { SDO_GEOM.SDO_ARC_DENSIFY | http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_objgeom.htm#i867686 }.
          -- "Original statement"
          SELECT SDO_CS.TRANSFORM(
              MDSYS.SDO_GEOMETRY(
                  2002,352257,NULL,
                  MDSYS.SDO_ELEM_INFO_ARRAY(1,4,3,1,2,1,5,2,2,9,2,1),
                  MDSYS.SDO_ORDINATE_ARRAY(
                      737347.58,142362.83,
                      737353.37,142362.09,
                      737360.96,142361.36,
                      737361.82,142361.45,
                      737362.56,142361.88,
                      737371.36,142369.73,
                      737384.97,142382.38,
                      737387.44,142383.8,
                      737390.28,142384.55,
                      737392.36,142384.33,
                      737395.58,142382.28
                  )
              )
              -- "NOTE: Here, I'm transforming from 352257 to 8307"
              ,8307
          ) FROM DUAL;
          
          --"13285. 00000 - Geometry coordinate transformation error"
          --"*Cause: A coordinate pair was out of valid range for a conversion/projection."
          --"*Action: Check that data to be transformed is consistent with the desired"
          --"conversion/projection."
          
          
          -- "Modified Statement"
          SELECT SDO_CS.TRANSFORM(
              -- "The ARC_DENSIFY call wraps your geometry"
              SDO_GEOM.SDO_ARC_DENSIFY(
                  MDSYS.SDO_GEOMETRY(
                      2002,352257,NULL,
                      MDSYS.SDO_ELEM_INFO_ARRAY(1,4,3,1,2,1,5,2,2,9,2,1),
                      MDSYS.SDO_ORDINATE_ARRAY(
                          737347.58,142362.83,
                          737353.37,142362.09,
                          737360.96,142361.36,
                          737361.82,142361.45,
                          737362.56,142361.88,
                          737371.36,142369.73,
                          737384.97,142382.38,
                          737387.44,142383.8,
                          737390.28,142384.55,
                          737392.36,142384.33,
                          737395.58,142382.28
                      )
                  ),
                  0.001,
                  'arc_tolerance=0.001 unit=m'
              )
              -- "NOTE: Here, I'm transforming from 352257 to 8307"
              ,8307
          ) FROM DUAL;
          
          -- "SDO_GEOMETRY(2002, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(9.22530931, 46.4182936, "
          --"9.22538438, 46.4182857, 9.22548286, 46.4182776, 9.22548446, 46.4182775, 9.22548607, 46.4182775, 9.22548768, "
          --"46.4182775, 9.22548929, 46.4182776, 9.22549088, 46.4182777, 9.22549246, 46.418278, 9.22549402, 46.4182782, "
          --"9.22549554, 46.4182786, 9.22549704, 46.418279, 9.22549849, 46.4182795, 9.2254999, 46.41828, 9.22550127, "
          --"46.4182806, 9.22550257, 46.4182813, 9.22550382, 46.418282, 9.22562058, 46.4183508, 9.22580131, 46.4184617,"
          --"9.22583385, 46.418474, 9.225871, 46.4184802, 9.22589798, 46.4184778, 9.22593925, 46.4184587))"
          Regards,
          Noel
          • 2. Re: SDO_CS.TRANSFORM: ORA-13285
            Siva Ravada
            What is the target SRID you are using ?

            siva
            • 3. Re: SDO_CS.TRANSFORM: ORA-13285
              Franz
              Thanks Noel, SDO_GEOM.SDO_ARC_DENSIFY fixed my problem.

              Only a note: I do not understand why you have transformed from 352257 to 8307.
              In my code I left 352257 and seems working properly.

              Best regards

              Francesco
              • 4. Re: SDO_CS.TRANSFORM: ORA-13285
                Franz
                Hi Siva,

                my target SRID is 352257

                Best regards

                Francesco
                • 5. Re: SDO_CS.TRANSFORM: ORA-13285
                  Siva Ravada
                  352257 seems to be the source SRID as that is the one in the geometry.
                  What SRID are you transforming to ? In the SQL you posted, it does not show the target SRID.

                  siva
                  • 6. Re: SDO_CS.TRANSFORM: ORA-13285
                    Franz
                    I use TRANSFORM to be able to use SDO_LRS.CONVERT_TO_LRS_GEOM and then to use other LRS functions to get first and ending point of a line. At the end I go back standard geometry by use of CONVERT_TO_STD_GEOM.
                    I am not interested in transformation. I need to get a starting and ending point of a linear geometry, so the source and destination SRID are the same.

                    My workflow is:
                    1) I get a geometry
                    2) I use SDO_GEOM.SDO_ARC_DENSIFY to eliminate arcs that generate problems in some cases
                    3) I use SDO_CS.TRANSFORM to transfrom geometry to use LRS functions
                    4) I use SDO_LRS.CONVERT_TO_LRS_GEOM to convert to lrs
                    5) I use SDO_LRS.GEOM_SEGMENT_END_PT to get end point
                    6) I use SDO_LRS.CONVERT_TO_STD_GEOM to go back to standard geometry

                    The result seems correct, but may be I'm doing some useless passage....

                    Edited by: Franz on 6-apr-2011 6.35