Package org.geotools.data.wfs.v1_0_0.xml

Examples of org.geotools.data.wfs.v1_0_0.xml.WFSBasicComplexTypes$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

            }

            Iterator actions = transactionRequest.getAllActions().iterator();

            while (actions.hasNext()) {
                Action a = (Action) actions.next();

                switch (a.getType()) {
                case Action.DELETE:
                    elems[3].getType().encode(elems[3], a, output, hints);

                    break;
View Full Code Here

            Map hints) throws IOException, OperationNotSupportedException {
            if (!canEncode(element, value, hints)) {
                return;
            }

            DeleteAction a = (DeleteAction) value;

            AttributesImpl attributes = new AttributesImpl();
            attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
                attrs[1].getName(), null, "string", a.getTypeName());

            output.startElement(element.getNamespace(), element.getName(),
                attributes);

            elems[0].getType().encode(elems[0], a.getFilter(), output, hints);

            output.endElement(element.getNamespace(), element.getName());
        }
View Full Code Here

            ts = new WFSTransactionState(ds);
        } else {
            ts = (WFSTransactionState) trans.getState(ds);
        }

        ts.addAction(getSchema().getTypeName(), new DeleteAction(getSchema().getTypeName(), filter));
       
        // Fire a notification.  I don't know a way of quickly getting the bounds of
        // an arbitrary filter so I'm sending a NULL envelope to say "some features were removed but I don't
        // know what."  Can't be null because the convention states that null is sent on commits only.
        // JE
View Full Code Here

            ts = new WFSTransactionState(ds);
        } else {
            ts = (WFSTransactionState) trans.getState(ds);
        }

        ts.addAction(getSchema().getTypeName(), new DeleteAction(getSchema().getTypeName(), Filter.INCLUDE));
       
        ReferencedEnvelope bounds=null;
        while (reader.hasNext()){

            try {
View Full Code Here

                return;
            }

            output.startElement(element.getNamespace(), element.getName(), null);

            InsertAction a = (InsertAction) value;

            // find element definition
            // should exist when original from a WFS ...
            SimpleFeature f = a.getFeature();
            SimpleFeatureType featureType = f.getFeatureType();
            Name name = featureType.getName();           
            Schema schema = SchemaFactory.getInstance( name.getNamespaceURI() );
            Element[] els = schema.getElements();
            Element e = null;
View Full Code Here

                              bounds.expandToInclude(g.getEnvelopeInternal());
                          }
                      }
                    }
                }
                ts.addAction(schema.getTypeName(), new InsertAction(newFeature));

            } catch (NoSuchElementException e) {
                WFS_1_0_0_DataStore.LOGGER.warning(e.toString());
                throw new IOException(e.toString());
            }
View Full Code Here

                        }else{
                            bounds.expandToInclude(g.getEnvelopeInternal());
                        }
                }
              }
                ts.addAction(getSchema().getTypeName(), new InsertAction(f));
            } catch (NoSuchElementException e) {
                WFS_1_0_0_DataStore.LOGGER.warning(e.toString());
            } catch (IllegalAttributeException e) {
                WFS_1_0_0_DataStore.LOGGER.warning(e.toString());
            }
View Full Code Here

            List<String> newFids = transactionResult.getInsertResult();
            int currentInsertIndex = 0;
            for (Iterator<Action> iter2 = actions.iterator(); iter2.hasNext();) {
                Action action = iter2.next();
                if (action instanceof InsertAction) {
                    InsertAction insertAction = (InsertAction) action;
                    if (currentInsertIndex >= newFids.size()) {
                        Logging.getLogger("org.geotools.data.wfs").severe(
                                "Expected more fids to be returned by " + "TransactionResponse!");
                        break;
                    }
                    String tempFid = insertAction.getFeature().getID();
                    String finalFid = newFids.get(currentInsertIndex);
                   
                    ds.addFidMapping(tempFid, finalFid);
                    currentInsertIndex++;
                }
View Full Code Here

TOP

Related Classes of org.geotools.data.wfs.v1_0_0.xml.WFSBasicComplexTypes$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.