public GetFeatureInfoResponse getFeatureInfo( GetFeatureInfo request ) throws OWSExceptionReport, XMLStreamException, IOException { Map<String, String> kvp = buildGetFeatureInfoKvpMap( request ); if ( request.getOverriddenParameters() != null ) { for ( Entry<String, String> e : request.getOverriddenParameters().entrySet() ) { if ( kvp.containsKey( e.getKey().toLowerCase() ) ) { kvp.put( e.getKey().toLowerCase(), e.getValue() ); } else kvp.put( e.getKey(), e.getValue() ); } } URL endPoint = getGetUrl( WMTSConstants.WMTSRequestType.GetTile.name() ); OwsHttpResponse response = httpClient.doGet( endPoint, kvp, null ); response.assertHttpStatus200(); response.assertNoXmlContentTypeAndExceptionReport(); return new GetFeatureInfoResponse( response, request ); }
/** * Performs the given {@link GetTile} request. * * @param request * <code>GetTile</code> requests, must not be <code>null</code> * @return server response, never <code>null</code> * @throws IOException * @throws OWSExceptionReport * @throws XMLStreamException */ public GetTileResponse getTile( GetTile request ) throws IOException, OWSExceptionReport, XMLStreamException { Map<String, String> kvp = buildGetTileKvpMap( request ); if ( request.getOverriddenParameters() != null ) { for ( Entry<String, String> e : request.getOverriddenParameters().entrySet() ) { if ( kvp.containsKey( e.getKey().toLowerCase() ) ) { kvp.put( e.getKey().toLowerCase(), e.getValue() ); } else kvp.put( e.getKey(), e.getValue() ); } } URL endPoint = getGetUrl( WMTSConstants.WMTSRequestType.GetTile.name() ); OwsHttpResponse response = httpClient.doGet( endPoint, kvp, null ); response.assertHttpStatus200(); response.assertNoXmlContentTypeAndExceptionReport(); return new GetTileResponse( response ); }
/** * Returns the tile as an image. * * @return image, never <code>null</code> * @throws IOException * @throws XMLStreamException * @throws OWSExceptionReport */ public BufferedImage getAsImage() throws IOException, OWSExceptionReport, XMLStreamException { rawResponse.assertNoXmlContentTypeAndExceptionReport(); BufferedImage image = null; try { InputStream is = rawResponse.getAsBinaryStream(); image = HttpUtils.IMAGE.work( is ); } finally { rawResponse.close(); } return image; }