In ILWIS, Buffer operation is used to compute the area around a geometry within a given distance from a feature in a point, segment or polygon coverage. The result of the operation is always an area or multi-areas depending on the input feature coverage and the given distance. The operation can be used with positive and negative value of buffer distance which also referred to as erosion and dilation respectively. Buffers generated with a positive value of buffer distance always contain the input Geometry while buffers with a negative value of buffer distance are always contained within the input Geometry (Figure 2 and 3). A negative buffer of a segment or point results in an empty Geometry. The operation computes buffer areas with line end cap styles supported by program including round, butt and square.
Since the exact buffer outline of a geometry usually contains circular sections, the buffer has to be approximated by the linear geometry. This is done by specifying the number of quadrant segments used to approximate a quarter-circle. Larger number results in a better approximation to the actual area, meaning larger number of line segments in the computed polygon. The number of segments of 8 gives less than a 2% maximum error in the distance of the computed curve approximation to the actual buffer curve. This error can be reduced to less than 1% by using a value of 12 or higher.
The Buffer operation can be applied via ILWIS-Python editor or via ILWIS Main window, Toolbar and the Operatins tab. The required Python syntax is:
name of the output buffer coverage = ilwis.Engine.do(name of the operation, name of input feature coverage, a value for buffer distance, a value for the quadrant segments, select a style for style)
Then, the Python syntax for the above mentioned operation is:
output buffer coverage =ilwis.Engine.do("buffer", “file:///C:/my director/my input coverage", buffer distance, quadrant segments, "end cap style")
In general, the URL used in the Python syntax can be replaced with variable name created via using Python. For example: you can open a raster coverage or a georeference as variables and give them a name as the following:
rc = ilwis.FeatureCoverage("file:///C:/my director/my feature coverage.mpa")
Once the variable is created via ILWIS-Python editor, then it can be used directly in Python syntax without quotation mark and the path as the following:
output buffer coverage=ilwis.Engine.do("buffer", rc , 500, 16, “round”)
Where the name of the operation and the style for end cap are in string type as it is shown in the Python syntax above.