Ticket #2907 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

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

Changed 4 years ago by tomkralidis

  • 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?

Changed 4 years ago by tomkralidis

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.

Changed 4 years ago by tomkralidis

  • owner changed from mapserverbugs to tomkralidis
  • status changed from new to assigned

Changed 4 years ago by bartvde

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

Changed 4 years ago by tomkralidis

  • status changed from assigned to closed
  • resolution set to fixed

Changed 4 years ago by tomkralidis

  • 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.