Package net.opengis.wfs20

Examples of net.opengis.wfs20.FeatureCollectionType


            //create new feature collections
            List<FeatureCollectionType> members = new ArrayList(features.size());
            for (Iterator<FeatureCollection> it = features.iterator(); it.hasNext(); ) {
                FeatureCollection featureCollection = it.next();
               
                FeatureCollectionType member = Wfs20Factory.eINSTANCE.createFeatureCollectionType();
                member.setTimeStamp((Calendar) EMFUtils.get(fc, "timeStamp"));
                member.getMember().add(featureCollection);
                members.add(member);

                if (numberMatched == -1) {
                    continue;
                }

                //TODO: calling size() here is bad because it requires a nother trip to the
                //underlying datastore... perhaps try to keep count of the size of each feature
                // collection at a higher level
                int size = featureCollection.size();
               
                member.setNumberReturned(BigInteger.valueOf(size));

                if (it.hasNext()) {
                    numberMatched -= size;
                    member.setNumberMatched(BigInteger.valueOf(size));
                }
                else {
                    member.setNumberMatched(BigInteger.valueOf(numberMatched));
                }
            }
            return members;
        }
       
View Full Code Here


        getFeature.setResolve(request.getResolve());
        getFeature.setResolveDepth(request.getResolveDepth());
        getFeature.setResolveTimeout(request.getResolveTimeout());
        getFeature.setCount(request.getCount());

        FeatureCollectionType fc = (FeatureCollectionType) delegate.run(
                GetFeatureRequest.adapt(getFeature)).getAdaptee();

        QueryType query = (QueryType) request.getAbstractQueryExpression();
        QName typeName = (QName) query.getTypeNames().iterator().next();
        FeatureTypeInfo featureType = catalog.getFeatureTypeByName(typeName.getNamespaceURI(),
                typeName.getLocalPart());

        try {

            PropertyName propertyName = filterFactory.property(request.getValueReference(),
                    getNamespaceSupport());
            PropertyName propertyNameNoIndexes = filterFactory.property(request.getValueReference()
                    .replaceAll("\\[.*\\]", ""), getNamespaceSupport());
            AttributeDescriptor descriptor = (AttributeDescriptor) propertyNameNoIndexes
                    .evaluate(featureType.getFeatureType());
            if (descriptor == null) {
                throw new WFSException(request, "No such attribute: " + request.getValueReference());
            }

            // create value collection type from feature collection
            ValueCollectionType vc = Wfs20Factory.eINSTANCE.createValueCollectionType();
            vc.setTimeStamp(fc.getTimeStamp());
            vc.setNumberMatched(fc.getNumberMatched());
            vc.setNumberReturned(fc.getNumberReturned());
            vc.getMember().add(new PropertyValueCollection(fc.getMember().iterator().next(), descriptor, propertyName));
            return vc;
        } catch (IOException e) {
            throw new WFSException(request, e);
        }
    }
View Full Code Here

        net.opengis.wfs20.WFSCapabilitiesType caps = (WFSCapabilitiesType) capabilities
                .getParsedCapabilities();
        this.capabilities = caps;

        typeInfos.clear();
        FeatureTypeListType featureTypeList = this.capabilities.getFeatureTypeList();

        @SuppressWarnings("unchecked")
        List<FeatureTypeType> featureTypes = featureTypeList.getFeatureType();

        for (FeatureTypeType typeInfo : featureTypes) {
            QName name = typeInfo.getName();
            typeInfos.put(name, typeInfo);
        }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetFeatureTypeList(FeatureTypeListType newFeatureTypeList, NotificationChain msgs) {
        FeatureTypeListType oldFeatureTypeList = featureTypeList;
        featureTypeList = newFeatureTypeList;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wfs20Package.WFS_CAPABILITIES_TYPE__FEATURE_TYPE_LIST, oldFeatureTypeList, newFeatureTypeList);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

    /**
     * @see org.geotools.data.wfs.internal.WFSStrategy#getFeatureTypeInfo(javax.xml.namespace.QName)
     */
    @Override
    public FeatureTypeInfo getFeatureTypeInfo(QName typeName) {
        FeatureTypeType eType = typeInfos.get(typeName);
        if (null == eType) {
            throw new IllegalArgumentException("Type name not found: " + typeName);
        }
        return new FeatureTypeInfoImpl(eType);
    }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetFeaturesLocked(FeaturesLockedType newFeaturesLocked, NotificationChain msgs) {
        FeaturesLockedType oldFeaturesLocked = featuresLocked;
        featuresLocked = newFeaturesLocked;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wfs20Package.LOCK_FEATURE_RESPONSE_TYPE__FEATURES_LOCKED, oldFeaturesLocked, newFeaturesLocked);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetFeaturesNotLocked(FeaturesNotLockedType newFeaturesNotLocked, NotificationChain msgs) {
        FeaturesNotLockedType oldFeaturesNotLocked = featuresNotLocked;
        featuresNotLocked = newFeaturesNotLocked;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wfs20Package.LOCK_FEATURE_RESPONSE_TYPE__FEATURES_NOT_LOCKED, oldFeaturesNotLocked, newFeaturesNotLocked);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

            "<GetCapabilities service='WFS' xmlns='http://www.opengis.net/wfs/2.0' " +
                "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " +
                "xsi:schemaLocation='http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd'/>";
        buildDocument(xml);
       
        GetCapabilitiesType gc = (GetCapabilitiesType) parse();
        assertNotNull(gc);
    }
View Full Code Here

        "   </wfs:Query> " +
        "</wfs:GetFeature> ";
       
        buildDocument(xml);
       
        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        assertEquals(new URI("epsg:4326"), q.getSrsName());
        assertEquals(1, q.getTypeNames().size());
        assertEquals(
View Full Code Here

            "      </fes:Filter> " +
            "   </wfs:Query> " +
            "</wfs:GetFeature> ";
        buildDocument(xml);
       
        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(BigInteger.valueOf(100), gf.getCount());
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);

        assertNotNull(q.getFilter());
        assertEquals(3, q.getPropertyNames().size());
       
View Full Code Here

TOP

Related Classes of net.opengis.wfs20.FeatureCollectionType

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.