Oracle Spatial Cartridge

Java Visualizer 1.0

Overview & Users Guide

1/12/98

Overview

The Oracle Spatial Cartridge Java Visualizer is a interactive Java application/applet which enables the visualization of the Spatial Cartridge layers within your tablespace. This tool is not intended to be a 'mapping' or GIS application; rather, it is a visual inspection tool which also presents an easy-to-use graphical interface to some of the management and performance tools provided with the Spatial Cartridge. The Java Visualizer was created using the Oracle Spatial Cartridge Java Class library, which is also distributed with the Spatial Cartridge and the Java Visualizer. It can use Oracles thin JDBC drivers for database connectivity which do not require SQL*Net on the client machines or Oracles JDBC OCI drivers. These drivers are available from the Oracle web site for download.

The Visualizer may be run as an applet launched from a web browser or as a stand-alone Java application. The application has more rights therefore it can connect to all databases which you could connect to normally. As an applet, the Visualizer requires much less setup but does have the constraint that you can only view databases on the server from which you downloaded the applet.

Installation

Components

The Oracle Spatial Cartridge Java Visualizer is comprised of and requires the following components:

*Included in the Oracle Spatial Cartridge Visualizer Distribution

Installation tasks

Download and install the following in you haven't already done so.

a) Java JDK 1.1 - ( note: This application was developed using JDK 1.1.4. )

From http://www.javasoft.com/products/jdk/1.1/index.html

b) Oracle JDBC drivers

From http://technet.oracle.com/public/spotlite/java/jdbc.htm

To run as an application modify or set the CLASSPATH enviroment

variable to include :

.<install dir>OraSCV\Visualizer.jar;<jdk install dir>\Lib\classes.zip;

<jdbc install ir>\jdbc\lib\classes111.zip;

For example:

c:\java might be where you install all of your java related tools.

c:\java\jdk1.1.4\lib\classes.zip <jdk install dir = c:\java\jdk1.1.4>

c:\java\jdbc\lib\classes111.zip <jdbc install dir = c:\java>

SET CLASSPATH =

CLASSPATH%;.;C:\OraSCV\Visualizer.jar;

C:\JAVA\JDK1.1.4\LIB\CLASSES.LIB;C:\JAVA\JDBC\LIB\CLASSES111.ZIP

To run as an application also modify or set your PATH enviroment variable

to include :

<jdk install dir>bin

For example:

c:\java\jdk1.1.4\bin

SET PATH = %PATH%;C:\JAVA\JDK1.1.4\BIN

Login to PL/SQL as MDSYS/MANAGER and do the following:

> @<oracle home>\rdbms73\admin\sdowin.sql

> @<oracle home>\rdbms73\admin\prvtwin.plb

*note : 7.3.3 example

Login to PL/SQL as MDSYS/MANAGER and do the following:

> @<install directory>/OraSCV/source/sdoOracle/sdo_tune.sql

> @<install directory>/OraSCV/source/sdoOracle/prvttune.plb

Login to PL/SQL as username/password and do the following:

>@<install directory>/OraSCV/source/sdoOracle/OraSCV.sql

Login to PL/SQL as MDSYS/MANAGER and do the following:

CREATE TABLE SDOSUITE$DICTIONARY( SDO_PREFIX VARCHAR(32), ATTTRIBUTE_TABLE VARCHAR(32), SDO_GID_COLUMN VARCHAR(32)) ;

When you have created an Spatial Layer which corresponds to an attribute table you can do the following to make the visualizer aware of this relation.

Assume their is an attribute table CENSUSDATA with a primary key TRACTNUM and a Spatial Layer TRACTS_<_> whose SDO_GID column corresponds to TRACTNUM.

Login to PL/SQL as user/password and do the following:

INSERT INTO MDSYS.SDOSUITE$MANAGER( 'TRACTS', 'CENSUSDATA', 'TRACTNUM' ) ;

Now you can bring up the attribute layer in the visualizer.

To run the Visualizer as an application:

set your default to <installation directory>/OraSCV

Type

java Visualizer

To run the Visualizer from a web browser:

Place a link to

<installation director>OraSCV/OraSCV.html

From a page off of a web server which also runs the Oracle database with the Spatial Cartridge. Then merely click on that link.

Menu Options And Commands

On the Menu Bar you will find File Edit View Query Option Analysis.

File

Connect…

Use this option to establish your connection to the database. You will see a dialog appear asking for a username, password and URL. The URL is represented as <Hostname> <PORT> <ORACLE SID> e.g. MyMachine 1521 MySID. You can set the default values for this by editing the file <installation directory>/Visualizer/Config.SDO and modifying the appropriate fields (.e.g. host=,port=,sid=).

Disconnect

Once you disconnect, you may connect to a different database.

Exit

Disconnects from database and closes application.

Edit

Layer…

