Package net.opengis.wfs

Examples of net.opengis.wfs.QueryType


        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);
                if(queryType.getFunction().size()>0) {
                    syncFunction = (Function) queryType.getFunction().get(0);
                }

                // 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());
                    FeatureTypeInfo meta = catalog.getFeatureTypeByName(featureTypeName);

                    if (meta == null) {
View Full Code Here


        for (Iterator i = results.getFeature().iterator(); i.hasNext();) {
            FeatureCollection fc = (FeatureCollection) i.next();
            features.getFeature().add(fc);

            QueryType qt = WfsFactory.eINSTANCE.createQueryType();
            String crs = GML2EncodingUtils.epsgCode(fc.getSchema().getCoordinateReferenceSystem());
            if (crs != null) {
                final String srsName = "EPSG:" + crs;
                try {
                    qt.setSrsName(new URI(srsName));
                } catch (URISyntaxException e) {
                    throw new ServiceException(
                        "Unable to determite coordinate system for featureType " +
                            fc.getSchema().getName() + ".  Schema told us '" + srsName + "'", e);
                }
View Full Code Here

            Name name = FeatureCollectionDecorator.getName(fc);
            QName qname = new QName(name.getNamespaceURI(), name.getLocalPart());
                     
            features.getFeature().add(fc);

            QueryType qt = WfsFactory.eINSTANCE.createQueryType();
                       
            qt.setTypeName(Collections.singletonList(qname));
           
            String crs = GML2EncodingUtils.epsgCode(fc.getSchema().getCoordinateReferenceSystem());
            if (crs != null) {
                final String srsName = "EPSG:" + crs;
                try {
                    qt.setSrsName(new URI(srsName));
                   
                } catch (URISyntaxException e) {
                    throw new ServiceException(
                            "Unable to determite coordinate system for featureType "
                                    + fc.getSchema().getName().getLocalPart() + ".  Schema told us '"
View Full Code Here

        GetFeatureType gf = WfsFactory.eINSTANCE.createGetFeatureType();
        org.opengis.filter.Filter f1 =
                parseFilter("BBOX(the_geom, 40, -90, 45, -60)");
        org.opengis.filter.Filter f2 =
                parseFilter("BBOX(the_geom, 5988504.35,851278.90, 7585113.55,1950872.01)");
        QueryType q = WfsFactory.eINSTANCE.createQueryType();
        q.setTypeName(Arrays.asList(new QName("http://acme.org", "foo", "acme")));
        q.setFilter(f1);
        gf.getQuery().add(q);
       
        q = WfsFactory.eINSTANCE.createQueryType();
        q.setTypeName(Arrays.asList(new QName("http://acme.org", "bar", "acme")));
        gf.getQuery().add(q);getClass();
        q.setFilter(f2);
       
        Operation op = op("GetFeature", "WFS", "1.0.0", gf);
        callback.operationDispatched(new Request(), op);
       
        assertEquals("acme:foo", data.getResources().get(0));
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        QueryType query = wfsfactory.createQueryType();

        //&lt;xsd:choice maxOccurs="unbounded" minOccurs="0"&gt;
        //&lt;xsd:element ref="wfs:PropertyName"&gt;
        if (node.hasChild("PropertyName")) {
            //HACK, stripping of namespace prefix
            for (Iterator p = node.getChildValues("PropertyName").iterator(); p.hasNext();) {
                Object property = p.next();
                String propertyName;
                if(property instanceof String)
                    propertyName = (String) property;
                else
                    propertyName = (String) ((PropertyName) property).getPropertyName();

                if (propertyName.indexOf(':') != -1) {
                    propertyName = propertyName.substring(propertyName.indexOf(':') + 1);
                }

                query.getPropertyName().add(propertyName);
            }
        }

        //&lt;xsd:element ref="ogc:Function"&gt;
        if (node.hasChild("Function")) {
            query.getFunction().add(node.getChildValues("Function"));
        }

        //&lt;/xsd:choice&gt;

        //&lt;xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter"&gt;
        if (node.hasChild(Filter.class)) {
            query.setFilter((Filter) node.getChildValue(Filter.class));
        }

        //&lt;xsd:element maxOccurs="1" minOccurs="0" ref="ogc:SortBy"&gt;
        if (node.hasChild(SortBy[].class)) {
            SortBy[] sortBy = (SortBy[]) node.getChildValue(SortBy[].class);

            for (int i = 0; i < sortBy.length; i++)
                query.getSortBy().add(sortBy[i]);
        }

        //&lt;xsd:attribute name="handle" type="xsd:string" use="optional"&gt;
        if (node.hasAttribute("handle")) {
            query.setHandle((String) node.getAttributeValue("handle"));
        }

        //&lt;xsd:attribute name="typeName" type="wfs:TypeNameListType" use="required"&gt;
        query.setTypeName((List) node.getAttributeValue("typeName"));

        //&lt;xsd:attribute name="featureVersion" type="xsd:string" use="optional"&gt;
        if (node.hasAttribute("featureVersion")) {
            query.setFeatureVersion((String) node.getAttributeValue("featureVersion"));
        }

        //&lt;xsd:attribute name="srsName" type="xsd:anyURI" use="optional"&gt;
        if (node.hasAttribute("srsName")) {
            query.setSrsName((URI) node.getAttributeValue("srsName"));
        }
       
        if ( node.hasChild( "XlinkPropertyName" ) ) {
            query.getXlinkPropertyName().addAll( node.getChildValues( "XlinkPropertyName" ));   
        }
       
        return query;
    }
View Full Code Here

        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());
                    FeatureTypeInfo meta = catalog.getFeatureTypeByName(featureTypeName);
                   
                    if (meta == null) {
View Full Code Here

            return request.getHandle();
        }
       
        StringBuffer sb = new StringBuffer();
        for (Iterator f = request.getQuery().iterator(); f.hasNext();) {
            QueryType query = (QueryType) f.next();
            sb.append(getLayerName(query) + "_");
        }       
        sb.setLength(sb.length() - 1);
        LOGGER.log(Level.FINE,"Using layer names for file name: "+sb.toString());
        if (sb.length() > 20) {
View Full Code Here

     * @return
     */
    private String[] getLayerNames(Iterator it) {
        List<String> names = new ArrayList<String>();
        while (it.hasNext()) {
            QueryType query = (QueryType) it.next();
            names.add(getLayerName(query).toUpperCase());
        }

        return names.toArray(new String[] {});
    }
View Full Code Here

TOP

Related Classes of net.opengis.wfs.QueryType

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.