Phil, your schema makes BH_ID, SHAPE, and BH_TYPE_ID mandatory (minOccurs=1 and nillable=false): http://maps.gns.cri.nz/geoserverlatest/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=gns%3APETROLEUM.PETROLEUM_BOREHOLE_VIEW
I far as I know, JDBC feature sources make a property mandatory by default if the underlying database column has a NOT NULL constraint. You may be able to change this with GeoServer schema mapping: http://docs.geoserver.org/stable/en/user/services/wfs/schemamapping.html The GeoJSON spec requires a geometry property but permits it to be null; I do not know whether GeoServer JSON outputFormat encodes a geometry if the geometry property is not mandatory and not requested. Kind regards, Ben. On 15/01/16 11:46, Phil Scadden wrote: > If I make this POST query to our server: > http://maps.gns.cri.nz/geoserverlatest (public) > > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" > version="1.1.0" count="1" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.opengis.net/wfs > http://schemas.opengis.net/wfs/1.1.0/wfs/xsd" > outputFormat="application/json"><wfs:Query > typeName="gns:PETROLEUM.PETROLEUM_BOREHOLE_VIEW" > srsName="EPSG:4326"><wfs:PropertyName>BH_NAME</wfs:PropertyName><ogc:Filter > xmlns:ogc="http://www.opengis.net/ogc"><ogc:Intersects><ogc:PropertyName>SHAPE</ogc:PropertyName><gml:Polygon > xmlns:gml="http://www.opengis.net/gml" > srsName="EPSG:4326"><gml:exterior><gml:LinearRing><gml:posList>170.0244140625 > -44.8714427501659 170.0244140625 -44.68427737181224 169.7607421875 > -44.68427737181224 169.7607421875 -44.8714427501659 170.0244140625 > -44.8714427501659</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></ogc:Intersects></ogc:Filter></wfs:Query></wfs:GetFeature> > > Then I get three properties returned, BH_NAME, BH_ID, and BH_TYPE_ID > (there are a large no. of other properties that could be returned and > are if you remove the <wfs:PropertyName>BH_NAME</wfs:PropertyName> from > the query). > I expect only BH_NAME. > > Worse, (far worse), it returns the geometry despite not having SHAPE in > the property lsit. For the above feature type, this doesnt matter but if > I make WFS queries on a complex polygon classes to fetch attributes only > from a spatial search, then I get swamped by multi-megabytes of geometry > in the response. > -- Ben Caradoc-Davies <[email protected]> Director Transient Software Limited <http://transient.nz/> New Zealand ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
