Package net.opengis.wfs

Examples of net.opengis.wfs.GetFeatureType


        // round up the info objects for each feature collection
        HashMap<String, Set<FeatureTypeInfo>> ns2metas = new HashMap<String, Set<FeatureTypeInfo>>();
        for (int fcIndex = 0; fcIndex < featureCollections.size(); fcIndex++) {
            if(getFeature.getParameters()[0] instanceof GetFeatureType) {
                // get the query for this featureCollection
                GetFeatureType request = (GetFeatureType) OwsUtils.parameter(getFeature.getParameters(),
                        GetFeatureType.class);
                QueryType queryType = (QueryType) request.getQuery().get(fcIndex);
               
                // may have multiple type names in each query, so add them all
                for (QName name : (List<QName>) queryType.getTypeName()) {
                    // get a feature type name from the query
                    Name featureTypeName = new NameImpl(name.getNamespaceURI(), name.getLocalPart());
View Full Code Here


    }

    protected void write(FeatureCollectionType featureCollection, OutputStream output,
            Operation getFeature) throws IOException, ServiceException {
        GetLogType request = (GetLogType) getFeature.getParameters()[0];
        GetFeatureType ftRequest = toGetFeatureType(featureCollection, request);

        prepare(ftRequest.getOutputFormat(), featureCollection, ftRequest);
        encode(output, featureCollection, ftRequest);
    }
View Full Code Here

     */
    private GetFeatureType toGetFeatureType(FeatureCollectionType featureCollection,
            GetLogType request) {
        FeatureCollection<SimpleFeatureType, SimpleFeature> features = (FeatureCollection) featureCollection.getFeature().get(0);
        SimpleFeatureType featureType = features.getSchema();
        GetFeatureType ftRequest = WfsFactory.eINSTANCE.createGetFeatureType();
        QueryType query = WfsFactory.eINSTANCE.createQueryType();
        query.setTypeName(Collections.singletonList(featureType.getTypeName()));
        ftRequest.getQuery().add(query);
        ftRequest.setBaseUrl(request.getBaseUrl());
        ftRequest.setHandle(request.getHandle());
        ftRequest.setMaxFeatures(request.getMaxFeatures());
        ftRequest.setOutputFormat(request.getOutputFormat());
        ftRequest.setResultType(ResultTypeType.RESULTS_LITERAL);
        return ftRequest;
    }
View Full Code Here

     * @param names type names for which queries are present in the returned request
     * @return GetFeature operation to request the named types
     */
    Operation request(QName... names) {
        Service service = getServiceDescriptor10();
        GetFeatureType type = WfsFactory.eINSTANCE.createGetFeatureType();
        type.setBaseUrl("http://localhost:8080/geoserver");
        for (QName name : names) {
            QueryType queryType = WfsFactory.eINSTANCE.createQueryType();
            queryType.setTypeName(Collections.singletonList(name));
            type.getQuery().add(queryType);
        }
        Operation request = new Operation("wfs", service, null, new Object[] { type });
        return request;
    }
View Full Code Here

        data.addFeature(f1);
        data.addFeature(f2);
        FeatureSource<SimpleFeatureType, SimpleFeature> fs = data.getFeatureSource("funnyLabels");
       
        // build the request objects and feed the output format
        GetFeatureType gft = WfsFactory.eINSTANCE.createGetFeatureType();
        Operation op = new Operation("GetFeature", getServiceDescriptor10(), null, new Object[] {gft});
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FeatureCollectionType fct = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fct.getFeature().add(fs.getFeatures());
       
View Full Code Here

    }

    protected void write(FeatureCollectionType featureCollection, OutputStream output,
            Operation getFeature) throws IOException, ServiceException {
        GetLogType request = (GetLogType) getFeature.getParameters()[0];
        GetFeatureType ftRequest = toGetFeatureType(featureCollection, request);

        prepare(ftRequest.getOutputFormat(), featureCollection, ftRequest);
        encode(output, featureCollection, ftRequest);
    }
View Full Code Here

     */
    private GetFeatureType toGetFeatureType(FeatureCollectionType featureCollection,
            GetLogType request) {
        SimpleFeatureCollection features = (SimpleFeatureCollection) featureCollection.getFeature().get(0);
        SimpleFeatureType featureType = features.getSchema();
        GetFeatureType ftRequest = WfsFactory.eINSTANCE.createGetFeatureType();
        QueryType query = WfsFactory.eINSTANCE.createQueryType();
        query.setTypeName(Collections.singletonList(featureType.getTypeName()));
        ftRequest.getQuery().add(query);
        ftRequest.setBaseUrl(request.getBaseUrl());
        ftRequest.setHandle(request.getHandle());
        ftRequest.setMaxFeatures(request.getMaxFeatures());
        ftRequest.setOutputFormat(request.getOutputFormat());
        ftRequest.setResultType(ResultTypeType.RESULTS_LITERAL);
        return ftRequest;
    }
View Full Code Here

    public boolean canHandle(Operation operation) {
        // GetVersionedFeature operation?
        if ("GetVersionedFeature".equalsIgnoreCase(operation.getId())) {
            // also check that the resultType is "results"
            GetFeatureType request = (GetFeatureType) OwsUtils.parameter(
                    operation.getParameters(), GetFeatureType.class);

            if (request.getResultType() == ResultTypeType.RESULTS_LITERAL) {
                return true;
            }
        }

        return false;
View Full Code Here

   
    public boolean canHandle(Operation operation) {
        // GetVersionedFeature operation?
        if ("GetVersionedFeature".equalsIgnoreCase(operation.getId())) {
            // also check that the resultType is "results"
            GetFeatureType request = (GetFeatureType) OwsUtils.parameter(
                    operation.getParameters(), GetFeatureType.class);

            if (request.getResultType() == ResultTypeType.RESULTS_LITERAL) {
                return true;
            }
        }

        return false;
View Full Code Here

        super(WFS.GetFeatureType, GetFeatureType.class, Binding.OVERRIDE);
    }

    @SuppressWarnings("unchecked")
    public void testEncode() throws Exception {
        GetFeatureType getFeature = factory.createGetFeatureType();
        getFeature.setHandle("handle");
        getFeature.setMaxFeatures(BigInteger.valueOf(10));
        getFeature.getQuery().add(factory.createQueryType());
        getFeature.getQuery().add(factory.createQueryType());

        Document dom = encode(getFeature, WFS.GetFeature);
        assertEquals("handle", dom.getDocumentElement().getAttribute("handle"));
        assertEquals("10", dom.getDocumentElement().getAttribute("maxFeatures"));
        assertEquals(2, getElementsByQName(dom, WFS.Query).getLength());
View Full Code Here

TOP

Related Classes of net.opengis.wfs.GetFeatureType

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.