Package net.opengis.wfs

Examples of net.opengis.wfs.GetFeatureType


        // it's part of the constructor, just need to hook it up.
        Writer outWriter = new BufferedWriter(
            new OutputStreamWriter(output,wfs.getGeoServer().getGlobal().getCharset()));
       
        // let's check if a callback has been set
        GetFeatureType gft = (GetFeatureType) getFeature.getParameters()[0];
        String callback = (String) gft.getFormatOptions().get("CALLBACK");
        if(callback != null && !"".equals(callback)) {
            outWriter.write(callback + "(");
        }

        GeoJSONBuilder jsonWriter = new GeoJSONBuilder(outWriter);
View Full Code Here


        return "text/csv";
    }
   
    @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 + ".csv" }
            };
    }
View Full Code Here

     * @return
     * @throws Exception
     */
    Object handleAsInternalWFS(ProcessParameterIO ppio, InputReferenceType ref) throws Exception {
        WebFeatureService wfs = (WebFeatureService) context.getBean("wfsServiceTarget");
        GetFeatureType gft = null;
        if (ref.getMethod() == MethodType.POST_LITERAL) {
            gft = (GetFeatureType) ref.getBody();
        } else {
            GetFeatureKvpRequestReader reader = (GetFeatureKvpRequestReader) context
                    .getBean("getFeatureKvpReader");
View Full Code Here

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

    public String[][] getHeaders(Object value, Operation operation) throws ServiceException {
        SimpleFeatureCollection fc = (SimpleFeatureCollection) ((FeatureCollectionType) value).getFeature().get(0);
        FeatureTypeInfo ftInfo = catalog.getFeatureTypeByName(fc.getSchema().getName());

        String filename = null;
        GetFeatureType request = OwsUtils
                .parameter(operation.getParameters(), GetFeatureType.class);
        if (request != null) {
            Map<String, ?> formatOptions = request.getFormatOptions();
            filename = (String) formatOptions.get("FILENAME");
        }
        if (filename == null) {
            filename = new FileNameSource(getClass()).getZipName(ftInfo);
        }
View Full Code Here

     * @return the found charset, or the platform's default one if none was specified
     */
    private Charset getShapefileCharset(Operation getFeature) {
        Charset result = null;
       
        GetFeatureType gft = (GetFeatureType) getFeature.getParameters()[0];
        if(gft.getFormatOptions() != null && gft.getFormatOptions().get("CHARSET") != null) {
           result = (Charset) gft.getFormatOptions().get("CHARSET");
        } else {
            final String charsetName = GeoServerExtensions.getProperty(GS_SHAPEFILE_CHARSET, applicationContext);
            if(charsetName != null)
                result = Charset.forName(charsetName);
        }
View Full Code Here

        if (dft != null) {
            qualifyTypeNames(dft.getTypeName(), workspace, ns);
            return;
        }
       
        GetFeatureType gf =
            (GetFeatureType) OwsUtils.parameter(operation.getParameters(), GetFeatureType.class);
        if (gf != null) {
            for (QueryType q : (List<QueryType>)gf.getQuery()) {
                qualifyTypeNames(q.getTypeName(), workspace, ns);
            }
            return;
        }
       
View Full Code Here

        FeatureCollectionResponse mockResult =
            FeatureCollectionResponse.adapt(WfsFactory.eINSTANCE.createFeatureCollectionType());
        mockResult.getFeature().add(getFeatureSource(ALL_DOTS).getFeatures(Filter.INCLUDE));

        GetFeatureType mockRequest = WfsFactory.eINSTANCE.createGetFeatureType();

        Operation mockOperation = new Operation("GetFeature", getServiceDescriptor10(), null,
                new Object[] { mockRequest });

        assertEquals("All_Types_Dots.zip",  zip.getAttachmentFileName(mockResult, mockOperation));

        mockRequest.getFormatOptions().put("FILENAME", "REQUEST_SUPPLIED_FILENAME.zip");

        assertEquals("REQUEST_SUPPLIED_FILENAME.zip",  zip.getAttachmentFileName(mockResult, mockOperation));

    }
View Full Code Here

        data.addFeature(f2);
        data.addFeature(f3);
        SimpleFeatureSource fs = data.getFeatureSource("funnyLabels");
       
        // build the request objects and feed the output format
        GetFeatureType gft = WfsFactory.eINSTANCE.createGetFeatureType();
        Operation op = new Operation("GetFeature", getServiceDescriptor10(), null, new Object[] {gft});
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        FeatureCollectionResponse fct =
            FeatureCollectionResponse.adapt(WfsFactory.eINSTANCE.createFeatureCollectionType());
        fct.getFeature().add(fs.getFeatures());
View Full Code Here

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

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.