public List<FeatureCollection> identify(FeatureInfoRequestParameters params, int maxFeatures) throws IOException {
final int x = params.getX();
final int y = params.getY();
WMSLayerInfo info = (WMSLayerInfo) params.getLayer().getResource();
WebMapServer wms = info.getStore().getWebMapServer(null);
Layer layer = info.getWMSLayer(null);
CoordinateReferenceSystem crs = params.getRequestedCRS();
if (crs == null) {
// use the native one
crs = info.getCRS();
}
ReferencedEnvelope bbox = params.getRequestedBounds();
int width = params.getWidth();
int height = params.getHeight();
// we can cascade GetFeatureInfo on queryable layers and if the GML mime type is supported
if (!layer.isQueryable()) {
return null;
}
List<String> infoFormats;
infoFormats = wms.getCapabilities().getRequest().getGetFeatureInfo().getFormats();
if (!infoFormats.contains("application/vnd.ogc.gml")) {
return null;
}
// the wms layer does request in a CRS that's compatible with the WMS server srs