private GetFeatureInfo createGetFeatureInfo( GetMap getMap, List<String> queryLayers, int i, int j, Output output, String exceptions ) throws OWSException { HashMap<String, String> parameterMap = new HashMap<String, String>(); if ( exceptions != null ) parameterMap.put( "EXCEPTIONS", exceptions ); return new GetFeatureInfo( getMap.getLayers(), getMap.getStyles(), queryLayers, getMap.getWidth(), getMap.getHeight(), i, j, getMap.getBoundingBox(), getMap.getCoordinateSystem(), output.featureCount, output.infoFormat, parameterMap, getMap.getDimensions() ); }
layers.add( layerRef.getName() ); int width = gm.getWidth(); int height = gm.getHeight(); Envelope bbox = gm.getBoundingBox();
map.put( "width", Integer.toString( getMap.getWidth() ) ); map.put( "height", Integer.toString( getMap.getHeight() ) ); map.put( "transparent", "true" );
private LinkedList<String> doGetMap( GetMap getMap, Map<String, String> map, Version version, OutputStream stream ) throws OWSException, IOException { checkGetMap( version, getMap ); RenderingInfo info = new RenderingInfo( getMap.getFormat(), getMap.getWidth(), getMap.getHeight(), getMap.getTransparent(), getMap.getBgColor(), getMap.getBoundingBox(), getMap.getPixelSize(), map, imageSerializers.get( getMap.getFormat() ) ); RenderContext ctx = ouputFormatProvider.getRenderers( info, stream ); LinkedList<String> headers = new LinkedList<String>(); service.getMap( getMap, headers, ctx ); ctx.close(); return headers; }
/** * @param hardParameters * parameters to override in the request, may be null * @throws IOException */ public Pair<BufferedImage, String> getMap( GetMap getMap, Map<String, String> hardParameters, int timeout, boolean errorsInImage ) throws IOException { if ( VERSION_111.equals( wmsVersion ) ) { Worker worker = new Worker( getMap.getLayers(), getMap.getStyles(), getMap.getWidth(), getMap.getHeight(), getMap.getBoundingBox(), getMap.getCoordinateSystem(), getMap.getFormat(), getMap.getTransparent(), errorsInImage, false, null, hardParameters ); Pair<BufferedImage, String> result; try { if ( timeout == -1 ) { result = worker.call(); } else { result = Executor.getInstance().performSynchronously( worker, timeout * 1000 ); } } catch ( Throwable e ) { throw new IOException( e.getMessage(), e ); } return result; } throw new IllegalArgumentException( "GetMap request for other versions than 1.1.1 are not supported yet." ); }
private LayerQuery buildQuery( StyleRef style, LayerRef lr, MapOptionsMaps options, List<MapOptions> mapOptions, OperatorFilter f, org.deegree.protocol.wms.ops.GetMap gm ) { for ( org.deegree.layer.Layer l : Themes.getAllLayers( themeMap.get( lr.getName() ) ) ) { insertMissingOptions( l.getMetadata().getName(), options, l.getMetadata().getMapOptions(), defaultLayerOptions ); mapOptions.add( options.get( l.getMetadata().getName() ) ); } LayerQuery query = new LayerQuery( gm.getBoundingBox(), gm.getWidth(), gm.getHeight(), style, f, gm.getParameterMap(), gm.getDimensions(), gm.getPixelSize(), options, gm.getQueryBox() ); return query; }
/** * Checks whether the given {@link GetMap} request can be processed with regard to the configured limits on image * size and layer count. * * @param request * request, must not be <code>null</code> * @param config * WMS config, must not be <code>null</code> * @throws OWSException * if the request can not be processed */ public void checkRequestedSizeAndLayerCount( final GetMap request, final DeegreeWMS config ) throws OWSException { checkWidth( request.getWidth(), toIntegerNullSafe( config.getMaxWidth() ) ); checkHeight( request.getHeight(), toIntegerNullSafe( config.getMaxHeight() ) ); int layerCount = request.getLayers() != null ? request.getLayers().size() : 0; checkLayerCount( layerCount, toIntegerNullSafe( config.getLayerLimit() ) ); }