/ / $Header: README.txt 11-feb-2008.15:38:21 rkothuri Exp $ / / README.txt / / Copyright (c) 2007, Oracle. All Rights Reserved. / / NAME / README.txt - / / DESCRIPTION / / / NOTES / / / MODIFIED (MM/DD/YY) / rkothuri 12/06/07 - Readme for KMZ rendering / rkothuri 12/06/07 - Creation / Description: This demo script converts 3D buildings with textures stored in Oracle schema to KML/KMZ files to be viewed using Google Earth. The demo assumes the 3D building information is stored in following tables. More information on obtaining data from partners in the format can be obtained from the OTN page for Oracle Spatial at http://www.oracle.com/technology/sample_code/products/spatial/ Building_group_3d: containing bgrp_id: number geom: sdo_geometry (footprint of building_group) Each building_group has multiple buildings. Each building has a roof (stored in building_roof_3d table), and a set of facades (stored in a building_facade). Each facade has a geometry extent and a texture image to superimpose on the facade. Building_base_3d: containing bgrp_id: number building_id: number primary key geom: sdo_geometry (base solid of building) ... other attributes Building_Roof_3d: containing Building_id: number primary key, roof_colour: hex string geom: sdo_geometry for roof the roof (SDO_GEOMETRY) of each building, Building_facade_3d: containing building_id: number facade_id : number primary key geom: sdo_geometry for facade texture: image (BLOB storing a jpg etc) for facade Setup: 1. Copy included sdoutl.jar to $ORACLE_HOME/md/jlib/. (make a copy of original sdoutl.jar as sdoutl.jar.orig so that you can revert). 2. Connect to SQLPLUS as SYSDBA (just dba user wont work) and execute: call dbms_java.loadjava(' -resolve -synonym -schema MDSYS -grant PUBLIC md/jlib/sdoutl.jar'); ALTER SESSION SET CURRENT_SCHEMA=MDSYS; @@sdoutlh.sql quit; 3. Add "utl_file_dir=" in file. 4. Shutdown and Restart the database. 5. Run scripts.sql to load additional pl/sql utility functions in the schema of choice (default is scott) 6. Import 3D Demo data from data Provider (see OTN link) into the schema. 7. You can use the provided SDOToKMZ.class as is. The source code SDOToKMZ.java is also provided (for any specific modification that you need). 8. Compile SDOToKMZ.java if modified (or use SDOToKMZ.class) SDOToKMZ.java: Compile with sdoapi.jar, sdotype.jar, sdoutl.jar in $ORACLE_HOME/md/jlib and ojdbc5.jar, xmlparserv2.jar in $ORACLE_HOME/lib. This will overwrite the SDOToKMZ.class that is provided (alternately you can use the SDOToKMZ.class as is). 9. Edit parameters in start.sh or start.bat. start.sh (unix), start.bat (windows): This shell script has the required command to run the compiled SDOToKMZ program. Note that you may want to edit the connection parameters. Also the file_paths directory is the (current) directory you want to put your image files (same as the utl_file_dir in init.ora) 10. Run as ./start.sh (unix) or start.bat (windows) 11. The script will output three files - doc.kml: the top-level KML file - BG1.kmz: the kmz for Building Group 1 - BG2.kmz: the kmz for Building Group 2 Click on the doc.kml and it will open up Google Earth and show the buildings.