1

I'm trying to create a contour as vector layer using this example: http://boundlessgeo.com/2013/01/chaining-rendering-transformations-in-geoserver/. My setup is GeoServer v2.5.3 and gwt-openlayers. When I create the contour as WMS layer, the layer shows OK with correct contour lines, but when I create the same layer as WFS layer, the layer only shows the original points used for the barnessurface.

Is my assumption correct it should be possible to create the contour layer as real vectors/features and how can I accomplish this? Or is it only possible to create the contours as WMS layer?

Here is a code section for the two layers. WMS shows correct contours, WFS only displays the points:

        WMSParams wmsParams = new WMSParams();
        // wmsParams.setFormat("format");
        wmsParams.setLayers("ws:values");
        wmsParams.setFormat("image/png");
        wmsParams.setTransparent(true);

        WMSOptions wmsLayerParams = new WMSOptions();
        wmsLayerParams.setUntiled();
        wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE);
        wmsLayerParams.setSingleTile(false);

        String wmsUrl = "http://localhost:8080/geoserver/gwc/service/wms";
        WMS wmsLayer = new WMS("WMS contour", wmsUrl, wmsParams, wmsLayerParams);
        wmsLayer.setIsBaseLayer(false);
        wmsLayer.setIsVisible(false);
        map.addLayer(wmsLayer);

        // now set style (seems like can't be done before layer is added to
        // map)

        wmsLayer.getParams().setStyles("contours");

        WFSProtocolOptions wfsProtocolOptions = new WFSProtocolOptions();
        wfsProtocolOptions.setUrl("http://local3:8080/geoserver/ws_geotax/wfs");
        wfsProtocolOptions.setFeatureType("values");
        wfsProtocolOptions.setGeometryName("GEOMETRIE");

        WFSProtocol wfsProtocol = new WFSProtocol(wfsProtocolOptions);

        VectorOptions vectorOptions = new VectorOptions();
        vectorOptions.setProtocol(wfsProtocol);
        vectorOptions.setStrategies(new Strategy[] { new BBoxStrategy() });
        vectorOptions.setStyle(new Style("contours"));

        Vector wfsLayer = new Vector("WFS contour", vectorOptions);
        map.addLayer(wfsLayer); 
1

That is not an error. The data are points also for WMS but the advanced SLD with transformations creates a visual presentation with contour lines on-a-fly.

The purpose of WFS is to deliver data as they are natively and therefore you are getting points. Data processing like generating contours from points is something for Web Processing Service (WPS). Read this tutorial about that http://suite.opengeo.org/4.1/processing/contour/static.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.