Forum Stats

  • 3,827,682 Users
  • 2,260,803 Discussions
  • 7,897,336 Comments

Discussions

sdo_cs.transform

angelo_z
angelo_z Member Posts: 62
edited Oct 11, 2013 10:50AM in PHP

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

Best Answer

Answers

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,648 Employee
    Answer ✓

    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.

  • angelo_z
    angelo_z Member Posts: 62

    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

This discussion has been closed.