Backslash \ in PropertyIsEqualTo literal in SLD

Description

Geoserver doesn't render my features when I use a filter like this in my SLD (see whole document below):
<ogc:Filter>
<PropertyIsEqualTo xmlns="http://www.opengis.net/ogc">
<PropertyName>USER_</PropertyName>
<Literal>TEST\allu</Literal>
</PropertyIsEqualTo>
</ogc:Filter>

The SQL generated by Geoserver returns features after I have turned on PostgreSQLs standard_compliant_strings property and tried them manually in pgAdmin. But Geoserver refuses to render them!?

The output in the log file is found below.

The SQL I'm getting works fine when I run it in pgAdmin manually. I get a resultset of 3 rows. Seems like something goes wrong afterwards that makes Geoserver unwilling to render them on the image.

Does Geoserver make another match against the literal later on in the process?

> It seems like the filter never matches anything even though I see rows
> in the PostGIS having the field USER_ set to TEST\allu. I can see in
> the geoserver log that the SQL is built correctly and returns features
> when I try it in PostGIS manually, but in a WMS request it never
> results in any points on the map.
>
> If I remove the filter or change the PropertyName and Literal to a
> field and value without backslash it works!
>
> The SLD document is validating and looks like this:
>
> <StyledLayerDescriptor xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns="http://www.opengis.net/sld"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> version="1.0.0"
> xsi:schemaLocation="http://www.opengis.net/sld
> http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd - http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
> <NamedLayer>
> <Name>sydbs:TEST_PT</Name>
> <UserStyle>
> <FeatureTypeStyle>
> <Rule>
> <ogc:Filter>
> <PropertyIsEqualTo xmlns="http://www.opengis.net/ogc">
> <PropertyName>USER_</PropertyName>
> <Literal>TEST\allu</Literal>
> </PropertyIsEqualTo>
> </ogc:Filter>
> <PointSymbolizer>
> <Graphic>
> <Mark>
> <WellKnownName>circle</WellKnownName>
> <Fill>
> <CssParameter
> name="fill">#FF0000</CssParameter>
> </Fill>
> <Stroke>
> <CssParameter
> name="stroke">#000000</CssParameter>
> </Stroke>
> </Mark>
> <Size>5</Size>
> </Graphic>
> </PointSymbolizer>
> </Rule>
> </FeatureTypeStyle>
> </UserStyle>
> </NamedLayer>
> </StyledLayerDescriptor>
>

The output from the log file is:

2008-05-28 15:33:12,325 DEBUG - processing 1 stylers for TEST_PT
2008-05-28 15:33:12,325 DEBUG - creating rules for scale denominator - 7 142,857
2008-05-28 15:33:12,325 DEBUG - Expanding rendering area by 5 pixels to consider stroke width
2008-05-28 15:33:12,325 DEBUG
2008-05-28 15:33:12,325 DEBUG AND [[ geom bbox POLYGON ((1440618 6302315, 1440618 6303335, 1441638 6303335, 1441638 6302315, 1440618 6302315)) ] AND [ USER_ = TEST\allu ]]]
2008-05-28 15:33:12,325 TRACE - ENTRY 2
2008-05-28 15:33:12,325 TRACE - ENTRY 2
2008-05-28 15:33:12,325 TRACE - ENTRY 12 345
2008-05-28 15:33:12,325 TRACE - ENTRY 12 345
2008-05-28 15:33:12,325 TRACE - ENTRY 2
2008-05-28 15:33:12,325 TRACE - ENTRY 4
2008-05-28 15:33:12,325 TRACE - ENTRY 14
2008-05-28 15:33:12,325 DEBUG - exporting LogicFilter
2008-05-28 15:33:12,325 DEBUG - exporting LogicFilter
2008-05-28 15:33:12,325 DEBUG - exporting LogicFilter
2008-05-28 15:33:12,325 DEBUG - exporting GeometryFilter
2008-05-28 15:33:12,325 DEBUG - exporting ExpressionAttribute
2008-05-28 15:33:12,325 DEBUG - exporting LiteralExpression
2008-05-28 15:33:12,325 DEBUG - exporting SQL ComparisonFilter
2008-05-28 15:33:12,325 DEBUG - Filter type id is 14
2008-05-28 15:33:12,325 DEBUG - Filter type text is =
2008-05-28 15:33:12,325 DEBUG - exporting ExpressionAttribute
2008-05-28 15:33:12,325 DEBUG - exporting LiteralExpression
2008-05-28 15:33:12,325 DEBUG - exporting LiteralExpression
2008-05-28 15:33:12,325 DEBUG - sql is SELECT "oid", "USER_", encode(asBinary(force_2d("geom"),'XDR'),'base64') FROM "business"."TEST_PT" WHERE ((TRUE AND TRUE) AND ("geom" && GeometryFromText('POLYGON ((1440618 6302315, 1440618 6303335, 1441638 6303335, 1441638 6302315, 1440618 6302315))', 2400) AND "USER_" = 'TEST\allu'))
2008-05-28 15:33:12,325 DEBUG - SELECT "oid", "USER_", encode(asBinary(force_2d("geom"),'XDR'),'base64') FROM "business"."TEST_PT" WHERE ((TRUE AND TRUE) AND ("geom" && GeometryFromText('POLYGON ((1440618 6302315, 1440618 6303335, 1441638 6303335, 1441638 6302315, 1440618 6302315))', 2400) AND "USER_" = 'TEST\allu'))
2008-05-28 15:33:12,325 DEBUG - About to execute query: SELECT "oid", "USER_", encode(asBinary(force_2d("geom"),'XDR'),'base64') FROM "business"."TEST_PT" WHERE ((TRUE AND TRUE) AND ("geom" && GeometryFromText('POLYGON ((1440618 6302315, 1440618 6303335, 1441638 6303335, 1441638 6302315, 1440618 6302315))', 2400) AND "USER_" = 'TEST\allu'))
2008-05-28 15:33:12,340 DEBUG

Environment

None

Activity

Show:
codehaus
April 10, 2015, 4:39 PM

CodeHaus Comment From: aaime - Time: Fri, 4 Dec 2009 10:48:53 -0600
---------------------
<p>Do you have a sample data set and the SLD we can use to reproduce this one? Is it still a problem with GS 2.0?</p>

Assignee

Unassigned

Reporter

codehaus

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure