2 Replies Latest reply: Oct 11, 2013 9:50 AM by angelo_z RSS

    sdo_cs.transform

    angelo_z

      Hi,

      I have a problem.

      I'm using Oracle XE 10g and php version 4.3.10 (extension php_oci8.dll)

       

      I am trying to Query

       

      SELECT 

      B.geom.sdo_point.x lon,

      B.geom.sdo_point.y lat,

      B.geom.sdo_point.z hightsea,

      B.X,

      B.Y,

      B.Z

      FROM

          (select

                v.X,

                v.Y,

                v.Z,

                sdo_cs.transform(

                                 sdo_geometry(2001,32632,

                                 sdo_point_type(v.x,v.y, v.z),NULL,NULL),

                                 4326) as geom

                from table a,

                table(SDO_UTIL.GETVERTICES(a.GEOMETRY)) v 

                where

                a.id = 1

                ) B

       

      but its dont't giving me values of

       

      B.geom.sdo_point.x lon,

      B.geom.sdo_point.y lat,

       

       

      other values  B.X, B.Y are ok

       

       

       

      LON   LAT   HIGHTSEA                  X                         Y                     Z                     

      ----- ----- --------- -------------------     ---------------              ------------             ------

      ~     ~      0                       581085.259725526   4999656.38844484    0                     

       

       

      If I run the query by sqlplus I get

       

      LON                                 LAT             HIGHTSEA             X                                  Y                    Z                     

      ----------------                 ------------------            ---------           -------------------             ---------------              ------

      10.0314191084702    45.1457265334395      0               581085.259725526   4999656.38844484       0                     

       

       

      So the code is correct, the prolem I suppose is inside PHP environment configuration

       

      I have upgrade version php to 5.3.2 but problem still remains, lon and lat without result.

       

      I hope someone can help me..

       

      Thanks in advance

        • 1. Re: sdo_cs.transform
          cj

          See "Using Oracle Locator for Spatial Mapping" p.214 of The Underground PHP and Oracle Manual

           

          Version 5.3.2 is very old and you should upgrade to at least PHP 5.3.27 for stability & security reasons.

          Preferably you would upgrade to PHP 5.4 or 5.5 because 5.3 is at end of life.

          • 2. Re: sdo_cs.transform
            angelo_z

            Hi,

            I have solve the problem.

            Thank you CJ for suggest, I've upgrade to PHP 5.4 and read manual page 214, I've learnt something more,

            but the poblem still remains so  I tried to follow another way and then I find it.

            before I run this code 

            alter session set nls_numeric_characters ='.,'

            and then

            SELECT

            B.geom.sdo_point.x lon,

            B.geom.sdo_point.y lat,

            B.geom.sdo_point.z hightsea,

            B.X,

            B.Y,

            B.Z

            FROM

                (select

                     v.X,

                     v.Y,

                     v.Z,

                    sdo_cs.transform(

                                             sdo_geometry(2001,32632,

                                           sdo_point_type(v.x,v.y, v.z),NULL,NULL),

                                          4326) as geom

                     from table a,

                     table(SDO_UTIL.GETVERTICES(a.GEOMETRY)) v

                     where

                     a.id = 1

                     ) B