[Geoserver-users] WMS SLD problem - follow up

Doug,

1. "TRANSPARENT=TRUE" are you using gif, png, or jpeg? Someone else
was reporting GIF problems. Try it with image/png.

2. "My SLD filter rules don't have any effect on the output."

   Your SLD is invalid - you have no "top level" tag in your filter.
   Add a <ogc:Or> just after <ogc:Filter> and a </ogc:Or> just before
</ogc:Filter>.

   There is SLD validation (when you upload a SLD to geoserver, or you
use SLD POST). Unfortunately, I made a typo just before submitting
beta4.
   To fix this (a) go to capabilities/sld (b) make a copy of
"StyledLayerDescriptor.xsd" (c) rename the copy to
"StyledLayerDescriptor.xsd.xsd" (d) you should have 2 copies of the
file now - a ".xsd" and a ".xsd.xsd".

  When you make a request you should be able to add
"&validateSchema=true" to your request and it should validate the SLD.

3. STACKTRACE

   This might not be a problem. Could you please submit a bug report
for this to Geotool (category main/renderer/lite). Call it "Error
reporting issue - log level".

   It occurs in
"org.geotools.renderer.lite.LiteRenderer2.fireErrorEvent(LiteRenderer2.java:309)".

   I've noticed this too, but it hasnt ever caused a real problem.

dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/

Thanks for the quick reply.

1. "TRANSPARENT=TRUE" are you using gif, png, or jpeg? Someone else
was reporting GIF problems. Try it with image/png.

Actually I am using FORMAT=image/png in the WMS URL:

http://localhost/geoserver-1.3-beta4/wms?REQUEST=GetMap&VERSION=1.1.1
&SERVICE=WMS&BBOX=-2713600,-2304000,2850000,2252800
&WIDTH=800&HEIGHT=600&FORMAT=image/png&TRANSPARENT=TRUE&SRS=EPSG:3031&SLD=http://localhost/mapservice-support/test-sld-body.xml

2. "My SLD filter rules don't have any effect on the output."

   Your SLD is invalid - you have no "top level" tag in your filter.
  Add a <ogc:Or> just after <ogc:Filter> and a </ogc:Or> just before
  </ogc:Filter>.

I realize the example I submitted may be hard to read due to comments. I
actually have the enclosing <ogc:Or> element as you've suggested.
Here's a copy of my SLD, sans comments:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd&quot;
  xmlns="http://www.opengis.net/sld&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
  <NamedLayer>
    <Name>usgsAnt:nxdal030</Name>
    <UserStyle>
      <Name>highlight-features</Name>
      <FeatureTypeStyle>
        <Rule>
          <ogc:Filter>
            <ogc:Or>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>pub_date</ogc:PropertyName>
                <ogc:Literal>1993</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>pub_date</ogc:PropertyName>
                <ogc:Literal>1975</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
          </ogc:Filter>
         <PolygonSymbolizer>
            <Geometry>
              <ogc:PropertyName>the_geom</ogc:PropertyName>
            </Geometry>
            <Fill>
              <CssParameter name="fill">#EEEEEE</CssParameter>
              <CssParameter name="fill-opacity">0.9</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#FF0000</CssParameter>
              <CssParameter name="stroke-opacity">1.0</CssParameter>
              <CssParameter name="stroke-width">1.0</CssParameter>
              <CssParameter name="stroke-linecap">butt</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Finally, thanks for the tip on SLD validation. That should help filter out
the cases of user error :slight_smile:

Doug

Are you using IE? If so it has issues displaying transparent PNGs.

There are workarounds, but unfortunately the workarounds do not like the inclusion of the # in the src URL. I have been trying to figure out a way around this issue, but have not come up with a solution. If there were a way to specify a color without the # sign, but I am not finding any...

At 03:26 PM 6/1/2005, Douglas J Tallman wrote:

Thanks for the quick reply.

>> 1. "TRANSPARENT=TRUE" are you using gif, png, or jpeg? Someone else
>> was reporting GIF problems. Try it with image/png.

Actually I am using FORMAT=image/png in the WMS URL:

http://localhost/geoserver-1.3-beta4/wms?REQUEST=GetMap&VERSION=1.1.1
&SERVICE=WMS&BBOX=-2713600,-2304000,2850000,2252800
&WIDTH=800&HEIGHT=600&FORMAT=image/png&TRANSPARENT=TRUE&SRS=EPSG:3031&SLD=http://localhost/mapservice-support/test-sld-body.xml

>> 2. "My SLD filter rules don't have any effect on the output."
>>
>> Your SLD is invalid - you have no "top level" tag in your filter.
>> Add a <ogc:Or> just after <ogc:Filter> and a </ogc:Or> just before
>> </ogc:Filter>.

I realize the example I submitted may be hard to read due to comments. I
actually have the enclosing <ogc:Or> element as you've suggested.
Here's a copy of my SLD, sans comments:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd&quot;
  xmlns="http://www.opengis.net/sld&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
  <NamedLayer>
    <Name>usgsAnt:nxdal030</Name>
    <UserStyle>
      <Name>highlight-features</Name>
      <FeatureTypeStyle>
        <Rule>
          <ogc:Filter>
            <ogc:Or>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>pub_date</ogc:PropertyName>
                <ogc:Literal>1993</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>pub_date</ogc:PropertyName>
                <ogc:Literal>1975</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
          </ogc:Filter>
         <PolygonSymbolizer>
            <Geometry>
              <ogc:PropertyName>the_geom</ogc:PropertyName>
            </Geometry>
            <Fill>
              <CssParameter name="fill">#EEEEEE</CssParameter>
              <CssParameter name="fill-opacity">0.9</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#FF0000</CssParameter>
              <CssParameter name="stroke-opacity">1.0</CssParameter>
              <CssParameter name="stroke-width">1.0</CssParameter>
              <CssParameter name="stroke-linecap">butt</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Finally, thanks for the tip on SLD validation. That should help filter out
the cases of user error :slight_smile:

Doug

-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users