CQL_FILTER with buffer and EWKT geometry

I’m trying to get a cql filter to work with WMS that has a buffer instruction on a geometry with the srid specified (EWKT), the dataset is in EPSG:3857, the map is in EPSG:28992, but I’m not sure if it is supposed to work/supported, or if I’m not using proper syntax.

The EWKT linestring (without buffer) that yields the expected response: CQL_FILTER=INTERSECTS(way, SRID=28992;LINESTRING(130908.99 459744.88,130723.93 459443.25))

https://snapshot.tailormap.nl/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=TRUE&LAYERS=postgis%3Aosm_polygon&LANGUAGE=en&CQL_FILTER=INTERSECTS(way%2C%20SRID%3D28992%3BLINESTRING(130908.99%20459744.88%2C130723.93%20459443.25))&WIDTH=2527&HEIGHT=2031&CRS=EPSG%3A28992&BBOX=128509.42607040312%2C456715.833918324%2C134134.29392959684%2C461236.506081676

Same EWKT linestring with a buffer of 10 that does not yield the expected response : CQL_FILTER=INTERSECTS(way, BUFFER(SRID=28992;LINESTRING(130908.99 459744.88,130723.93 459443.25), 10))

https://snapshot.tailormap.nl/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image%2Fpng&STYLES=&TRANSPARENT=TRUE&LAYERS=postgis%3Aosm_polygon&LANGUAGE=en&CQL_FILTER=INTERSECTS(way%2C%20BUFFER(SRID%3D28992%3BLINESTRING(130908.99%20459744.88%2C130723.93%20459443.25)%2C%2010))&WIDTH=2527&HEIGHT=2031&CRS=EPSG%3A28992&BBOX=128509.42607040312%2C456715.833918324%2C134134.29392959684%2C461236.506081676

I could rewrite the code to use DWITHIN, but that does not support negative (buffer) distances and this is supposed to work for polygons with “inside” buffer as well… client side buffering is not really an option, as users can choose to use a buffer on features of a layer as well (which uses a FID filter)

developer logging for these 2 requests

without buffer:

2026-07-27 10:02:17,666 INFO   [geoserver.wms] - 
Request: getMap
	Angle = 0.0
	BaseUrl = http://snapshot.tailormap.nl/geoserver/
	Bbox = SRSEnvelope[128509.42607040312 : 134134.29392959684, 456715.833918324 : 461236.506081676]
	BgColor = java.awt.Color[r=255,g=255,b=255]
	Buffer = 0
	Clip = null
	CQLFilter = [[ way intersects LINESTRING (130908.99 459744.88, 130723.93 459443.25) ]]
	Crs = PROJCS["Amersfoort / RD New", 
  GEOGCS["Amersfoort", 
    DATUM["Amersfoort", 
      SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]], 
      TOWGS84[565.2369, 50.0087, 465.658, -0.40685733032239757, -0.3507326765425626, 1.8703473836067956, 4.0812], 
      AUTHORITY["EPSG","6289"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic latitude", NORTH], 
    AXIS["Geodetic longitude", EAST], 
    AUTHORITY["EPSG","4289"]], 
  PROJECTION["Oblique_Stereographic", AUTHORITY["EPSG","9809"]], 
  PARAMETER["central_meridian", 5.387638888888891], 
  PARAMETER["latitude_of_origin", 52.15616055555556], 
  PARAMETER["scale_factor", 0.9999079], 
  PARAMETER["false_easting", 155000.0], 
  PARAMETER["false_northing", 463000.0], 
  UNIT["m", 1.0], 
  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
  AUTHORITY["EPSG","28992"]]
	Elevation = []
	Env = {}
	Exceptions = SE_XML
	FeatureId = null
	FeatureVersion = null
	Filter = [[ way intersects LINESTRING (130908.99 459744.88, 130723.93 459443.25) ]]
	Format = image/png
	FormatOptions = {}
	Get = true
	Height = 2031
	Interpolations = []
	Layers = [org.geoserver.wms.MapLayerInfo@185667ca[description=<null>,label=osm_polygon,layerFeatureConstraints=<null>,layerGroupMetadata={},layerInfo=LayerInfoImpl[osm_polygon, resource:FeatureTypeInfoImpl[osm_polygon]],name=postgis:osm_polygon,remoteFeatureSource=<null>,style=<null>,type=0]]
	MaxFeatures = null
	Palette = null
	RawKvp = {LANGUAGE=en, FORMAT=image/png, CRS=EPSG:28992, STYLES=, WIDTH=2527, HEIGHT=2031, LAYERS=postgis:osm_polygon, REQUEST=GetMap, BBOX=128509.42607040312,456715.833918324,134134.29392959684,461236.506081676, VERSION=1.3.0, SERVICE=WMS, TRANSPARENT=TRUE, CQL_FILTER=INTERSECTS(way, SRID=28992;LINESTRING(130908.99 459744.88,130723.93 459443.25))}
	RemoteOwsType = null
	RemoteOwsURL = null
	Request = GetMap
	RequestCharset = UTF-8
	ScaleMethod = null
	Sld = null
	SldBody = null
	SldVersion = null
	SortBy = null
	SortByArrays = null
	SRS = urn:ogc:def:crs:EPSG::28992
	StartIndex = null
	StyleBody = null
	StyleFormat = sld
	Styles = [StyleImpl[ name=generic]]
	StyleUrl = null
	StyleVersion = null
	Tiled = false
	TilesOrigin = null
	Time = []
	Transparent = true
	ValidateSchema = false
	Version = 1.3.0
	ViewParams = null
	Width = 2527

