Package net.opengis.wfs

Examples of net.opengis.wfs.GetFeatureType


//          visitor.getSha1SyncFilterFunction().getFeatureSha1s();
//        }
     
        if(getFeature.getParameters()[0] instanceof GetFeatureType) {
            // get the query for this featureCollection
            GetFeatureType request = OwsUtils.parameter(getFeature.getParameters(),
                    GetFeatureType.class);
            QueryType queryType = (QueryType) request.getQuery().get(0);
            if(queryType.getFunction().size()>0) {
                Function syncFunction = (Function) queryType.getFunction().get(0);
                List<FeatureCollection> filtered = new ArrayList<FeatureCollection>();
                FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
                Filter f = ff.equal(ff.literal("true"), syncFunction, false);
View Full Code Here


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

                // may have multiple type names in each query, so add them all
View Full Code Here

        // the 'response' object we'll pass to our OutputFormat
        FeatureCollectionType features = WfsFactory.eINSTANCE.createFeatureCollectionType();

        // the 'request' object we'll pass to our OutputFormat
        GetFeatureType gfreq = WfsFactory.eINSTANCE.createGetFeatureType();
        gfreq.setBaseUrl(fInfoReq.getBaseUrl());

        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);
                }
            }
            gfreq.getQuery().add(qt);

        }

        // this is a dummy wrapper around our 'request' object so that the new Dispatcher will
        // accept it.
View Full Code Here

        // the 'response' object we'll pass to our OutputFormat
        FeatureCollectionType features = WfsFactory.eINSTANCE.createFeatureCollectionType();

        // the 'request' object we'll pass to our OutputFormat
        GetFeatureType gfreq = WfsFactory.eINSTANCE.createGetFeatureType();
        gfreq.setBaseUrl(fInfoReq.getBaseUrl());
       
        for (int i=0; i < results.getFeature().size(); i++) {
           
            FeatureCollection fc = (FeatureCollection) results.getFeature().get(i);
            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 '"
                                    + srsName + "'", e);
                }
            }
            gfreq.getQuery().add(qt);

        }

        // this is a dummy wrapper around our 'request' object so that the new Dispatcher will
        // accept it.
View Full Code Here

        assertEquals("acme:bar", data.getResources().get(1));
    }
   
    @Test
    public void testWFSGetFeature() throws Exception {
        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);
       
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        GetFeatureType getFeature = wfsfactory.createGetFeatureType();

        //lt;xsd:element maxOccurs="unbounded" ref="wfs:Query"/&gt;
        getFeature.getQuery().addAll(node.getChildValues(QueryType.class));

        //&lt;xsd:attribute default="results" name="resultType"
        //      type="wfs:ResultTypeType" use="optional"&gt;
        if (node.hasAttribute("resultType")) {
            getFeature.setResultType((ResultTypeType) node.getAttributeValue("resultType"));
        }

        //&lt;xsd:attribute default="text/xml; subtype=gml/3.1.1"
        //    name="outputFormat" type="xsd:string" use="optional"&gt;
        if (node.hasAttribute("outputFormat")) {
            getFeature.setOutputFormat((String) node.getAttributeValue("outputFormat"));
        }

        //&lt;xsd:attribute name="maxFeatures" type="xsd:positiveInteger" use="optional"&gt;
        if (node.hasAttribute("maxFeatures")) {
            getFeature.setMaxFeatures((BigInteger) node.getAttributeValue("maxFeatures"));
        }

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

        //&lt;xsd:attribute name="traverseXlinkExpiry"
        //    type="xsd:positiveInteger" use="optional"&gt;
        if (node.hasAttribute("traverseXlinkExpiry")) {
            getFeature.setTraverseXlinkExpiry((BigInteger) node.getAttributeValue(
                    "traverseXlinkExpiry"));
        }

        return getFeature;
    }
View Full Code Here

        // 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

    /**
     * @see WFSGetFeatureOutputFormat#getMimeType(Object, Operation)
     */
    public String getMimeType(Object value, Operation operation) throws ServiceException {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);

        OgrFormat format = formats.get(request.getOutputFormat());
        if (format == null) {
            throw new WFSException("Unknown output format " + request.getOutputFormat());
        } else if (format.singleFile && request.getQuery().size() <= 1) {
            if(format.mimeType != null) {
                return format.mimeType;
            } else {
                // use a default binary blob
                return "application/octet-stream";
View Full Code Here

        }
    }
   
    @Override
    public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);

        OgrFormat format = formats.get(request.getOutputFormat());
        if (format == null) {
            throw new WFSException("Unknown output format " + request.getOutputFormat());
        } else if (!format.singleFile || request.getQuery().size() > 1) {
            String outputFileName = ((QName) ((QueryType) request.getQuery().get(0)).getTypeName()
                    .get(0)).getLocalPart();
            return (String[][]) new String[][] { { "Content-Disposition",
                    "attachment; filename=" + outputFileName + ".zip" } };
        } else {
            return null;
View Full Code Here

    @Override
    protected void write(FeatureCollectionType featureCollection, OutputStream output,
            Operation getFeature) throws IOException, ServiceException {

        // figure out which output format we're going to generate
        GetFeatureType gft = (GetFeatureType) getFeature.getParameters()[0];
        OgrFormat format = formats.get(gft.getOutputFormat());
        if (format == null)
            throw new WFSException("Unknown output format " + gft.getOutputFormat());

        // create the first temp directory, used for dumping gs generated
        // content
        File tempGS = org.geoserver.data.util.IOUtils.createTempDirectory("ogrtmpin");
        File tempOGR = org.geoserver.data.util.IOUtils.createTempDirectory("ogrtmpout");
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.