Search code examples
oracle-databasetransformoracle-spatial

is there a way to bulk transform sdo_ordinates of polygon


  SELECT
           LONGLAT(SDO_CS.TRANSFORM(
                    SDO_GEOMETRY(2001,82397,SDO_POINT_TYPE(LAT,LONGI, 0),NULL,NULL),
                    4326).SDO_POINT.X,
           SDO_CS.TRANSFORM(
                    SDO_GEOMETRY(2001,82397,SDO_POINT_TYPE(LAT, LONGI,0),NULL,NULL),
                    4326).SDO_POINT.Y)
                   INTO retVAL
          FROM DUAL; 

so i have the code above that convert the coordinates of a point but how can i do it in a polygon


Solution

  • Not sure what you want to do. But if you want to transform a polygon, you just use the same SDO_CS.TRANSFORM function.

    Assuming a table like this:

    CREATE TABLE US_STATES (
      STATE_CODE CHAR(2),
      GEOM SDO_GEOMETRY
    )
    

    You can transform the geometries like this:

    SELECT SDO_CS.TRANSFORM(GEOM,4326) FROM US_STATES;