WFSFeatureCollection.getCount() requires the geom property to successfully do a forced count of all the features in the FeatureCollection

Description

When FeatureCollection.size() is called, WFSFeatureCollection.getCount() also gets called down the stack. WFSFeatureCollection.getCount() checks to see if a cachedSize exists and if it doesn't, it'll use the XmlSimpleFeatureParser to check if the numberOfFeatures attribute is set in the FeatureCollection element and use the value of that instead. One thing we noticed is that the numberOfFeatures attribute is always set in GeoServer but not on ArcGis. So when this attribute is not found, it will do a forced Feature Collection bounds calculation which in turn will also count the number of features inside the document. This process is a bit expensive and also requires the geometry attribute to be requested as a part of the propertyNames to be returned all the time. The operation can probably be made less expensive by just creating a "count-only-the-features-and-not-recalculate-the-bounds" method.

Environment

None

Assignee

Jody Garnett

Reporter

codehaus

Triage

None

Components

Affects versions

Priority

Low
Configure