Package net.opengis.wfs

Examples of net.opengis.wfs.GetFeatureType


    /**
     * Checks that the resultType is of type "hits".
     */
    public boolean canHandle(Operation operation) {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);

        return (request != null) && (request.getResultType() == ResultTypeType.HITS_LITERAL);
    }
View Full Code Here


         return "application/msexcel";
    }
   
    @Override
    public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);
        String outputFileName = ((QName) ((QueryType) request.getQuery().get(0)).getTypeName().get(0))
            .getLocalPart();
        return (String[][]) new String[][] {
                { "Content-Disposition", "attachment; filename=" + outputFileName + ".xls" }
            };
    }
View Full Code Here

            querySet(eObject, "featureVersion",
                Collections.singletonList((String) kvp.get("featureVersion")));
        }
       
        if(kvp.containsKey("format_options")) {
            GetFeatureType gft = (GetFeatureType) eObject;
            gft.getFormatOptions().putAll((Map) kvp.get("format_options"));
        }

        return request;
    }
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.iterator(); i.hasNext();) {
            FeatureCollection<SimpleFeatureType, SimpleFeature> 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().getTypeName() + ".  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.
        Service serviceDesc = new Service("wms", null, null, Collections.EMPTY_LIST);
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

        return "application/zip";
    }
   
    @Override
    public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);
        String outputFileName = ((QName) ((QueryType) request.getQuery().get(0)).getTypeName().get(0))
            .getLocalPart();
        return (String[][]) new String[][] {
                { "Content-Disposition", "attachment; filename=" + outputFileName + ".zip" }
            };
    }
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

     *
     * @param operation
     * @return
     */
    public String getExtension(Operation operation) {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);

        String outputFormat = request.getOutputFormat().toUpperCase();
        // DXF
        if (outputFormat.equals("DXF"))
            return "dxf";
        // DXF-ZIP
        return "zip";
View Full Code Here

     * If the handle attribute is defined on the GetFeature tag it
     * will be used, else the name is obtained concatenating lauer names
     * with underscore as a separator (up to a maximum name length).
     */
    private String getFileName(Operation operation) {
        GetFeatureType request = (GetFeatureType) OwsUtils.parameter(operation.getParameters(),
                GetFeatureType.class);
       
        if (request.getHandle() != null) {
            LOGGER.log(Level.FINE,"Using handle for file name: "+request.getHandle());
            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());
View Full Code Here

            ZipEntry entry = new ZipEntry(getFileName(operation) + ".dxf");
            zipStream.putNextEntry(entry);
            w = new BufferedWriter(new OutputStreamWriter(zipStream));
        }
        // extract format_options (GET mode)
        GetFeatureType gft = (GetFeatureType) operation.getParameters()[0];
        String version = (String) gft.getFormatOptions().get("VERSION");
        String blocks = (String) gft.getFormatOptions().get("ASBLOCKS");
        String colors = (String) gft.getFormatOptions().get("COLORS");
        String ltypes = (String) gft.getFormatOptions().get("LTYPES");
        String layerNames = (String) gft.getFormatOptions().get("LAYERS");
        LOGGER.log(Level.FINE,"Format options: "+version+"; "+blocks+"; "+colors+"; "+ltypes+"; "+layerNames);
        // get a suitable DXFWriter, for the requested version (null -> get any writer)
        DXFWriter dxfWriter = DXFWriterFinder.getWriter(version, w);
       
        if (dxfWriter != null) {
            LOGGER.log(Level.INFO,"DXFWriter: "+dxfWriter.getDescription());
            String[] layers = null;
            if(layerNames!=null)
                layers=layerNames.toUpperCase().split(",");
            else
                layers=getLayerNames(gft.getQuery().iterator());
            LOGGER.log(Level.FINE,"Layers names: "+StringUtils.join(layers,","));
            dxfWriter.setOption("layers", layers);
            if (blocks != null && blocks.toLowerCase().equals("true"))
                dxfWriter.setOption("geometryasblock", true);
            // set optional colors
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.