Package org.vfny.geoserver.wms

Examples of org.vfny.geoserver.wms.WmsException


       
        //DJB: the WMS spec says that the request must not be 0 area
        //     if it is, throw a service exception!
        Envelope env = request.getBbox();
        if (env.isNull() || (env.getWidth() <=0)|| (env.getHeight() <=0)){
          throw new WmsException("The request bounding box has zero area: " + env);
        }

        // DJB DONE: replace by setAreaOfInterest(Envelope,
        // CoordinateReferenceSystem)
        // with the user supplied SRS parameter
       
        //if there's a crs in the request, use that.  If not, assume its 4326
       
        CoordinateReferenceSystem mapcrs = request.getCrs();
       
        //DJB: added this to be nicer about the "NONE" srs.
        if (mapcrs !=null)
          map.setAreaOfInterest(request.getBbox(),mapcrs);
        else
          map.setAreaOfInterest(request.getBbox());
        map.setMapWidth(request.getWidth());
        map.setMapHeight(request.getHeight());
        map.setBgColor(request.getBgColor());
        map.setTransparent(request.isTransparent());

        LOGGER.fine("setting up map");

        
        MapLayer layer;

        FeatureSource source;
        for (int i = 0; i < layers.length; i++) {
            Style style = styles[i];

            try {
                source = layers[i].getFeatureSource();
            } catch (IOException exp) {
                LOGGER.log(Level.SEVERE,
                    "Getting feature source: " + exp.getMessage(), exp);
                throw new WmsException(null,
                    "Internal error : " + exp.getMessage());
            }

            layer = new DefaultMapLayer(source, style);
View Full Code Here


            mpf = null;
        }

        if (mpf == null) {
            throw new WmsException("There is no support for creating maps in "
                + outputFormat + " format", "InvalidFormat");
        }

       
        GetMapProducer producer = mpf.createMapProducer(outputFormat,config);
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        try {
            transformer.transform(this.request, out);
        } catch (TransformerException e) {
            throw new WmsException(e);
        }

        this.content = out.toByteArray();
    }
View Full Code Here

                attributes[i] = atts[i].createDefaultValue();

            sampleFeature = schema.create(attributes);
        } catch (IllegalAttributeException e) {
            e.printStackTrace();
            throw new WmsException(e);
        }

        return sampleFeature;
    }
View Full Code Here

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        try {
            transformer.transform(request, out);
        } catch (TransformerException e) {
            throw new WmsException(e);
        }

        this.rawResponse = out.toByteArray();
    }
View Full Code Here

                break;
            }
        }

        if (delegateClass == null) {
            throw new WmsException(requestFormat +
                " is not recognized as an output format for this server. " +
                "Please consult the Capabilities document",
                "GetMapResponse.getDelegate");
        }

        try {
            curDelegate = (GetFeatureInfoDelegate) delegateClass.newInstance();
        } catch (Exception ex) {
            throw new WmsException(ex,
                "Cannot obtain the map generator for the requested format",
                "GetMapResponse::getDelegate()");
        }

        return curDelegate;
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wms.WmsException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.