planetfederal / wps-gui

Graphical User Interface (Model Builder) for OGC:WPS (Web Processing Services)
http://boundlessgeo.com
Apache License 2.0
26 stars 15 forks source link

java.lang.ArrayIndexOutOfBoundsException in getgeometryN process #75

Closed sbalasub closed 9 years ago

sbalasub commented 10 years ago

getgeometryN process requires a geometry collection for input, but when I enter a polygonal geometry as the input and index =1 I get a java exception. This can be replaced with a meaningful error message.

bartvde commented 10 years ago

I don't see a way (based on the DescribeProcess response) for the client to determine that it needs to enforce a geometry collection and not a single geometry (and that it needs to make sure that the index does not exceed the length of the collection):

            <Input maxOccurs="1" minOccurs="1">
                <ows:Identifier>geom</ows:Identifier>
                <ows:Title>geom</ows:Title>
                <ows:Abstract>Input geometry</ows:Abstract>
                <ComplexData>
                    <Default>
                        <Format>
                            <MimeType>text/xml; subtype=gml/3.1.1</MimeType>
                        </Format>
                    </Default>
                    <Supported>
                        <Format>
                            <MimeType>text/xml; subtype=gml/3.1.1</MimeType>
                        </Format>
                        <Format>
                            <MimeType>text/xml; subtype=gml/2.1.2</MimeType>
                        </Format>
                        <Format>
                            <MimeType>application/wkt</MimeType>
                        </Format>
                        <Format>
                            <MimeType>application/gml-3.1.1</MimeType>
                        </Format>
                        <Format>
                            <MimeType>application/gml-2.1.2</MimeType>
                        </Format>
                    </Supported>
                </ComplexData>
            </Input>
            <Input maxOccurs="1" minOccurs="1">
                <ows:Identifier>index</ows:Identifier>
                <ows:Title>index</ows:Title>
                <ows:Abstract>Index of geometry element (0 is first)</ows:Abstract>
                <LiteralData>
                    <ows:DataType>xs:int</ows:DataType>
                    <ows:AnyValue/>
                </LiteralData>
            </Input>

@dwins do you see ways of handling this more gracefully on the server-side?