geos-0.2.2: Bindings for GEOS.

Maintainerpfrance@gmail.com
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Geos.Buffer

Description

Functions to compute the buffer of a geometry, for both positive and negative buffer distances.

In GIS, the positive (or negative) buffer of a geometry is defined as the Minkowski sum (or difference) of the geometry with a circle with radius equal to the absolute value of the buffer distance. In the CAD/CAM world buffers are known as offset curves. In morphological analysis the operation of positive and negative buffering is referred to as erosion and dilation.

The buffer operation always returns a polygonal result. The negative or zero-distance buffer of lines and points is always an empty Polygon.

Since true buffer curves may contain circular arcs, computed buffer polygons can only be approximations to the true geometry. The user can control the accuracy of the curve approximation by specifying the number of linear segments with which to approximate a curve.

Synopsis

Documentation

buffer :: Geometry a -> Double -> BufferParams -> Some Geometry Source #

Returns a Geometry that represents all points whose distance from this geometry is less than or equal to the given width.

data BufferParams Source #

Constructors

BufferParams 

Fields

  • joinStyle :: BufferJoinStyle
     
  • capStyle :: BufferCapStyle
     
  • mitreLimit :: Double
     
  • quadrantSegments :: Int

    Sets the number of line segments used to approximate an angle fillet.

    • If quadrantSegments >= 1, joins are round, and quadrantSegments indicates the number of segments to use to approximate a quarter-circle.
    • If quadrantSegments = 0, joins are bevelled (flat)
    • If quadrantSegments < 0, joins are mitred, and the value of qs indicates the mitre ration limit as: mitreLimit = |quadrantSegments|

    For round joins, quadrantSegments determines the maximum error in the approximation to the true buffer curve.

    The default value of 8 gives less than 2% max error in the buffer distance.

    For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).

  • singleSided :: Bool

    Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line.

    The side used is determined by the sign of the buffer distance:

    • a positive distance indicates the left-hand side
    • a negative distance indicates the right-hand side The single-sided buffer of point geometries is the same as the regular buffer.

    The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of FlatCap.

data BufferCapStyle Source #

Constructors

RoundCap

the usual round end caps

SquareCap

end caps are truncated flat at the line ends

FlatCap

end caps are squared off at the buffer distance beyond the line ends