I have a Postgis table that has quite a few records.
I am trying to select a single row from the table, using a Filter in an
SLD.
I notice, however, that the filter is not included in the constructed SQL
statement when making a GetMap request:
org.geotools.data.jdbc.JDBC1DataStore - sql is SELECT "gid", "tiff_name",
AsText(force_2d("geom")) FROM "contours" WHERE "geom" &&
GeometryFromText('POLYGON ((-4578323 -2500332.999999999, -4578323 4611929,
3189008 4611929, 3189008 -2500332.999999999, -4578323
-2500332.999999999))', 104306) AND intersects("geom",
GeometryFromText('POLYGON ((-4578323 -2500332.999999999, -4578323 4611929,
3189008 4611929, 3189008 -2500332.999999999, -4578323
-2500332.999999999))', 104306))
333145 [FINE] org.geotools.data.jdbc.JDBC1DataStore - About to execute
query: SELECT "gid", "tiff_name", AsText(force_2d("geom")) FROM "contours"
WHERE "geom" && GeometryFromText('POLYGON ((-4578323 -2500332.999999999,
-4578323 4611929, 3189008 4611929, 3189008 -2500332.999999999, -4578323
-2500332.999999999))', 104306) AND intersects("geom",
GeometryFromText('POLYGON ((-4578323 -2500332.999999999, -4578323 4611929,
3189008 4611929, 3189008 -2500332.999999999, -4578323
-2500332.999999999))', 104306))
333145 [FINE] org.geotools.data.jdbc.ConnectionPool - Getting available
connection.
Eventually, I get an exception:
org.vfny.geoserver.wms.WmsException
at
org.vfny.geoserver.wms.WmsExceptionHandler.newServiceException(WmsExceptionHandler.java:70)
at
org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:776)
at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:469)
at org.vfny.geoserver.wms.servlets.GetMap.doPost(GetMap.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
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.doPost(WmsDispatcher.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
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.dispatch(WebApplicationHandler.java:294)
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: java.lang.OutOfMemoryError
On the other hand, flitering data through WFS works (note the WHERE
clause):
SQL: SELECT AsText(force_2d(Envelope(Extent("geom")))) FROM "contours"
WHERE "tiff_name" = 'O3_00_00'
50805 [FINE] org.geotools.data.jdbc.ConnectionPool$ConnectionListManager -
Connection closed - adding to available connections.
50812 [FINE] org.geotools.data.jdbc.JDBC1DataStore - calling sql builder
with filter [ tiff_name = O3_00_00 ]
50812 [FINE] org.geotools.data.jdbc.JDBC1DataStore - sql is SELECT "gid",
AsText(force_2d("geom")), "tiff_name" FROM "contours" WHERE "tiff_name" =
'O3_00_00'
50812 [FINE] org.geotools.data.jdbc.JDBC1DataStore - About to execute
query: SELECT "gid", AsText(force_2d("geom")), "tiff_name" FROM "contours"
WHERE "tiff_name" = 'O3_00_00'
1. How can I get the WFS GetFeature (correct) behaviour while making a WMS
GetMap request?
2. Is the Filtering being done on the Geoserver' side, after all data has
been downloaded from Postgis?
TIA,
Alex Petkov