[Geoserver-devel] [jira] (GEOS-5762) json responses contains geometry even though that property has not been requested

Per Lewau created BugGEOS-5762
json responses contains geometry even though that property has not been requested

Issue Type:

BugBug

Affects Versions:

2.3.0

Assignee:

Andrea Aime

Components:

WFS

Created:

11/Apr/13 3:57 AM

Description:

When requesting json from the WFS service in GeoServer 2.2.5 we got only the properties we requested.

$ curl -s ‘http://127.0.0.1:8080/geoserver/wfs?request=GetFeature&typeName=sf:archsites&MAXFEATURES=1&outputFormat=application/json&VERSION=1.1.0&propertyName=cat
{“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“id”:“archsites.1”,“geometry”:null,“properties”:{“cat”:1}}]}

When doing the same with GeoServer 2.3.0 we first get an exception since the propertyName parser seems to be broken.

$ curl -s ‘http://127.0.0.1:8080/geoserver/wfs?request=GetFeature&typeName=sf:archsites&MAXFEATURES=1&outputFormat=application/json&VERSION=1.1.0&propertyName=cat
<?xml version=“1.0” encoding=“UTF-8”?>
<ows:ExceptionReport version=“1.0.0”
xsi:schemaLocation=“http://www.opengis.net/ows http://127.0.0.1:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:ows=“http://www.opengis.net/ows”>
<ows:Exception exceptionCode=“NoApplicableCode”>
<ows:ExceptionText>java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection
java.lang.String cannot be cast to java.util.Collection</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

So lets try to request cat,cat instead:

$ curl -s ‘http://127.0.0.1:8080/geoserver/wfs?request=GetFeature&amp;typeName=sf:archsites&amp;MAXFEATURES=1&amp;outputFormat=application/json&amp;VERSION=1.1.0&amp;propertyName=cat,cat
{“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“id”:“archsites.1”,“geometry”:

{“type”:“Point”,“coordinates”:[593493,4914730]}

,“geometry_name”:“the_geom”,“properties”:{“cat”:1,“str1”:“Signature Rock”}}],“crs”:{“type”:“EPSG”,“properties”:

{“code”:“26713”}

}}

Now we also got the geometry and str1.

This is a problem for us since we get OOME’s since the responses are all of a sudden very big.

Am I missing some other neat way of excluding the geometry?

Environment:

Windows 7

Project:

GeoServer

Priority:

MajorMajor

Reporter:

Per Lewau

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)