WMS SLD problem - follow up

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

WMS SLD problem - follow up

Douglas J Tallman
Thanks for the comments and quick follow up on this problem. I've been busy
recently with a few other things so haven't been able to revisit the
problem until now.

It turns out I was leaving the featureType namespace out of the
NamedLayer/Name element of the SLD. I was using a layer name of "nxdal030"
and should have prepended this with a namespace, eg. "usgsAnt:nxdal030".
Once I did this and changed the "SLD_BODY" parameter (for inline GET SLDs)
to "SLD" (for an SLD on the network) I was able to get a feature-styled WMS
response.

However I ran into some issues that still prevent me from using the
Geoserver 1.3-beta4 WMS SLD functionality. My goal is to use the WMS SLD to
render a set of features from a query against a map index layer (a set of
vector footprints of existing map products). This image will be used as an
overlay layer on top of other background WMS images. I'm trying to migrate
this functionality from some code which does the same thing using an ESRI
SLD-enabled WMS connector.

The remaining problems I'm having with the Geoserver WMS-SLD:

(1)  I can't render the output image as transparent. This is important for
using the output image as an overlay.  I've tried passing
"TRANSPARENT=TRUE" into the WMS request and I've monkeyed around with the
PolygonSymbolizer CssParameters within the SLD, but I can't get the
background to render as transparent. I want to see only those polygons
which meet the SLD filter condition, leaving the rest of the map
transparent.

(2) My SLD filter rules don't have any effect on the output. I think this
is probably related to the "SLD filter parser is broken" issue. If I change
styling rules I see changes reflected in the output image, but if I change
the filter rules, there is no change in the selection of feature polygons.
It's assigning a portion of the features to the filter rule and the other
half to some default style. Changing the Rule does not affect this
(apparently random) division of features.

I've attached the URL, my SLD body (with some attempted Rule variations
commented), and a StackTrace I found in the log file.

Thanks for your help,

Doug Tallman

===============================
U.S. Geological Survey - NMD - WGSC
345 Middlefield Rd, MS 531
Menlo Park, CA 94025
Phone: (650) 329-4272
Email: [hidden email]
===============================

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

SLD:

<?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"
  xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>usgsAnt:nxdal030</Name>
    <UserStyle>
      <Name>highlight-features</Name>
      <FeatureTypeStyle>
        <Rule>
          <ogc:Filter>

            <!-- Variation 1: query against index map id
            <ogc:Or>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>index</ogc:PropertyName>
                <ogc:Literal>2</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>index</ogc:PropertyName>
                <ogc:Literal>3</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>index</ogc:PropertyName>
                <ogc:Literal>4</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>index</ogc:PropertyName>
                <ogc:Literal>5</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
            -->

           <!-- Variation 2: query against nominal scale
            <ogc:Or>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>map_scale</ogc:PropertyName>
                <ogc:Literal>50000</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>map_scale</ogc:PropertyName>
                <ogc:Literal>100000</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
            -->

            <!-- Variation 3: query against map type
            <ogc:Or>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>type</ogc:PropertyName>
                <ogc:Literal>topographic</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>type</ogc:PropertyName>
                <ogc:Literal>topo_recon</ogc:Literal>
              </ogc:PropertyIsEqualTo>
            </ogc:Or>
            -->

            <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>

        <!-- else Rule attempt
        <Rule>
          <ElseFilter/>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#333300</CssParameter>
              <CssParameter name="fill-opacity">0.9</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#003333</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>


STACKTRACE:

java.lang.NullPointerException
      at java.io.Writer.write(Unknown Source)
      at
org.vfny.geoserver.global.Log4JFormatter.format(Log4JFormatter.java:155)
      at java.util.logging.StreamHandler.publish(Unknown Source)
      at
org.vfny.geoserver.global.Log4JFormatter$Stdout.publish(Log4JFormatter.java:320)
      at java.util.logging.Logger.log(Unknown Source)
      at java.util.logging.Logger.doLog(Unknown Source)
      at java.util.logging.Logger.log(Unknown Source)
      at
org.geotools.renderer.lite.LiteRenderer2$DefaultRenderListener.errorOccurred(LiteRenderer2.java:1399)
      at
org.geotools.renderer.lite.LiteRenderer2.fireErrorEvent(LiteRenderer2.java:309)
      at
org.geotools.renderer.lite.LiteRenderer2.processStylers(LiteRenderer2.java:1017)
      at
org.geotools.renderer.lite.LiteRenderer2.paint(LiteRenderer2.java:429)
      at
org.geotools.renderer.lite.LiteRenderer2.paint(LiteRenderer2.java:367)
      at
org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:210)
      at
org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:164)
      at
org.vfny.geoserver.servlets.AbstractService.doService(AbstractService.java:404)
      at
org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:247)



-------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users