![]() ![]() Var bufferedFeatures = geojsonFormat.read(JSON.stringify(bufferedLayerGeoJSON)) GeoJSON to array of OpenLayers features Var bufferedLayerGeoJSON = turf.buffer(selectionLayerGeoJSON, 10, 'kilometers') 10 km buffering via turf.buffer() method SelectionLayerGeoJSON = JSON.parse(selectionLayerGeoJSON) Var selectionLayerGeoJSON = geojsonFormat.write(selectionLayer.features) Here is a code example : var geojsonFormat = new () Turf uses any GeoJSON data in WGS84 (EPSG:4326). You can use the buffer() method of turf.js. Note that this approach will work with any backend map server that supports the OGC WPS specification. The result from this request would be a WKT encoding of a polygon that is the 50m buffer of the input polyline. Add feature to map and do any other processing.Capture buffer distance from user input.Capture polyline from user input (as WKT or GML).The output from the process is the generated buffer geometry and that can be requested in a number of formats, all of which can be read by OpenLayers. Quadrant Segments: Effectively the quality of the generated buffer.Distance: Specified in the same units as the geometry.Input Geometry: In a range of formats such as WKT, GML.The JTS:buffer process takes the following parameters: In my opinion the JTS:buffer process is most like what you have mocked up using MapInfo. The default installation of GeoServer's WPS extension contains a number of different processes that can be run including several for buffering: If you have access to GeoServer then you can achieve what you need through the WPS extension of GeoServer ( Web Processing Service). There is an example of doing a buffer operation with OpenLayers which you could adapt to your own needs. There is a pure JavaScript port of the Java Topology Suite called JSTS which contains (amongst many other things) a buffer operation. The approach you take will depend on whether you want the processing overhead on the client or on the server (or even if you have access to a backend server like GeoServer). There are 2 ways you could approach this server side or client side. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |