I've created a function within Oracle for on-the-fly clustering that I hoped to query via GeoServer using an SQL view layer.
The function takes as its arguments the bounding box and the number of grid cells to use in a basic gridded clustering process (i.e. find the centre of mass for points within each grid cell). Please note I've tried the Point Stacker extension and it isn't adequate for my needs. Executing the following query within Oracle gives the list of sdo_geometry objects that I expect: select * from table(package_name.function_name(-180, -90, 180, 90, 3); My intention is to make WMS requests to GeoServer with the viewparams parameter included that provides all required arguments. Because of the way the function works the returned sdo_geometry objects will only ever be within the provided bounding box. I can successfully create an SQL view layer within GeoServer using this syntax and everything seems OK while publishing. However when I access the layer everything falls apart. GeoServer takes my query and wraps it as follows: SELECT GEOMETRY as GEOMETRY FROM (select * from table(package_name.function_name(-180, -90, 180, 90, 3))) VTABLE WHERE SDO_FILTER(GEOMETRY, ?, 'mask=anyinteract querytype=WINDOW') = 'TRUE' Oracle then errors because the function's table return type doesn't have a spatial index to use with SDO_FILTER. Although I did find a somewhat similar problem on GIS.SE <http://gis.stackexchange.com/questions/92554/can-i-create-an-oracle-spatial-view-from-a-non-spatial-table> the same solution does not apply as my function returns a table, not a single object, and Oracle doesn't permit indexes on named table types. As things currently stand I don't think I can make this work, and the only thing that could potentially help is to prevent GeoServer from appending its SDO_FILTER mask. However I'm guessing this just isn't possible without digging into the source and creating a custom build (totally not an option). Can anyone tell me if there's something I've missed here, or suggest a different approach for solving the same problem? Any thoughts would be very much appreciated. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/GeoServer-s-spatial-filter-preventing-SQL-view-layer-from-working-tp5237269.html Sent from the GeoServer - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
