-
Notifications
You must be signed in to change notification settings - Fork 1
geos_buffer
Geometric functions > geos_buffer
- geos_buffer(geometry_data_item, buffer_distance, nrPointsInCircle)
geos_buffer(geometry_data_item, buffer_distance, nrPointsInCircle) creates a buffer polygon for each entry of the geometry_data_item, choosing the appropriate buffering at run-time from the composition of the first argument:
- polygon composition - behaves as geos_buffer_multi_polygon
- arc composition - behaves as geos_buffer_linestring
- multipoint composition - behaves as geos_buffer_multi_point
The result is always a polygon data item with the same domain unit as the geometry_data_item. Use geos_buffer when you want a single buffering operator that adapts to the geometry it is given; use the specific geos_buffer_* operators when you want to fix the interpretation.
Since GeoDMS 20.22.0 an arc without points, as a null shape record or a selection easily gives, results in an empty polygon, as an empty polygon argument already did. Before, such an arc crashed the application with an access violation.
The buffer_distance is a Float64 value that specifies the radius of the buffer in the units of the coordinate system of the geometry_data_item.
The nrPointsInCircle is a UInt8 value that specifies the number of points used to approximate the circle. A higher value results in a smoother buffer but increases computation time. The minimum value is 3.
For a polygon, nrPointsInCircle is given to geos as it is, and geos takes it as the number of segments per quarter circle: each rounded corner of a polygon gets nrPointsInCircle segments, so a square buffered with 16 gets about 68 points. This differs from the point and arc buffers, where nrPointsInCircle is the number of points of a full circle, and from the bg_ family. The difference is kept because existing models are calibrated on it; to get a polygon buffer with the corners of a point buffer of n points per circle, pass n / 4.
The geos_ prefix of the function name indicates that the implementation of the operator uses geos.
- attribute geometry_data_item with a point value type and arc, polygon or multipoint composition
- parameter buffer_distance with a Float64 value type
- parameter nrPointsInCircle with a UInt8 value type
- The composition of the geometry_data_item must be arc, polygon or multipoint; any other composition raises an error.
- buffer_distance must be a positive value.
- nrPointsInCircle must be at least 3.
20.2.0
// arc geometry -> linestring buffer
attribute<fpoint> road_buffer (road) := geos_buffer(road/geometry, 50.0, 8b);
// polygon geometry -> polygon buffer
attribute<fpoint> district_buffer (district) := geos_buffer(district/geometry, 25.0, 16b);
// multipoint geometry -> per-point buffer
attribute<fpoint> station_buffer (city) := geos_buffer(city/stations, 100.0, 16b);
- geos_buffer_multi_polygon
- geos_buffer_linestring
- geos_buffer_multi_point
- geos_buffer_point
- minkowski_sum - a buffer is the Minkowski sum with a disc; use minkowski_sum when the kernel is a specific or anisotropic shape rather than a circle
- minkowski_difference
- Composition
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.