Package org.geoserver.ows.util

Examples of org.geoserver.ows.util.KvpMap


    @Override
    public InputStream createInputStream(URI uri, Map<?, ?> options) throws IOException {
        Catalog catalog = geoServer.getCatalog();
        try {
            KvpMap kv = parseQueryString(uri.query());

            //dispatch the correct describe feature type reader
            WFSInfo.Version ver = WFSInfo.Version.negotiate((String)kv.get("VERSION"));
            if(ver == null) {
                ver = WFSInfo.Version.latest();
            }
            DescribeFeatureTypeKvpRequestReader dftReqReader = null;
            switch(ver) {
            case V_10:
            case V_11:
                dftReqReader = new DescribeFeatureTypeKvpRequestReader(catalog);
                break;
            default:
                dftReqReader =
                    new org.geoserver.wfs.kvp.v2_0.DescribeFeatureTypeKvpRequestReader(catalog);
            }

            //parse the key value pairs
            KvpMap parsed = new KvpMap(kv);
            KvpUtils.parse(parsed);

            //create/read the request object
            DescribeFeatureTypeRequest request = DescribeFeatureTypeRequest.adapt(
                dftReqReader.read(dftReqReader.createRequest(), parsed, kv));
View Full Code Here


     * @param href
     * @param reader
     * @return
     */
    Object kvpParse(String href, KvpRequestReader reader) throws Exception {
        Map original = new KvpMap(KvpUtils.parseQueryString(href));
        KvpUtils.normalize(original);
        Map parsed = new KvpMap(original);
        List<Throwable> errors = KvpUtils.parse(parsed);
        if (errors.size() > 0) {
            throw new WPSException("Failed to parse KVP request", errors.get(0));
        }

View Full Code Here

     *
     * @param href
     * @return
     */
    String getVersion(String href) {
        return (String) new KvpMap(KvpUtils.parseQueryString(href)).get("VERSION");
    }
View Full Code Here

            return;
        }

        //track parsed kvp and unparsd
        Map parsedKvp = KvpUtils.normalize(kvp);
        Map rawKvp = new KvpMap( parsedKvp );

        req.setKvp(parsedKvp);
        req.setRawKvp(rawKvp);
    }
View Full Code Here

                throw new RestletException("Layer not indexable: " + layer,
                        Status.CLIENT_ERROR_FORBIDDEN);
            }

            // create some kvp and pass through to GetMapKvpreader
            KvpMap raw = new KvpMap();
            raw.put("layers", namespace + ":" + layer);
            raw.put("format", "kml");
            raw.put("format_options", "selfLinks:true;relLinks:true;");
            // regionateby:" + regionateBy + (regionateAttr != null ? ";regionateAttr:" + regionateAttr : ""));

            if (feature != null) {
                raw.put("featureid", feature);
            } else {
                raw.put("startIndex", Integer.toString(startIndex));
                raw.put("maxfeatures", Integer.toString(maxFeatures));
            }

            GetMapKvpRequestReader reader = new GetMapKvpRequestReader(getWMS());
            reader.setHttpRequest(RESTUtils.getServletRequest(request));

            // parse into request object
            raw = KvpUtils.normalize(raw);
            KvpMap kvp = new KvpMap(raw);
            KvpUtils.parse(kvp);
            final GetMapRequest getMapRequest = (GetMapRequest) reader.read(
                    (GetMapRequest) reader.createRequest(), kvp, raw);
            getMapRequest.setBaseUrl(RESTUtils.getBaseURL(request));
View Full Code Here

TOP

Related Classes of org.geoserver.ows.util.KvpMap

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.