Hi!

I'm having a hard time using the StreamingRenderer (GeoTools 2.7.2). It
throws an exception:

SEVERE: Could not find 'rotation' in the FeatureType
(http://www.opengis.net/gml:Flag)
org.geotools.filter.IllegalFilterException: Could not find 'rotation' in
the FeatureType (http://www.opengis.net/gml:Flag)
        at
org.geotools.renderer.lite.StreamingRenderer.createBBoxFilters(StreamingRenderer.java:1508)
        at
org.geotools.renderer.lite.StreamingRenderer.queryLayer(StreamingRenderer.java:1005)
        at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1919)
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:773)
        at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:581)

To explain what I've done.

I parse a GeoJSON string and creates a FeatureCollection from it. The
collection is created using the SimpleFeatureBuilder (creating
SimpleFeatures with a SimpleFeatureType). The type is also created by
looking at the properties in my GeoJSON. The style used for rendering is
read from an SLD file.

The problem seems to be that StreamingRenderer throws this Exception if
the GeoJSON (or in this case the Feature I want to render) is missing
any attributes defined in the SLD. 

The part of the SLD which makes this crash and burn is:

                 <Rule>
                    <ogc:Filter>
                        <ogc:PropertyIsEqualTo>
                            <ogc:PropertyName>type</ogc:PropertyName>
                            <ogc:Literal>arrow_end</ogc:Literal>
                        </ogc:PropertyIsEqualTo>
                    </ogc:Filter>
                    <PointSymbolizer>
                        <Graphic>
                            <ExternalGraphic>
                                <OnlineResource xlink:type="simple"
xlink:href="images/arrow_end.png"/>
                                <Format>image/png</Format>
                            </ExternalGraphic>

<Rotation><ogc:PropertyName>rotation</ogc:PropertyName></Rotation>
                        </Graphic>
                    </PointSymbolizer>
                </Rule>

I parse and try to render the following feature:

{"type":"FeatureCollection","features":[{"type":"Feature","id":"OpenLayers.Feature.Vector_207",
"properties":{"type":"pnt_pumpe"},"geometry":{"type":"Point","coordinates":[486483.61761134,6479993.5908865]}}]}

This makes the StreamingRenderer throw this Exception and exit. Adding
'rotation' to the JSON above sort of solves the problem, but the main
question remains:

Why do the features sent to the StreamingRenderer have to contain every
property defined in the SLD (or so it seems)? The rule above doesn't
even apply to the feature I'm trying to render.


regards,

Håvard N.


------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to