Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
Convert KML to SDO_GEOMETRY

793484
Member Posts: 15
I'm trying to convert a KML file into SDO_GEOMETRY to load into a table for use with mapviewer. After searching documentation and the Internet colleague and I came up with the following:
DECLARE
dest_clob CLOB;
src_clob BFILE := BFILENAME('EXAMPLE_LOB_DIR', 'test.kml');
dst_offset number := 1 ;
src_offset number := 1 ;
lang_ctx number := DBMS_LOB.DEFAULT_LANG_CTX;
warning number;
sdo_geom SDO_GEOMETRY;
BEGIN
DBMS_LOB.FILEOPEN(src_clob, DBMS_LOB.FILE_READONLY);
DBMS_LOB.CREATETEMPORARY(dest_clob,true);
DBMS_LOB.LoadFromFile(
dest_clob
, src_clob
, DBMS_LOB.GETLENGTH(src_clob)
);
DBMS_LOB.FILECLOSE(src_clob);
sdo_geom := SDO_UTIL.FROM_KMLGEOMETRY(dest_clob);
insert into cities(city, location, state_abrv, pop90, rank90)
values('Harpers Ferry', sdo_geom, 'NE', 30000, 175);
COMMIT;
END;
/
However, we're getting this error:
Error report:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.RuntimeException: Message:KML Geometry type kml not supported.
Description:
ORA-06512: at "MDSYS.SDO_UTIL", line 232
ORA-06512: at line 19
29532. 00000 - "Java call terminated by uncaught Java exception: %s"
*Cause: A Java exception or error was signaled and could not be
resolved by the Java code.
*Action: Modify Java code, if this behavior is not intended.
It appears as though SDO_UTIL.FROM_KMLGEOMETRY (line 19) is erroring out because it cannot accept KML input. Since that probably isn't the case, something else must be wrong, but neither my colleague nor I know what we're doing wrong. Can anyone help us?
DECLARE
dest_clob CLOB;
src_clob BFILE := BFILENAME('EXAMPLE_LOB_DIR', 'test.kml');
dst_offset number := 1 ;
src_offset number := 1 ;
lang_ctx number := DBMS_LOB.DEFAULT_LANG_CTX;
warning number;
sdo_geom SDO_GEOMETRY;
BEGIN
DBMS_LOB.FILEOPEN(src_clob, DBMS_LOB.FILE_READONLY);
DBMS_LOB.CREATETEMPORARY(dest_clob,true);
DBMS_LOB.LoadFromFile(
dest_clob
, src_clob
, DBMS_LOB.GETLENGTH(src_clob)
);
DBMS_LOB.FILECLOSE(src_clob);
sdo_geom := SDO_UTIL.FROM_KMLGEOMETRY(dest_clob);
insert into cities(city, location, state_abrv, pop90, rank90)
values('Harpers Ferry', sdo_geom, 'NE', 30000, 175);
COMMIT;
END;
/
However, we're getting this error:
Error report:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.RuntimeException: Message:KML Geometry type kml not supported.
Description:
ORA-06512: at "MDSYS.SDO_UTIL", line 232
ORA-06512: at line 19
29532. 00000 - "Java call terminated by uncaught Java exception: %s"
*Cause: A Java exception or error was signaled and could not be
resolved by the Java code.
*Action: Modify Java code, if this behavior is not intended.
It appears as though SDO_UTIL.FROM_KMLGEOMETRY (line 19) is erroring out because it cannot accept KML input. Since that probably isn't the case, something else must be wrong, but neither my colleague nor I know what we're doing wrong. Can anyone help us?
Answers
This discussion has been closed.