// FILTER_LANGUAGE
// RESOURCEID
// BBOX
// STOREDQUERY_ID
KvpMap kvp = new KvpMap();
// SERVICE
// VERSION
// REQUEST
kvp.put("SERVICE", "WFS");
kvp.put("REQUEST", "GetFeature");
kvp.put("VERSION", request.getVersion());
// OUTPUTFORMAT
// RESULTTYPE
kvp.put("OUTPUTFORMAT", request.getOutputFormat());
kvp.put("RESULTTYPE", request.isResultTypeHits()
? ResultTypeType.HITS.name() : ResultTypeType.RESULTS.name());
// TYPENAMES
// PROPERTYNAME
// ALIASES
// SRSNAME
// FILTER
// SORTBY
List<Query> queries = request.getQueries();
Query q = queries.get(0);
if (q.getSrsName() != null) {
kvp.put("SRSNAME", q.getSrsName().toString());
}
StringBuilder typeNames = new StringBuilder();
StringBuilder propertyName = !q.getPropertyNames().isEmpty() ? new StringBuilder() : null;
StringBuilder aliases = !q.getAliases().isEmpty() ? new StringBuilder() : null;
StringBuilder filter = q.getFilter() != null && q.getFilter() != Filter.INCLUDE ?
new StringBuilder() : null;
encodeQueryAsKvp(q, typeNames, propertyName, aliases, filter, true);
if (queries.size() > 1) {
for (int i = 1; i < queries.size(); i++) {
encodeQueryAsKvp(queries.get(i), typeNames, propertyName, aliases, filter, true);
}
}
kvp.put("TYPENAMES", typeNames.toString());
if (propertyName != null) {
kvp.put("PROPERTYNAME", propertyName.toString());
}
if (aliases != null) {
kvp.put("ALIASES", aliases.toString());
}
if (filter != null) {
kvp.put("FILTER", filter.toString());
}
return kvp;
}