1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| create or replace function addendpoint(line in mdsys.sdo_geometry, pt in mdsys.sdo_geometry)
return mdsys.sdo_geometry
as
begin
declare
obj mdsys.sdo_geometry;
nlinesize number;
begin
obj := line;
if ( (line is not null) and (pt is not null) and
(line.sdo_gtype=2002) and
(pt.sdo_gtype=2001) and
(line.sdo_elem_info(1)=1) and
(line.sdo_elem_info(2)=2) and
(line.sdo_elem_info(3)=1))
then
nlinesize := line.sdo_ordinates.last;
obj.sdo_ordinates.extend(2);
obj.sdo_ordinates(nlinesize+1) := pt.sdo_point.x;
obj.sdo_ordinates(nlinesize+2) := pt.sdo_point.y;
end if;
return obj;
end;
end; |
Partager