Support or at least report for old geometry fields (ake old GTYPE)
------------------------------------------------------------------

         Key: GEOT-709
         URL: http://jira.codehaus.org/browse/GEOT-709
     Project: GeoTools
        Type: Improvement
  Components: oraclespatial  
    Versions: 2.2.M0    
 Reporter: Paolo Rizzi
 Assigned to: Sean Geoghegan 


Older Oracle version uses different GTYPE values from recent ones. 
If you happen to read an old table with the OracleDataStore you may get
a division by zero error because the GTYPE of a SDO geometry may be equal to,
for example, 3 instead of 2003.
So, when execution reaches line 2079 of 
   org.geotools.data.oracle.sdo.SDO.java
both D and L are equal to 0 so LEN is equal to 0,
so ordinates.length % LEN gives a division by zero error.
An improvement would be to support this old coding or, since very few people
will encounter this problem, at least report it correctly.
Relevant docs from Oracle says this:
> ---------------------------------------------------------------------------
> Note:
> The 1-digit SDO_GTYPE values from before release 8.1.6 value are still
> supported. If a 1-digit value is used, however, Oracle Spatial determines
> the number of dimensions from the DIMINFO column of the metadata views,
> described in Section 2.6.3. 
> Also, if 1-digit SDO_GTYPE values are converted to 4-digit values, any
> SDO_ETYPE values that end in 3 or 5 in the SDO_ELEM_INFO array (described in
> Section 2.2.4) must also be converted.
> ---------------------------------------------------------------------------
>
> and:
>
> ---------------------------------------------------------------------------
> Note:
> The use of 3 as an SDO_ETYPE value for polygon ring elements in a single
> geometry is discouraged. You should specify 3 only if you do not know if the
> simple polygon is exterior or interior, and you should then upgrade the
> table or layer to the current format using the SDO_MIGRATE.TO_CURRENT
> <sdo_objmigr.htm> procedure, described in Chapter 17 <sdo_objmigr.htm>. 
> You cannot mix 1-digit and 4-digit SDO_ETYPE values in a single geometry. If
> you use 4-digit SDO_ETYPE values, you must use 4-digit SDO_GTYPE values.
> ---------------------------------------------------------------------------
Converting a table created with an old version (with "strange" GTYPEs)
is just a matter of using the 
        SDO_MIGRATE.TO_CURRENT('table_name')
function.
A good little article about Oracle SDO can be found here:
   http://www.oreillynet.com/pub/a/network/2003/11/10/oracle_spatial.html?page=1



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to