This content has been marked as final.
Show 2 replies

1. Re: SDO_ORDINATE_ARRAY precision control
John O'Toole Nov 26, 2009 10:32 PM (in response to 719401)You can do this in FME using the [CoordinateRounder http://docs.safe.com/fme/html/Transformers/content/transformers/coordinaterounder.htm] transformer.
There's no function available in Spatial to do this, but its pretty straightforward to do. Here's a sample function:CREATE OR REPLACE Function Round_Coordinates(p_geometry IN MDSYS.SDO_GEOMETRY, p_tolerance IN NUMBER) RETURN MDSYS.SDO_GEOMETRY IS v_dim number; v_gtype number; v_geometry mdsys.sdo_geometry := p_geometry; v_ordinates mdsys.sdo_ordinate_array; v_round_factor number; Begin v_gtype := Mod(p_geometry.sdo_gtype,10); v_dim := SUBSTR(p_geometry.sdo_gtype,1,1); v_ordinates := p_geometry.sdo_ordinates;  Compute rounding factors v_round_factor := round(log(10,(1/p_tolerance)/2));  If point update differently to other shapes... IF ( v_geometry.sdo_point is not null ) Then v_geometry.sdo_point.X := round(v_geometry.sdo_point.x, v_round_factor); v_geometry.sdo_point.Y := round(v_geometry.sdo_point.y, v_round_factor); If v_dim > 2 Then v_geometry.sdo_point.z := round(v_geometry.sdo_point.z, v_round_factor); End If; END IF; IF ( v_gtype <> 1 ) THEN FOR i in v_ordinates.FIRST..v_ordinates.LAST LOOP v_ordinates(i) := round(v_ordinates(i), v_round_factor); END LOOP; END IF; RETURN mdsys.sdo_geometry(v_geometry.sdo_gtype, v_geometry.sdo_srid, v_geometry.sdo_point, v_geometry.sdo_elem_info, v_ordinates); END Round_Coordinates; /

2. Re: SDO_ORDINATE_ARRAY precision control
719401 Nov 27, 2009 12:52 PM (in response to John O'Toole)Thanks and cheers
Jun