kvp.put("startIndex", String.valueOf(offset > 0 ? offset + count : count)); kvp.put("limit", String.valueOf(maxFeatures)); result.setNext(buildURL(request, itemsPath, kvp));
result.setNext(buildURL(request.getBaseUrl(), "wfs", kvp, URLType.SERVICE)); } else if (count > 0 && offset > -1 && maxFeatures <= count) { kvp.put("startIndex", String.valueOf(offset > 0 ? offset + count : count)); kvp.put("count", String.valueOf(maxFeatures)); result.setNext(buildURL(request.getBaseUrl(), "wfs", kvp, URLType.SERVICE));
public void write(Object value, OutputStream output, Operation operation) throws IOException, ServiceException { WFSInfo wfs = getInfo(); FeatureCollectionResponse featureCollection = (FeatureCollectionResponse) value; // create a new feautre collcetion type with just the numbers FeatureCollectionResponse hits = featureCollection.create(); if (GML3OutputFormat.isComplexFeature(featureCollection)) { // we have to count the number of features here manually because complex feature // collection size() now returns 0. In order to count the number of features, // we have to build the features to count them and this has great performance // impact. Unless we introduce joins in our fetching of // data, we will have to count the number of features manually when needed. In // GML3Outputformat I use xslt to populate numberOfFeatures attribute. hits.setNumberOfFeatures(countFeature(featureCollection)); } else { hits.setNumberOfFeatures(featureCollection.getNumberOfFeatures()); } hits.setTotalNumberOfFeatures(featureCollection.getTotalNumberOfFeatures()); hits.setNext(featureCollection.getNext()); hits.setPrevious(featureCollection.getPrevious()); hits.setTimeStamp(featureCollection.getTimeStamp()); encode(hits, output, wfs); }