0
votes

I am trying to convert what is supposedly UTM Zone 33, Northern Hemisphere (WGS 84) SRID (Norway) to Lat/Long (Longitude / Latitude (WGS 84) SRID) via Oracle Spatial and found some good examples on stackoverflow. The issue is, which ever SRID use as the source one (that references UTM 33N), the result in lat/long seems to be offset and puts any location to offshore towards the west.

Code:

select t.sdo.sdo_point.x as x
     , t.sdo.sdo_point.y as y
  from (select sdo_cs.transform( 
                       sdo_geometry( 2001
                                   , 82347  -- UTM Zone 33N SRID,
                                   , SDO_POINT_TYPE(a.coordinate_x,a.coordinate_y,NULL)
                                   , null
                                   , null)
                             , 8307     --Longitude / Latitude (WGS 84)  SRID  
                            ) as sdo
        from table a
      ) t;

One of my colleagues actually hardcoded a step by step calcuation in SAS based on: http://www.uwgb.edu/dutchs/usefuldata/utmformulas.htm )

and his result was

Northing 6716777, Easting 40137 --> Lat 60.321808644 Long 6.6585114124

which actually matched Google Maps.

The code from above, for the same input values for me generates:

64.0777530402641 0.231518684247992

I get similar values for other SRIDs like 32633.

Any ideas what I am doing wrong?

1

1 Answers

0
votes

Ooops, seems in the database x and y are the other way around (mislabeled), when rotated, worked fine!