with buffer

2026-07-27 10:02:08,228 INFO   [geoserver.wms] - 
Request: getMap
	Angle = 0.0
	BaseUrl = http://snapshot.tailormap.nl/geoserver/
	Bbox = SRSEnvelope[128509.42607040312 : 134134.29392959684, 456715.833918324 : 461236.506081676]
	BgColor = java.awt.Color[r=255,g=255,b=255]
	Buffer = 0
	Clip = null
	CQLFilter = [[ way intersects buffer([LINESTRING (130908.99 459744.88, 130723.93 459443.25)], [10]) ]]
	Crs = PROJCS["Amersfoort / RD New", 
  GEOGCS["Amersfoort", 
    DATUM["Amersfoort", 
      SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]], 
      TOWGS84[565.2369, 50.0087, 465.658, -0.40685733032239757, -0.3507326765425626, 1.8703473836067956, 4.0812], 
      AUTHORITY["EPSG","6289"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic latitude", NORTH], 
    AXIS["Geodetic longitude", EAST], 
    AUTHORITY["EPSG","4289"]], 
  PROJECTION["Oblique_Stereographic", AUTHORITY["EPSG","9809"]], 
  PARAMETER["central_meridian", 5.387638888888891], 
  PARAMETER["latitude_of_origin", 52.15616055555556], 
  PARAMETER["scale_factor", 0.9999079], 
  PARAMETER["false_easting", 155000.0], 
  PARAMETER["false_northing", 463000.0], 
  UNIT["m", 1.0], 
  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
  AUTHORITY["EPSG","28992"]]
	Elevation = []
	Env = {}
	Exceptions = SE_XML
	FeatureId = null
	FeatureVersion = null
	Filter = [[ way intersects buffer([LINESTRING (130908.99 459744.88, 130723.93 459443.25)], [10]) ]]
	Format = image/png
	FormatOptions = {}
	Get = true
	Height = 2031
	Interpolations = []
	Layers = [org.geoserver.wms.MapLayerInfo@6fcfa38f[description=<null>,label=osm_polygon,layerFeatureConstraints=<null>,layerGroupMetadata={},layerInfo=LayerInfoImpl[osm_polygon, resource:FeatureTypeInfoImpl[osm_polygon]],name=postgis:osm_polygon,remoteFeatureSource=<null>,style=<null>,type=0]]
	MaxFeatures = null
	Palette = null
	RawKvp = {LANGUAGE=en, FORMAT=image/png, CRS=EPSG:28992, STYLES=, WIDTH=2527, HEIGHT=2031, LAYERS=postgis:osm_polygon, REQUEST=GetMap, BBOX=128509.42607040312,456715.833918324,134134.29392959684,461236.506081676, VERSION=1.3.0, SERVICE=WMS, TRANSPARENT=TRUE, CQL_FILTER=INTERSECTS(way, BUFFER(SRID=28992;LINESTRING(130908.99 459744.88,130723.93 459443.25), 10))}
	RemoteOwsType = null
	RemoteOwsURL = null
	Request = GetMap
	RequestCharset = UTF-8
	ScaleMethod = null
	Sld = null
	SldBody = null
	SldVersion = null
	SortBy = null
	SortByArrays = null
	SRS = urn:ogc:def:crs:EPSG::28992
	StartIndex = null
	StyleBody = null
	StyleFormat = sld
	Styles = [StyleImpl[ name=generic]]
	StyleUrl = null
	StyleVersion = null
	Tiled = false
	TilesOrigin = null
	Time = []
	Transparent = true
	ValidateSchema = false
	Version = 1.3.0
	ViewParams = null
	Width = 2527