[Geoserver-users] WMS with an inlineFeature didn't work

Hi GS-community,
i was trying to send a WMS request with a user layer and an
inlineFeature-GML to a geoserver 1.3.0. The request looks closely like
this:

<GetMap version="1.2.0" service="WMS" xsi:schemaLocation="http://www.opengis.net/ows D:/workspace/RouteService/WEB-INF/classes/../../schemas/sld/GetMap.xsd" xmlns="http://www.opengis.net/ows&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:sld="http://www.opengis.net/sld&quot; xmlns:gml="http://www.opengis.net/gml&quot;&gt;
        <sld:StyledLayerDescriptor version="1.0.0">
                <sld:UserLayer>
                        <sld:Name>AvoidAreas</sld:Name>
                        <sld:InlineFeature>
                                <FeatureCollection xmlns="">
                                        <gml:featureMember>
                                                <gml:MultiPolygon>
                                                        <gml:polygonMember>
                                                                <gml:Polygon>
                                                                        <gml:outerBoundaryIs>
                                                                                <gml:LinearRing>
                                                                                         <gml:coordinates ......

                                                                       ... Very much polygon members ....

                                                <sld:PolygonSymbolizer>
                                                        <sld:Fill>
                                                                <sld:CssParameter name="fill">#FA0000</sld:CssParameter>
                                                                <sld:CssParameter name="fill-opacity">0.7</sld:CssParameter>
                                                        </sld:Fill>
                                                </sld:PolygonSymbolizer>
                                        </sld:Rule>
                                </sld:FeatureTypeStyle>
                        </sld:UserStyle>
                </sld:UserLayer>
        </sld:StyledLayerDescriptor>
        <BoundingBox srsName="http://www.opengis.net/gml/srs/epsg.xml#31463&quot;&gt;
                <gml:coord>
                        <gml:X>3430748.94</gml:X>
                        <gml:Y>5794695.62</gml:Y>
                </gml:coord>
                <gml:coord>
                        <gml:X>3431313.48</gml:X>
                        <gml:Y>5795758.34</gml:Y>
                </gml:coord>
        </BoundingBox>
        <Output>
                <Format>image/png</Format>
                <Transparent>false</Transparent>
                <BGcolor>#FFFFFF</BGcolor>
                <Size>
                        <Width>400</Width>
                        <Height>400</Height>
                </Size>
        </Output>
        <Exceptions>application/vnd.ogc.se+xml</Exceptions>
</GetMap>

But i get this exception:
"Duplicate AttributeTypes DefaultAttributeType [name=polygonMember ,
type=class com.vividsolutions.jts.geom.Geometry , nillable=true,
min=1, max=1]"
What does this mean? I was looking in the gml-spec and the request
seems fully valid as it is.
Is it a bug?

Kind regards
Albrecht

mailto:weiser@anonymised.com

Albrecht Weiser ha scritto:

Hi GS-community,
i was trying to send a WMS request with a user layer and an
inlineFeature-GML to a geoserver 1.3.0. The request looks closely like
this:

But i get this exception:
"Duplicate AttributeTypes DefaultAttributeType [name=polygonMember ,
type=class com.vividsolutions.jts.geom.Geometry , nillable=true,
min=1, max=1]"
What does this mean? I was looking in the gml-spec and the request
seems fully valid as it is.
Is it a bug?

Hmmm... not sure... can you provide me with the full request, attached
to a mail or, if too big, can you send it to me by private mail?

Cheers
Andrea

Albrecht Weiser ha scritto:

Wow, quick reply ;o)
sure, i attached the xml. Its called "GetMap_inline.xml. I was
modifying a request that formerly was posted on the geoserver-sites.
(Maybe you rember that request when drawing a smiley with geoserver)
The difference to this request is, that they used this structure:
<sld:InlineFeature>
<FeatureCollection xmlns="">
<FeatureMember>
  <Polygon srsName="31467" xmlns="http://www.opengis.net/gml&quot;&gt;
   <outerBoundaryIs>
    <LinearRing xsi:type="gml:LinearRingType">
     <coord>
      <X>3433957.755</X>
      <Y>5797484.741</Y>
     </coord>
and so on
i didn't write every coordinate as xy-coordinate pair, but with the
<coordinates> element and the multistring of all participating
coordinates (You'll see).

Pheew, lots going on here... took my quite some time to figure
out what was going on because the parsing code is a bit flacky.

Ok, there are both bugs in the code (and that code haven't been
touched for two years now, so I guess nobody is really using it),
and you your xml.

Your feature definition is wrong, you did not provide a tag for
the feature and the attribute. These can really be anything, I mean,
the first one defines the feature type, the second one the attribute.

So a proper snippet would be:

<FeatureCollection xmlns="">
  <gml:featureMember>
     <myFeture>
       <mypolygonProperty>
         <gml:multiPolygon>
    <gml:polygonMember>
      <gml:Polygon>
        <gml:outerBoundaryIs>...

Also mind letter case: it is "LinearRing" not "linearRing".

The second issue is that the inline feature parser does not handle
multi-geomtries at all. You'll have to set up one feature for
each element of your polygons.

I've attached a working request.
Cheers
Andrea Aime

GetMap_inline.xml (8.18 KB)