Home » Server Options » Spatial » oracle spatial coordinates to relational (2 threads merged by bb) (windows xp)
oracle spatial coordinates to relational (2 threads merged by bb) [message #511256] |
Fri, 10 June 2011 08:24  |
 |
swapnabpnn
Messages: 96 Registered: December 2010
|
Member |
|
|
Hi,
I tried inserting spatial coordiantes into relational type ,i.e into SDO_X1,SDO_Y1 individually.this is of point feature type.So the following is working fine for point features.
SQL> CREATE OR REPLACE procedure migration
2 AS
3 BEGIN
4 FOR cur_1 IN(SELECT a.GEOM.sdo_point v_ord from pole a)
5 LOOP
6 insert into B$GC_P_S_SDOGEOM(SDO_X1,SDO_Y1)values(cur_1.v_ord.X,cur_1.v_ord.Y);
7 END LOOP;
8 END migration;
9 /
But the problem is with linear features since it will have more coordinates,but in target I had only SDO_X1,SDO_Y1,SDO_X2,.....SDO_X4,SDO_Y4 i.e only 8 coordinates are available for each record.So we need to insert into next record for the remaining coorrdinates in source.For example if in source first record has 10 coordinates,8 out of 10 need to be inserted into first record of target,then remaining two into next record.likewise it will take for other records of source to target.I tried writing as follows,but could not proceed further with the logic
SQL> CREATE OR REPLACE procedure sp_migration_lnr
2 AS
3 v_coord SDO_ORDINATE_ARRAY;
4 BEGIN
5 FOR cur_1 IN(SELECT a.GEOM.sdo_ordinates v_coord from cable)
6 LOOP
7 v_count := v_coord.COUNT;
8 FOR p IN 1..v_count
9 IF (MOD(p,8) = 0 ) THEN
10 insert into B$GC_CBL_L_SDOGEOM()values();
--------how to write logic please help me----------------
11 ELSE
12
13 END LOOP;
14 END sp_migration_lnr;
15 /
Also target table structure is as follows
SQL> CREATE TABLE B$GC_CBL_L_SDOGEOM
2 (
3 G3E_ID NUMBER(10),
4 G3E_FID NUMBER(10),
5 SDO_X1 FLOAT(126),
6 SDO_Y1 FLOAT(126),
7 SDO_X2 FLOAT(126),
8 SDO_Y2 FLOAT(126),
9 SDO_X3 FLOAT(126),
10 SDO_Y3 FLOAT(126),
11 SDO_X4 FLOAT(126),
12 SDO_Y4 FLOAT(126)
13 );
Please help me with the logic.....
Thanks.......
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 07 13:32:35 CDT 2025
|