------------------------------------------------------------------------------- Oracle10g Spatial Release 10.1.0.2.0 Release ------------------------------------------------------------------------------- TABLE OF CONTENTS ----------------- -------------------- Installation ------------ Refer to the Spatial User Guide for instructions on how to install Spatial. Oracle Spatial User's Guide and Reference Part Number A86770-01 (i) Connect as SYSTEM AS SYSDBA and create the MDSYS user. Run the $ORACLE_HOME/md/admin/mdprivs.sql file. (ii) Connect as SYS as SYSDBA and run the script catmd.sql. This script is in $ORACLE_HOME/md/admin. This will install the Spatial product. New Features in 10iR1 ------------------- (i) New Topology and Network data models to support land management, cadastral, and utility applications. (ii) New GeoRaster data model to support Raster/DEM and Geo referenced images. (iii) Database Geocoder to convert address information to longitude/latitude. This geocoder works completely inside the database with data stored in Oracle Spatial geocoder schema. ========= Addendum to the Spatial user guide ======================= Usage of SDO_NN operator when two (or more) tables are joined: -------------------------------------------------------------- Specify "leading" hint for the outer table and the "index" hint for the inner table. Note that the inner table (the table with spatial index) is specified last in the order. An example is given below: SELECT /*+ LEADING(b) INDEX(a cola_spatial_idx) */ a.gid FROM cola_qry b, cola_markets a WHERE b.gid =1 and SDO_NN(a.shape, b.shape, 'querytype=window sdo_num_res=1')='TRUE'; ========= Addendum to the Spatial GeoRaster user guide ======================= Physical Storage of Raster Cell Data ------------------------------------- If the cell depth is greater than 8 bits, GeoRaster cell data is stored in big-endian format in raster blocks (BLOBs). If the cell depth is less than 8 bits, each byte in the raster blocks (BLOBs) contains two or more cells, so that the bits of a byte are fully filled with cell data. The cells are always filled into the byte from left to right. For example, if the cell depth is 4 bits, one byte contains two cells: the first four bits of the byte contain the value of a cell, and the second four bits contain the value of its following cell, which is determined by the interleaving type. BLOB Output of SDO_GEOR.getRasterSubset ---------------------------------------- After the SDO_GEOR.getRasterSubset procedure completes, the rasterBLOB parameter contains the cell/pixel data in the cropped window without tiling. The interleaving type is the same as for the GeoRaster object from which the subset was taken. The BLOB has no padding, except when the cell depth is less than 8 bits and the total number of bits needed for the output cannot be divided by 8; in these cases, unlike normal padding, only the last byte of the result is padded with 0 (zeros) for the trailing bits. Error Cases When Updating GeoRaster Metadata --------------------------------------------- The SDO_GEOR package defines many subprograms to update the metadata and ancillary data for a GeoRaster object. These subprograms, most of whose names start with set, return a general error ORA-13418 "null or invalid parameter(s) for set functions" when the update can not be successfully carried out. This section explains the causes of such errors in more detail. It generally complements the Usage Notes for those subprograms in the Oracle Spatial GeoRaster manual, except in the case of any contradictions, where this section supersedes the manual. SDO_GEOR.setBinTable raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the tableName parameter is an empty string(''). SDO_GEOR.setBlankCellValue raises error ORA-13421 if the value parameter is null or inconsistent with the cellDepth specification, or ORA-13418 if the GeoRaster object is not blank. SDO_GEOR.setColorMap raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or red/green/blue/alpha values are null or out of scope, or there are duplicates in the cellValue array, or cellValue values are null or out of scope or out of order. SDO_GEOR.setColorMapTable raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the tableName parameter is an empty string(''). SDO_GEOR.setDefaultBlue raises error ORA-13418 if you are trying to set or remove the number of the layer to be used for the blue color component alone, or if defaultBlue is not a valid layer number for the GeoRaster object. SDO_GEOR.setDefaultColorLayer raises error ORA-13418 if the defaultRGB parameter is of the wrong size or not all the elements in it are either null or valid layer numbers for the GeoRaster object. All elements in the defaultRGB array must be either null or non-null; you cannot mix null and non-null array elements because the three layer numbers must be set or removed at the same time. SDO_GEOR.setDefaultGreen raises error ORA-13418 if you are trying to set or remove the number of the layer to be used for the green color component alone, or if defaultGreen is not a valid layer number for the GeoRaster object. SDO_GEOR.setDefaultRed raises error ORA-13418 if you are trying to set or remove the number of the layer to be used for the red color component alone, or if defaultRed is not a valid layer number for the GeoRaster object. SDO_GEOR.setGrayScale raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or gray values are null or out of scope, or there are duplicates in the cellValue array, or cellValue values are null or out of scope or out of order. SDO_GEOR.setGrayScaleTable raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the tableName parameter is an empty string(''). SDO_GEOR.setHistogramTable raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the tableName parameter is an empty string(''). SDO_GEOR.setLayerID raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the id parameter is null while the corresponding layer information exists. SDO_GEOR.setLayerOrdinate raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the ordinate parameter is null or does not equal to layerNumber-1 when the layerNumber does not specify the object layer. For SDO_GEOR.setModelSRID, if there is no spatial reference information in the metadata, the srid parameter must be null; if there is spatial reference information in the metadata, the srid parameter must not be null. Otherwise, error ORA-13418 is raised. For SDO_GEOR.setOrthoRectified, if there is no spatial reference information in the metadata, the isOrthoRectified parameter must be null; if the isOrthoRectified parameter is not null, it must be 'true' or 'false' (case insensitive). Otherwise, error ORA-13418 is raised. SDO_GEOR.setRasterType raises error ORA-13402 if the rasterType parameter is null, or error ORA-13418 if the first three digits of the rasterType are changed. SDO_GEOR.setRectified raises error ORA-13418 if the isRectified parameter is not null and is neither 'true' nor 'false' (case insensitive), or if the isRectified parameter is not null and there is no spatial reference information in the metadata. SDO_GEOR.setScaling raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object; or the scalingFunc parameter is of the wrong array size; or one of a0, a1, b0, and b1 is null; or both b0 and b1 are zero. SDO_GEOR.setSpatialReferenced raises error ORA-13418 if the isReferenced parameter is not null and is neither 'true' nor 'false' (case insensitive); if there is no spatial reference information in the metadata and the isReferenced parameter is not null; or if there is spatial reference information in the metadata and the isReferenced parameter is null. For SDO_GEOR.setSpatialResolutions, if the resolutions parameter is not null and there is no spatial reference information in the metadata, after this procedure spatial reference information is added in the metadata with minimum default values. For SDO_GEOR.setSpectralResolution, the resolution parameter must be null if there is no band reference information in the metadata. Otherwise, error ORA-13418 is raised. For SDO_GEOR.setSpectralUnit, the unit parameter must be null if there is no band reference information in the metadata; and the unit parameter must specify a valid unit value if there is band reference information in the metadata. Otherwise, error ORA-13418 is raised. For SDO_GEOR.setSRS, in the srs parameter object, isReferenced, isRectified, and isOrthoRectified must be 'true' or 'false' (case insensitive); spatialResolutions must be an array of the correct size; the spatial tolerance cannot be negative; modelCoordLocation must be 0 or 1; and the polynomial parameters cannot be null. SDO_GEOR.setStatistics raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the statistics parameter is of the wrong array size or has any null array elements. SDO_GEOR.setULTCoordinate raises error ORA-13418 if the ultCoordinate parameter is null or of the wrong array size or has any null array elements. SDO_GEOR.setVAT raises error ORA-13418 if the layerNumber parameter is null or invalid for the GeoRaster object, or the tableName parameter is an empty string(''). SDO_GEOR.setVersion raises error ORA-13418 if the majorVersion parameter or the minorVersion parameter is an empty string(''). Relationships between GeoRaster Tables and Raster Data Tables -------------------------------------------------------------- Although there are currently no restrictions on how you map raster data tables to GeoRaster tables, you should maintain a one-to-many relationship between a GeoRaster table and its associated raster data tables. That is, you should let a raster data table only contains cell data of GeoRaster objects that belong to the same GeoRaster table. Manually Maintaining GeoRaster System Data ------------------------------------------- If you use the ALTER TABLE statement to rename a GeoRaster table or a GeoRaster column, you must manually maintain the GeoRaster system data to reflect the change. For example, use an UPDATE statement of the following general form: UPDATE USER_SDO_GEOR_SYSDATA SET TABLE_NAME=UPPER(new_table_table), COLUMN_NAME=UPPER(new_column_name) WHERE TABLE_NAME=UPPER(old_table_name) AND COLUMN_NAME=UPPER(old_column_name); You must also drop and re-create the required GeoRaster DML trigger defined on the GeoRaster table/column pair. If you use the FLASHBACK TABLE statement to restore an earlier state of a GeoRaster table, the GeoRaster system data has to be manually restored. Also, you should drop and re-create any required GeoRaster DML triggers defined on the table after a FLASHBACK TABLE TO BEFORE DROP statement since the original trigger names cannot be restored. If you insert into or update the USER_SDO_GEOR_SYSDATA view, you must ensure that the table name, column name and raster data table name are stored in uppercase. For example, the INSERT statement near the end of Section 3.14 in the Oracle Spatial GeoRaster manual should include the use of the UPPER function, as follows: INSERT INTO USER_SDO_GEOR_SYSDATA VALUES (UPPER('georaster_table'), UPPER('georaster_column'), null, UPPER('rdt_name'), dangling_raster_id, null); The UPPER functions in that example are not necessary (that is, the example in the manual is acceptable) if you use all uppercase characters for the three strings; however, you must ensure that the names are stored in the USER_SDO_GEOR_SYSDATA view in uppercase. ===== Addendum to the Spatial Topology and Network Data Models user guide ===== Cross Schema Usage notes for Topology Data model 1. Only the owner of a topology can add layers to the topology. So if user A is the owner of a topology T and user B owns the tg_layer table L1, user A should issue the call to add the tg_layer to topology as: add_topo_geometry_layer('T', 'B.L1', ... ) Similar call is required when deleting this layer from the topology. 2. User A should grant select privillege on the _NODE$, _EDGE$, _FACE$ tables to B. 3. User B should grant select, index privilleges on L1 to A. ====== New Oriented point support ============================ Oracle introduces a new element type for the orientation vector. The new element type will be an additional entry in the SDO_ELEM_INFO_ARRAY. (ordinate_offset, 1, 0), where the interpretation of 0 for element type 1 will mean the element starting at the ordinate_offset, is the orientation vector. An orientation vector element is always associated with its preceding point in the sdo_ordinates array. The Oracle validation routines will catch orientation elements that do not have associated point elements. For a point with: 2 ordinates, the vector will include (i,j) SDO_GTYPE 2001 or 2005 elem_info_array(1,1,1, 3,1,0) sdo_ordinate_array (x,y,i,j) 3 ordinates (where one is a measure), the vector will include (i,j) SDO_GTYPE 3301 elem_info_array(1,1,1, 4,1,0) sdo_ordinate_array (x,y,m,i,j) 3 ordinates and none are measures, the vector will include (i,j,k) SDO_GTYPE 3001 or 3005 elem_info_array(1,1,1, 4,1,0) sdo_ordinate_array (x,y,z,i,j,k) 4 ordinates and measure is in position 4, the vector will include (i,j,k) SDO_GTYPE 4401 elem_info_array(1,1,1, 5,1,0) sdo_ordinate_array (x,y,z,m,i,j,k) 4 ordinates and measure is in position 3, the vector will include (i,j,k) SDO_GTYPE 4301 elem_info_array(1,1,1, 5,1,0) sdo_ordinate_array (x,y,m,z,i,j,k) 4 ordinates and none are measures, the vector will include (i,j,k) SDO_GTYPE 4001 or 4005 elem_info_array(1,1,1, 5,1,0) sdo_ordinate_array (x,y,z,v,i,j,k) where v is an arbitrary value. ---------------------------------------------------------------------------- Copyright 2004, Oracle. All rights reserved.