I'm trying to create a buffer around more than one
LineString feature at a time with geoserver 2.8.x. and openlayers 3. Currently, i can create a buffer around a single line feature with the following GML
<?xml version="1.0" encoding="UTF-8"?> <wps:Execute version="1.0.0" service="WPS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wps/1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:wcs="http://www.opengis.net/wcs/1.1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"> <ows:Identifier>JTS:buffer</ows:Identifier> <wps:DataInputs> <wps:Input> <ows:Identifier>geom</ows:Identifier> <wps:Data> <wps:ComplexData mimeType="text/xml; subtype=gml/3.1.1"> <gml:LineString> <gml:posList>0.0 0.0 10.0 0.0 10.0 10.0</gml:posList> </gml:LineString> </wps:ComplexData> </wps:Data> </wps:Input> <wps:Input> <ows:Identifier>distance</ows:Identifier> <wps:Data> <wps:LiteralData>2</wps:LiteralData> </wps:Data> </wps:Input> </wps:DataInputs> <wps:ResponseForm> <wps:RawDataOutput mimeType="text/xml; subtype=gml/3.1.1"> <ows:Identifier>result</ows:Identifier> </wps:RawDataOutput> </wps:ResponseForm> </wps:Execute>
How can i extend this GML to buffer more than one
LineString feature at a time?
Technically we could accomplish the same thing using a
GeometryCollection, but this approach doesn't seem to work well when the vertices of a set of
LineStrings in the data are spatially coincident, forming a closed sub component similar to a polygon. The result is that you get a buffer around those shapes, but for some reason, you also get the interior of that 'closed polygon' as part of the result, which would make it impossible to perform further geoprocessing like
contains accurately on the result of that buffer.
In the image below, the green layer is the result of buffering the brown
LineString features using a
GeometryCollection. It shows in certain areas where the
LineStrings are closed off that the interior of the closed area is added to the result when it really should have been ignored by the WPS/JTS buffer function