Spatial filter missing from SQL when a rendering transform style is used

Description

Here's a SQL View PostGIS layer I'm calling "test":

select * FROM (VALUES (ST_SetSRID(ST_MakePoint(0,0),4326), 20)) AS v(location, temperature)

Here's the query I use to render it:

http://127.0.0.1:8080/geoserver/wms?LAYERS=test&TRANSPARENT=true&FORMAT=image%2Fpng8&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A4326&BBOX=-2.6042569438678,30.62910527817,4.4915727783775,37.724935000415&WIDTH=256&HEIGHT=256

When I set the built-in "point" style to be the default, the following SQL is in the log as I expect:

SELECT encode(ST_AsBinary(CASE WHEN ST_HasArc("location") THEN "location" ELSE ST_Simplify(ST_Force2D("location"), 0.02217446788201656) END),'base64') as "location" FROM (select * FROM (VALUES (ST_SetSRID(ST_MakePoint(0,0),4326), 20)) AS v(location, temperature)
) as "vtable" WHERE "location" && ST_GeomFromText('POLYGON ((-2.7151292832778826 30.518232938759922, -2.7151292832778826 37.83580733982508, 4.602445117787583 37.83580733982508, 4.602445117787583 30.518232938759922, -2.7151292832778826 30.518232938759922))', 4326)

When I use my Rendering Transformation style (attached), I get the following SQL in the log (without a spatial filter):

SELECT encode(ST_AsEWKB("location"),'base64') as "location","temperature" FROM (select * FROM (VALUES (ST_SetSRID(ST_MakePoint(0,0),4326), 20)) AS v(location, temperature)
) as "vtable"

I didn't have this problem when I was using GeoServer 2.2.5 and the lack of spatial filter is slowing the transform hugely when I use a real-world SQL layer.

Environment

None

Activity

Show:
Simon Hartley
July 18, 2016, 3:23 PM

Is the dumb SQL above no good then? I have tested using that as well, so it does work.

Andrea Aime
July 18, 2016, 3:26 PM

Oh, I only glanced over it and did not realize it was part of a view definition. Good enough I guess!

Simon Hartley
November 15, 2016, 10:35 PM

This seems to work in 2.10.
I think it was probably fixed by GEOS-7735.

Andrea Aime
November 16, 2016, 9:09 AM

Thanks for letting us know

Andrea Aime
February 15, 2017, 11:48 AM

Mass closing all resolved issues not modified in the last 4 weeks

Fixed

Assignee

Unassigned

Reporter

Simon Hartley

Triage

None

Fix versions

Affects versions

Priority

Medium
Configure