Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2907 closed enhancement (fixed)

resultType=hits for WFS 1.1

Reported by: bartvde Owned by: tomkralidis
Priority: normal Milestone: 5.4.1 release
Component: WFS Server Version: unspecified
Severity: normal Keywords:
Cc:

Description

WFS 1.1. has a resultType parameter, which can have a value of hits. In that case it should the return the number of records the query returns.

Change History (6)

comment:1 by tomkralidis, 15 years ago

Cc: tomkralidis added

More info on this in http://portal.opengeospatial.org/files/?artifact_id=8339, table 9b, and clause 9.3

So, when a GetFeature request is passed with resulttype=hits OR <GetFeature resultType="hits"...>, MapServer WFS 1.1.0 responds with just the root element, adding the numberOfHits and timeStamp attributes.

<wfs:FeatureCollection
  xsi:schemaLocation="http://www.ec.gc.ca/carts http://devgeo.cciw.ca/cgi-bin/mapserv/carts?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=cws&OUTPUTFORMAT=text/xml; subtype=gml/3.1.1  http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" numberOfFeatures="$n" timeStamp="$t">

Where $n is the hit count and $t is the timestamp in ISO8601 format

Bart: does this make sense?

comment:2 by tomkralidis, 15 years ago

This has been committed in trunk in r8662 and updated in msautotest in r8663.

Notes:

  • for WFS 1.1.0, the root element will now always have numberOfFeatures output. This is an optional attribute which can be used regardless of whether resultType is passed by the client. So this would be useful to output in either case
  • if resultType = hits, then the root element only is output
  • timeStamp is an optional attribute, so I opted not to output it

Bart: can you test and verify? We can backport to 5.4.1 if all works as expected.

comment:3 by tomkralidis, 15 years ago

Owner: changed from mapserverbugs to tomkralidis
Status: newassigned

comment:4 by bartvde, 15 years ago

Hey Tom, this works fine for us on ArcSDE. Thanks.

comment:5 by tomkralidis, 15 years ago

Resolution: fixed
Status: assignedclosed

comment:6 by tomkralidis, 15 years ago

Cc: tomkralidis removed

FYI update in trunk (r9110).

If maxFeatures is passed in the GetFeature request, then the response numberOfFeatures matches maxFeatures.

FYI I also added an ows:Constraint "DefaultMaxFeatures" in WFS Capabilities (SOS does this as well) if MAP.WEB.METADATA.wfs|ows_maxfeatures is set.

Thanks to Bart and GeoServer-users for the heads up.

Note: See TracTickets for help on using tickets.