1

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?

EDIT

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 intersects or 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

Buffer result includes the interior of any closed areas when using a GeometryCollection

  • could you convert to a multilinestring? – Ian Turton Jul 29 '16 at 9:18
  • @iant, do you mean convert the features to a multilinestring before buffering, or just the NodeName in the GML? – goonerify Jul 29 '16 at 14:41
  • I mean convert all the lines to a single multiline – Ian Turton Jul 29 '16 at 14:41
2

You cannot, the process only takes one geometry. You'll first have to write a new process that can buffer multiple geometries in input (or modify the existing one)

  • Technically you could 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 shape similar to a closed 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 intersect or contains on the result of that buffer – goonerify Jul 28 '16 at 19:38

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.