Package org.geotools.wfs.v1_0

Examples of org.geotools.wfs.v1_0.WFSCapabilities


            if (validation && ((value == null) || (value.length != 4))) {
                throw new SAXException(
                    "The WFS Capabilites document has the wrong number of children");
            }

            WFSCapabilities result = new WFSCapabilities();

            for (int i = 0; i < 4 && i < value.length; i++) {
                if (elements[0].getName().equals(value[i].getElement().getName())) {
                    // service
                    result.setService((Service) value[i].getValue());
                } else {
                    if (elements[1].getName().equals(value[i].getElement()
                                                                 .getName())) {
                        // capability
                        Object[] temp = (Object[]) value[i].getValue();

                        if (temp.length != 2) {
                            throw new SAXException(
                                "The WFS Capabilites document has an invalid capability child");
                        }

                        result.setVendorSpecificCapabilities((String) temp[0]);

                        OperationType[] tmp = (OperationType[]) temp[1];

                        if (tmp != null) {
                            result.setGetCapabilities(tmp[0]);
                            result.setDescribeFeatureType(tmp[1]);
                            result.setTransaction(tmp[2]);
                            result.setGetFeature(tmp[3]);
                            result.setGetFeatureWithLock(tmp[4]);
                            result.setLockFeature(tmp[5]);
                        }
                    } else {
                        if (elements[2].getName().equals(value[i].getElement()
                                                                     .getName())) {
                            // FeatureTypeList
                            result.setFeatureTypes((List) value[i].getValue());
                        } else {
                            if (elements[3].getName().equals(value[i].getElement()
                                                                         .getName())) {
                                // Filter_Capabilities
                                result.setFilterCapabilities((FilterCapabilities) value[i]
                                    .getValue());
                            } else {
                                if(validation){
                                    // error
                                    throw new SAXException("The element "
View Full Code Here


        SimpleFeatureType featureType = (SimpleFeatureType) features.getSchema();
       
        FeatureCollectionType fc = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fc.getFeature().add( features );
       
        Encoder e = new Encoder( new WFSConfiguration() );
        e.getNamespaces().declarePrefix( "feature", featureType.getName().getNamespaceURI() );
        e.encode( fc, WFS.FeatureCollection, handler );
    }
View Full Code Here

                + "      <ows:Identifier>result</ows:Identifier>\n"
                + "    </wps:RawDataOutput>\n" + "  </wps:ResponseForm>\n" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(36, fc.size());
View Full Code Here

                + "<ows:Identifier>result</ows:Identifier>"
                + "</wps:RawDataOutput>" + "</wps:ResponseForm>" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(1, fc.size());
View Full Code Here

    }
   
    public static class WFS10 extends WFSPPIO {
       
        public WFS10() {
            super(new WFSConfiguration(), "text/xml; subtype=wfs-collection/1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

     * A WFS 1.0 PPIO using alternate MIME type without a ";" that creates troubles in KVP parsing
     */
    public static class WFS10Alternate extends WFSPPIO {
       
        public WFS10Alternate() {
            super(new WFSConfiguration(), "application/wfs-collection-1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

                + "</wps:RawDataOutput>"
                + "</wps:ResponseForm>" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(1, fc.size());
View Full Code Here

    }
   
    public static class WFS10 extends WFSPPIO {
       
        public WFS10() {
            super(new WFSConfiguration(), "text/xml; subtype=wfs-collection/1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

     * A WFS 1.0 PPIO using alternate MIME type without a ";" that creates troubles in KVP parsing
     */
    public static class WFS10Alternate extends WFSPPIO {
       
        public WFS10Alternate() {
            super(new WFSConfiguration(), "application/wfs-collection-1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

        // that we want to be consistently reproduced for GetFeatureInfo as well
        final InputStream is = ml.getFeatureInfo(bbox, width, height, x, y,
                "application/vnd.ogc.gml", maxFeatures);
        List<FeatureCollection> results = new ArrayList<FeatureCollection>();
        try {
            Parser parser = new Parser(new WFSConfiguration());
            parser.setStrict(false);
            Object result = parser.parse(is);
            if (result instanceof FeatureCollectionType) {
                FeatureCollectionType fcList = (FeatureCollectionType) result;
                List<SimpleFeatureCollection> rawResults = fcList.getFeature();
View Full Code Here

TOP

Related Classes of org.geotools.wfs.v1_0.WFSCapabilities

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.