public FeatureCollection getFeatures() throws OWSException, OWSExceptionReport { try { return FeatureInfoParser.parseAsFeatureCollection( rawResponse.getAsXMLStream(), request.getLayer() ); } catch ( XMLStreamException e ) { throw new OWSException( "Remote WMTS response was not recognized as feature collection: " + e.getLocalizedMessage(), e, OWSException.NO_APPLICABLE_CODE ); } }
/** * Performs a <code>GetFeatureInfo</code> request and returns the response as a {@link FeatureCollection}. * * @param request * request parameter, must not be <code>null</code> * @param hardParams * raw parameters for augmenting overriding KVPs, must not be <code>null</code> * @return response parsed as feature collection, never <code>null</code> * @throws IOException * @throws OWSExceptionReport * @throws XMLStreamException */ public FeatureCollection doGetFeatureInfo( GetFeatureInfo request, Map<String, String> hardParams ) throws IOException, OWSExceptionReport, XMLStreamException { Map<String, String> params = buildGetFeatureInfoParamMap( request, hardParams ); overrideHardParams( params, hardParams ); OwsHttpResponse response = null; try { URL url = getGetUrl( GetFeatureInfo.name() ); response = httpClient.doGet( url, params, null ); response.assertHttpStatus200(); XMLStreamReader reader = response.getAsXMLStream(); String csvLayerNames = join( ",", request.getQueryLayers() ); return FeatureInfoParser.parseAsFeatureCollection( reader, csvLayerNames ); } finally { closeQuietly( response ); } }