Create a POINT constructor for convenience with default SRID 4326.
CREATE OR REPLACE FUNCTION point(
x NUMBER, y NUMBER, srid NUMBER DEFAULT 4326)
RETURN SDO_GEOMETRY
DETERMINISTIC
IS
BEGIN
RETURN SDO_GEOMETRY(2001, srid, SDO_POINT_TYPE(x, y, NULL), NULL, NULL);
END;
/
Function created.
SQL>
Create a table, DEM, with a SDO_GEOMETRY column, location.
SQL> l
1 CREATE TABLE DEM
2 (
3 X NUMBER
4 , Y NUMBER
5 , Z NUMBER
6 , LOCATION MDSYS.SDO_GEOMETRY
7* )
SQL> /
Table created.
Load data, rawtext, into table, DEM, by using insert select SQL.
SQL> l
1 INSERT INTO dem
2 SELECT x, y, z, point(x, y)
3* FROM points
SQL> /
236267478 rows created.
SQL>commit;
Commit complete.
No comments:
Post a Comment