Details
Description
I get this error when I request for a SVG map using Oracle:
15549 [SEVERE] org.geotools.data.jdbc.JDBC1DataStore - Error Performing SQL query: SELECT "ID1", "TEXTMUNI", "TEXCOMAR", "CAT_MUNI", "COD_INE", "COMAR_INE", "ENCLAVE_N", "GEOMETRY", "X_UTM30", "Y_UTM30", "X_UTM29", "Y_UTM29" FROM "MUNICIPIOS" WHERE SDO_RELATE(MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(600495.96,4187947.48,901017.12,4187947.48,901017.12,4505000.26,600495.96,4505000.26,600495.96,4187947.48)),"GEOMETRY",'mask=anyinteract querytype=WINDOW') = 'TRUE'
Executing that query on the database the error says that i need an spatial filter.
In Oracle documentation says that SDO_RELATE needs spatial filter for the first parameter. In that sentence the fist parameter is a temporaly geometry that doesn't have spatial index, but the second parameter have a spatial index. If I execute the query using both parameters but in reverse order:
SELECT "ID1", "TEXTMUNI", "TEXCOMAR", "CAT_MUNI", "COD_INE", "COMAR_INE", "ENCLAVE_N", "GEOMETRY", "X_UTM30", "Y_UTM30", "X_UTM29", "Y_UTM29" FROM "MUNICIPIOS" WHERE SDO_RELATE("GEOMETRY", MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(600495.96,4187947.48,901017.12,4187947.48,901017.12,4505000.26,600495.96,4505000.26,600495.96,4187947.48)),'mask=anyinteract querytype=WINDOW') = 'TRUE'
the sql returns data correctly.
If i request for JPEG or PNG map using the same database no errors are returned
-
Hide
- fiiles.zip
- 27/Jul/06 4:36 AM
- 161 kB
- Jose Luis Fernandez
-
- map.bmp 707 kB
- map.svg 188 kB
- prueba3.sld 10 kB
-
Hide
- gt2-oracle-spatial.jar
- 24/Jul/06 11:04 AM
- 76 kB
- Chris Holmes
-
- META-INF/MANIFEST.MF 0.3 kB
- log.txt 19 kB
- META-INF/.../org.geotools.data.DataStoreFactorySpi 0.1 kB
- org/geotools/data/log.txt 17 kB
- org/geotools/.../SDOAttributeIO.class 4 kB
- org/geotools/.../oracle/FIDSequence.class 2 kB
- org/geotools/data/oracle/log.txt 17 kB
- org/.../OracleConnectionFactory.class 3 kB
- org/geotools/.../OracleDataStore.class 11 kB
- org/.../OracleDataStoreFactory$1.class 2 kB
- org/.../OracleDataStoreFactory.class 6 kB
- org/geotools/.../OracleFeatureWriter.class 6 kB
- org/.../OracleOCIDataStoreFactory$1.class 2 kB
- org/.../OracleOCIDataStoreFactory.class 5 kB
- org/geotools/.../sdo/AttributeList.class 3 kB
- org/geotools/.../sdo/CoordinateAccess.class 0.8 kB
- org/.../CoordinateAccessFactory.class 0.4 kB
- org/geotools/data/.../sdo/Coordinates.class 8 kB
- org/geotools/data/oracle/sdo/ETYPE.class 0.5 kB
- org/geotools/.../sdo/GeometryConverter.class 9 kB
- org/geotools/data/.../sdo/OrdinateList.class 2 kB
- org/geotools/data/oracle/sdo/SDO.class 36 kB
- org/geotools/data/oracle/sdo/TT.class 0.4 kB
- org/geotools/.../SqlStatementEncoder.class 4 kB
- org/geotools/filter/diff.txt 18 kB
- org/geotools/filter/patch.txt 1 kB
- org/geotools/.../SQLEncoderOracle.class 14 kB
-
Hide
- gt2-oracle-spatial.jar
- 24/Jul/06 10:58 AM
- 76 kB
- Chris Holmes
-
- META-INF/MANIFEST.MF 0.3 kB
- log.txt 19 kB
- META-INF/.../org.geotools.data.DataStoreFactorySpi 0.1 kB
- org/geotools/data/log.txt 17 kB
- org/geotools/.../SDOAttributeIO.class 4 kB
- org/geotools/.../oracle/FIDSequence.class 2 kB
- org/geotools/data/oracle/log.txt 17 kB
- org/.../OracleConnectionFactory.class 3 kB
- org/geotools/.../OracleDataStore.class 11 kB
- org/.../OracleDataStoreFactory$1.class 2 kB
- org/.../OracleDataStoreFactory.class 6 kB
- org/geotools/.../OracleFeatureWriter.class 6 kB
- org/.../OracleOCIDataStoreFactory$1.class 2 kB
- org/.../OracleOCIDataStoreFactory.class 5 kB
- org/geotools/.../sdo/AttributeList.class 3 kB
- org/geotools/.../sdo/CoordinateAccess.class 0.8 kB
- org/.../CoordinateAccessFactory.class 0.4 kB
- org/geotools/data/.../sdo/Coordinates.class 8 kB
- org/geotools/data/oracle/sdo/ETYPE.class 0.5 kB
- org/geotools/.../sdo/GeometryConverter.class 9 kB
- org/geotools/data/.../sdo/OrdinateList.class 2 kB
- org/geotools/data/oracle/sdo/SDO.class 36 kB
- org/geotools/data/oracle/sdo/TT.class 0.4 kB
- org/geotools/.../SqlStatementEncoder.class 4 kB
- org/geotools/filter/diff.txt 18 kB
- org/geotools/filter/patch.txt 1 kB
- org/geotools/.../SQLEncoderOracle.class 14 kB
-
- sql-encoder-oracle.patch
- 14/Nov/06 9:23 AM
- 3 kB
- Chris Holmes
-
- .PNG map.jpg
- 52 kB
- 27/Jul/06 4:32 AM
-
- .SVG map.jpg
- 37 kB
- 27/Jul/06 4:35 AM
Issue Links
- is related to
-
GEOT-1020
Geometry filter is encoded properly only if the attribute expression is on the left side
-
Activity
Sorry, but I usually work with Geoserver1.3.0-RC6 and I have installed the 1.3-PR1 and the error doesn´t seem to be fixed.
When i request to Oracle Connections for SVG maps i always get the same result:
"Error Performing SQL query: SELECT....
...
Caused by: java.sql.SQLException: ORA-13226: interface not supported without a spatial index
"
I repeat that this only happends when a request for SVG maps with Oracle Connections. PNG, GIF and JPEG maps works fine.
The sql sentence it tries to execute and cause the error is:
SELECT "ID", "GEOMETRY", "IDNODO", "JERARQUIA", "CODNODO", "DESCRIPCION", "PADRE"
FROM "GEOZONA"
WHERE SDO_RELATE(
MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(616860.7,4202460.0,885365.3,4202460.0,885365.3,4485499.0,616860.7,4485499.0,616860.7,4202460.0)),
"GEOMETRY",
'mask=anyinteract querytype=WINDOW'
) = 'TRUE'
I think this sentence it's wrong. In the function "SDO_RELATE" there are three parameters. The first one must have and spatial index, but in this sentence fist parameter can't have it because it's a temporaly geometry. But "GEOMETRY", the second parameter, have an spatial index.
If i put "GEOMETRY" as first parameter, and "MDSYS.SDO_GEOMETRY(...)" as second one, the sql sentence works fine. This is the reason I think there is an error in the construction of the sql sentence: in the "SDO_RELATE" the first parameter must be "GEOMETRY", and the second one must be "MDSYS.SDO_GEOMETRY(2003,....)"
Interesting. Apologies, I thought that the fix would do it, and didn't fully read the sql error.
Can you confirm that this works fine when returning png or jpeg? And if so attach the sql being performed for those? I want to try to figure out why the sql for the svg is different than for the jpeg/png, since I can't think of why it would be... Perhaps it's using a disjoint instead of a bbox or something.
I'm calling geoserver using the expresion
When I change the expresion "Format=image/svg+xml" and use "Format=image/png", "Format=image/gif" or "Format=image/jpeg" geoserver returns the map (i'm sorry, no sql is showed in console when map is returned)
I'm going to attach a screenshot with the error generated in console by geoserver:
70483065 [INFO] org.vfny.geoserver.servlets.AbstractService - Looking for configured service responses' strategy
70483080 [INFO] org.vfny.geoserver.servlets.AbstractService - Looking for configured service strategy PARTIAL-BUFFER
70483080 [INFO] org.vfny.geoserver.servlets.AbstractService - Using service strategy class org.vfny.geoserver.servlets.PartialBufferStrategy
70483080 [INFO] org.vfny.geoserver.servlets.AbstractService - Set buffer size to 50
70483111 [INFO] org.vfny.geoserver.servlets.AbstractService - handling request: org.vfny.geoserver.wms.requests.GetMapRequest@88468c22
70483174 [SEVERE] org.geotools.data.jdbc.JDBC1DataStore - Error Performing SQL query: SELECT "ID", "GEOMETRY", "IDNODO", "JERARQUIA", "CODNODO", "DESCRIPCION", "PADRE" FROM "GEOZONA" WHERE SDO_RELATE(MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(616860.7,4202460.0,885365.3,4202460.0,885365.3,4485499.0,616860.7,4485499.0,616860.7,4202460.0)),"GEOMETRY",'mask=anyinteract querytype=WINDOW') = 'TRUE'
70483174 [INFO] org.vfny.geoserver.wms.responses.map.SVGMapProducer - aborting SVG encoder
70483174 [INFO] org.vfny.geoserver.servlets.PartialBufferStrategy - OutputStream was successfully aborted.
70483174 [INFO] org.vfny.geoserver.servlets.AbstractService - Had an undefined error: Error Performing SQL query: SELECT "ID", "GEOMETRY", "IDNODO", "JERARQUIA", "CODNODO", "DESCRIPCION", "PADRE" FROM "GEOZONA" WHERE SDO_RELATE(MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(616860.7,4202460.0,885365.3,4202460.0,885365.3,4485499.0,616860.7,4485499.0,616860.7,4202460.0)),"GEOMETRY",'mask=anyinteract querytype=WINDOW') = 'TRUE'
org.vfny.geoserver.wms.WmsException: Error Performing SQL query: SELECT "ID", "GEOMETRY", "IDNODO", "JERARQUIA", "CODNODO", "DESCRIPCION", "PADRE" FROM "GEOZONA" WHERE SDO_RELATE(MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(616860.7,4202460.0,885365.3,4202460.0,885365.3,4485499.0,616860.7,4485499.0,616860.7,4202460.0)),"GEOMETRY",'mask=anyinteract querytype=WINDOW') = 'TRUE'
at org.vfny.geoserver.wms.WmsExceptionHandler.newServiceException(WmsExceptionHandler.java:64)
at org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:749)
at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:521)
at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:276)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.vfny.geoserver.wms.servlets.WmsDispatcher.doResponse(WmsDispatcher.java:156)
at org.vfny.geoserver.wms.servlets.WmsDispatcher.doGet(WmsDispatcher.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342)
at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)
at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334)
at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1807)
at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1757)
at org.mortbay.http.HttpServer.service(HttpServer.java:879)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:961)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:276)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:511)
Caused by: org.geotools.data.DataSourceException: Error Performing SQL query: SELECT "ID", "GEOMETRY", "IDNODO", "JERARQUIA", "CODNODO", "DESCRIPCION", "PADRE" FROM "GEOZONA" WHERE SDO_RELATE(MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(616860.7,4202460.0,885365.3,4202460.0,885365.3,4485499.0,616860.7,4485499.0,616860.7,4202460.0)),"GEOMETRY",'mask=anyinteract querytype=WINDOW') = 'TRUE'
at org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:936)
at org.geotools.data.jdbc.JDBC1DataStore.getFeatureReader(JDBC1DataStore.java:684)
at org.geotools.data.jdbc.JDBCFeatureSource$1.reader(JDBCFeatureSource.java:206)
at org.vfny.geoserver.wms.responses.map.svg.EncodeSVG.writeLayers(EncodeSVG.java:206)
at org.vfny.geoserver.wms.responses.map.svg.EncodeSVG.encode(EncodeSVG.java:91)
at org.vfny.geoserver.wms.responses.map.SVGMapProducer.writeTo(SVGMapProducer.java:98)
at org.vfny.geoserver.wms.responses.GetMapResponse.writeTo(GetMapResponse.java:224)
at org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:510)
... 23 more
Caused by: java.sql.SQLException: ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 62
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1253)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2532)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2850)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:643)
at org.geotools.data.jdbc.JDBC1DataStore.executeQuery(JDBC1DataStore.java:925)
... 30 more
Ok, try the attached file, I think it should work. At least, it's a port from SDE which works right, I don't have an oracle instance to test it on.
Your .jar file works, but I think still there is something wrong. I don't know if is a bug in oracle case or if it is normal in all cases.
When I get a PNG, GIF or JPG map each entity have his own style (defined in the .SLD file pased). However, if I use the same string to request a .SVG map all entities uses the same style (not defined in the .sld file pased). You can see screenshots attached.
I use the same string to call Geoserver in both cases (the only difference is the value of the parameter "Format"):
In the .SVG generated file all <g> nodes use "Default Styler" class (not defined in the .SLD file)
The attached file contains .SVGgenerated, .PNG generated and .SLD used.
żIs this a normal operation?
Thanks in advance
Using:
- Format="image/png"
- Format="image/gif"
- Format="image/jpg"
Fixed on both 1.4.x (r 5544) and trunk (r5545) by swapping the geometry filter arguments... a proper fix should be made in the oracle datastore too
Fixed on the geoserver side with a workaround. A better fix is still needed in geotools.
This issue has been resolved for one month or more without complaints. Closing it.
This was fixed in RC5 or so, with Justin's improvements to the SVG outputter. If the problem remains reopen this issue.