TableScan prevention - Use the Metadata
---------------------------------------
Key: GEOT-704
URL: http://jira.codehaus.org/browse/GEOT-704
Project: GeoTools
Type: Bug
Components: oraclespatial
Versions: 2.2.M1, 2.1.1
Reporter: Jody Garnett
Assigned to: Sean Geoghegan
Priority: Blocker
I am listing this as a blocker, as I would like to include Oracle Support on
the stable branch of uDig and this issue is prevent us from doing so.
I have added to the API of JDBCDataStore to include something along the lines
of Envelope getBounds( typeName )
The code right now makes use of "X" and "Y" - as that was the only example I
had.
Simone Greener has been kind enough to provide a more complete list ...
We need to make a HashSet out of the Horzonal values
- 'x','X','e','X','east','X','easting','X','lon','X','long','X','longitude','X'
And again for the virtical values:
- 'y','Y','n','Y','north','Y','northing','Y','lat','Y','latitude','Y'
If that won't be 100%, as we should consider the CRS and check which of the
available ordinates match (or something to that effect).
Jody
Simone's example:
Dim sDimXDecodeSet As String
sDimYDecodeSet =
"'x','X','e','X','east','X','easting','X','lon','X','long','X','longitude','X'"
Dim sDimYDecodeSet As String
sDimYDecodeSet =
"'y','Y','n','Y','north','Y','northing','Y','lat','Y','latitude','Y'"
Dim sDimNameSet As String
sDimNameSet =
"'x','e','east','easting','lon','long','longitude','y','Y','north','northing','lat','latitude'"
sSQL = sprintf("SELECT DECODE(LOWER(SDO_DIMNAME),%s,%s,'UNKNOWN') AS
SDO_DIMNAME,",sDimXDecodeSet,sDimYDecodeSet)
sSQL = sSQL & "SDO_LB,SDO_UB FROM TABLE "
sSQL = sSQL & "(SELECT U.SDO_DIMINFO FROM MDSYS.SDO_GEOM_METADATA_TABLE u "
sSQL = sSQL & "WHERE UPPER(SDO_OWNER)='" & sSchema & "' AND "
sSQL = sSQL & "UPPER(SDO_TABLE_NAME)= '" & sObjectName & "' AND "
sSQL = sSQL & "UPPER(SDO_COLUMN_NAME)='" & sGeomColumnName & "') "
sSQL = sSQL & "WHERE LOWER(SDO_DIMNAME) IN (" & sDimNameSet & ")"
For the SRID the following SQL is used:
SELECT DECODE(U.SDO_SRID,NULL,-1,0,-1,U.SDO_SRID) AS SDO_SRID
FROM MDSYS.SDO_GEOM_METADATA_TABLE u
WHERE UPPER(SDO_OWNER)=UPPER(&sSchema)
AND UPPER(SDO_TABLE_NAME)=UPPER(&sObjectName)
AND UPPER(SDO_COLUMN_NAME)=UPPER(&sGeomColumnName)
--
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