I agree with Martin, separate styles would be better and much more maintainable.
However, if you really need to have you tried filtering by geometry type on the
rule, e.g.
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>gtype</ogc:PropertyName>
<ogc:Literal>Point</ogc:Literal>
</ogc:PropertyIsEqualTo>
Or maybe basing the layers on views which make the layers look the same at an
attribute level (i.e. add columns with null/default values for missing
attributes).
From: Martin Davis [mailto:[email protected]]
Sent: 25 February 2016 01:18
To: Geoffrey Balme
Cc: [email protected]
Subject: Re: [Geoserver-users] SLD problem with attribute filtering
Just a guess, but this is probably caused by a pre-scan that GeoServer does to
validate that all the attributes referred to in the SLD are available in the
underlying layer. (One reason for this I think is that GeoServer only requests
the attributes needed to compute the SLD filters).
I'm not sure this can be called a bug, it's more of a design limitation. And
as such you may have to adjust your requirements to match the tool you are
using...
On Wed, Feb 24, 2016 at 5:10 PM, Geoffrey Balme
<[email protected]<mailto:[email protected]>> wrote:
I need to have everything in 1 SLD., it's a part of the requirements of the
work I have to do.
Isn't this behavior a bug of geoserver ? It shouldn't behave this way when you
don't have the exact same attribute for your point and your polygon.
2016-02-25 2:06 GMT+01:00 Martin Davis
<[email protected]<mailto:[email protected]>>:
Why not create two different SLDs?
On Wed, Feb 24, 2016 at 3:41 PM, Geoffrey
<[email protected]<mailto:[email protected]>> wrote:
Hello,
I have a SLD file styling 2 different shapefiles, one containing point and
the other containing polygons. The polygons have an attribute that the point
doesn't.
The problem is, that when I filter the Polygon in SLD on their attribute,
the point can't render because it doesn't have this attribute. Even if it
not under the same rule.
I hope I'm explaining well enough.
Please see the SLD and shapefiles attached as example.
Assign the SLD file to style the shapefiles, and see that the Area shapefile
is rendered correctly, but the Point shapefile can't render. If you remove
the filter for the attribute in the Polygon rule, then the point can render.
Thank you
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users