|
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&typeName=sf:archsites&MAXFEATURES=1&outputFormat=application/json&VERSION=1.1.0&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?
|