This opens a dialog displaying the spatial cartridge layers in your tablespace, if any. Here you have the option to modify layer parameters such as ordinate count, index level and dimensional bounds. You may also create a new layer or remove an existing layer.

Index…

This opens a dialog displaying the spatial cartridge layers in your tablespace, if any. Here you may modify a layers index level and re-index the layer in a single or multiple transactions.

View

Draw/Reset*

Draws all layers selected in the layer list.

Zoom In*

After selecting zoom, use the cursor to drag a box around area to zoom in to.

Zoom Out*

Zoom out to the previous level of zoom.

* indicates there is also a tool bar button

(view continued)

AttributeTable

If you have created an entry in the MDSYS.SDOSUITE$MANAGER table which relates a Spatial Cartridge layer to an attribute table, and have de-selected all layers in the layer list except that layer, a Java list box will appear containing the rows from the attribute table. By clicking on the point records in the map area, the corresponding record(s) in the attribute table will be highlighted.

Query

Box*, Polygon*, Circle*

Enables you to utilize the cursor to define a box, polygon or circle to define you area of interest for you spatial query. Once defined, press Perform Query or <Query><Execute>.

GID*

This opens a dialog displaying the spatial cartridge layers in your tablespace, if any. Here you can specify or select a GID and click 'Show GID' to draw it, or 'Show Tiles' to show the tiles representing the spatial index for this single GID.

Execute*

Executes the spatial query.

* indicates there is also a tool bar button

Option

Draw To Extent

Enable Preview Mode

Primary Filter Only

When checked, this option disables the secondary or exact geometric computations. The results of your spatial query will return very fast but will only represent the interaction between the spatial indexes of the objects. Un-checking the option enables the computation of the exact spatial relationship.

Query On MouseUp

When checked, your spatial queries will be automatcially performed when you release your mouse button, e.g. after dragging a box over your layer.

Show Selectivity Info

Layer Colors…

This opens a dialog displaying the spatial cartridge layers in your tablespace, if any. Here you have the option to modify run-time only color attribute of each layer .

Show Errors…

This brings the always-present error dialog to the top window.

Analysis

Histogram…

This tool helps you understand the complexity and expanse of your geometries by graphing the objects per area interval and the objects per verticy interval. This opens a dialog displaying the spatial cartridge layers in your tablespace, if any. Select a graph to generate. The first graph represents the number of tiles at given tile levels. The second graph calculates the minimum bounding rectangle (MBR) for each distinct GID and increments the appropriate interval. The graph then represents a frequency analysis showing the distribution of elements by area. The third graph represents the distribution of elements by number of verticies.

Estimate Level…

Use this dialog to select a layer and help you determine a good starting level to index your data.

Estimate Time…

Use this tool to help estimate the time to index a given layer.

Usage Notes & Example

Connecting to your database:

<File><Connect>

Enter Username : SDODEMO

Enter Password : SDODEMO

Change URL : <machine name> 1521 ORCL

Click OK

Note: the machine name represents a valid TNS name when using the OCI driver. For example, you should be alble to get valid results from trying TNSPING <machine name>. When using the

All of the spatial layers available in the tablespace will be listed in the Layer List area. Select the table(s) you want to display. Do <View> <Draw/Reset>. This will fetch the data, cache it locally and display it in the Map Area. The Status Window will again keep you abreast of your progress.

Now select <View><Zoom>. Drag a box over an area of interest. You will now be zoomed into that area. If you have specified an attribute/Spatial Layer relation in the MDSYS.SDOSUITE$DICTIONARY table click on all of the layers in the Layer List area to so that just the one layer your are interested in is highlighted. Do <View><Attribute Table> . This will open a Java table with all he rows of the attribute table in it. Now using the cursor, click on any of the objects in the Map Area and the corresponding record in the Java table will be hi-lighted.

Now select <Query><Circle>. Drag a circle over your layers and click Perform Query. Notice

the objects in the layers which interact with your query area change color.

Other interesting features : The visualizer helps manage your layers by allowing you to index, specify meta-data parameters, create layers, drop layers and perform index analysis.

Appendix A - URL's

Oracle : http://www.oracle.com

Spatial Cartridge : http://www.oracle.com/st/cartridges/spatial/

Oracle JDBC : http://www.us.oracle.com/st/products/jdbc/

Appendix B - configuration file

 
-- Oracle Spatial Cartridge Visualizer Configuration File       ;
-- recognized keywords                                          ;
-- connect, host, port, sid, logfile, errorfile                 ;
--                                                              ;
-- Each line must be terminated by a semicolon                  ;
-- Valid characters are                                         ;
-- Any digit, letter or space and . - _ ~!@#$%^&*(){}[]:/\   ;
--                                                              ;
-- Copyright 1998                                               ;
-- Oracle Corporation                                           ;
-- All rights reserved                                          ;
--                                                              ;
connect=jdbc oci7;
host=jkeaveney-pc;
port=1521;
sid=ORCL;
logfile=sdojava.log;
errorfile=errors.log;