Buffer

Creates a zone at a set distance around a layer.

type: buffertoolbarstable

What it does

A buffer answers "within how far?" Examples: 500 m from a station, 50 m from a watercourse, or 1 km from a route. Choose a layer and a distance. The result is a new polygon layer.

The distance is on the ground, in metres, not in degrees, and not in screen pixels. A degree of longitude is 111 km at the equator and 55 km at 60°N, so a buffer measured in degrees would be a different size in every part of the map. That would make the result wrong.

The result is an ordinary layer: it appears in the legend, it can be restyled, it can be exported, and it can be the input to the next thing you do.

Using it

  1. Open the tool, choose the layer to buffer, and give a distance in metres.
  2. Calculate. The zone appears as a new layer on the map.
  3. Run it again to replace the previous result rather than piling up copies.

What goes in depends on how the layer is stored. A GeoJSON layer contributes every feature. A vector-tile layer contributes only what is drawn in the current view, at the current zoom, after filters. Zooming out and running it again can give a different answer.

Worked example: a buffer of five real countries, generated by running the operation, so it shows the geometry and the attributes that actually come back.

Points, lines, and polygons all buffer, which is unusual. Most operations are fussier. The geometry matrix records that combination by combination, each cell one real run.

In your own map

Add buffer to a toolbar. It works on whatever layers the map has.

The heavy lifting is GDAL compiled to WebAssembly, loaded on first use. A visitor who never opens the tool never downloads it.

Extending it

Buffer uses the same spatial worker as Analysis. If you need more than a distance, such as clip, overlay or dissolve, use Analysis. Buffer is also available there.

Config typebuffer
Element<webmapx-buffer-tool>
Placementtoolbar
Sourcesrc/components/webmapx-buffer-tool.ts
Teststests/geoprocessing.test.ts
Relatedgeoprocessing, measure, draw