Operations: Buffer

From ILWIS
Jump to: navigation, search
Main Page Arrow.png Operations
Buffer
Buffer operation

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.

Figure 1, Buffer operation form


To start the Buffer operation from ILWIS main window:

Mar.jpg
  • Click the Operation tab on toolbar tabs
  • From the opened operation list select Buffer

Once the Buffer operation is selected from the list, an operation form will be opened in which you can set parameters required for the operation including input(s), output(s), memory location and data format (Figure 1).
To successfully execute this operation, you need to complete the form with proper inputs data. The inputs data must be dragged from the catalog and dropped in their corresponding fields in the form.

input coverage: Enter an input feature coverage; use drag and drop.
buffer distance: Type a value for buffer distance from which area around a geometry will be computed.
quadrant segment: Type a value to be used to approximate a quarter-circle of the buffer. Larger number results in a better approximation to the actual area. A value between 8 to 24 is recommended.
end cap style: Select a style for the end of the buffer cap. The available options are:
  • Round; produce end caps that are round.
  • Butt; generate end caps that are truncated flat at the line ends
  • Square; results in end caps that are squared off at the buffer distance beyond the line ends
output buffer coverage: Type a name for the output feature coverage.
Output format: Select a format from the list to save the output raster map. The default format is Memory; if you select it, the output will be temporally saved in the internal catalog and will be removed when you exit the program. If you select other format, the output will be saved in the active catalog.
Execute: Click the execute button to run this operation.
Results

Figure 2 and 3 shows the results of the buffer operation using positive and negative values of buffer distance that applied to a segment and polygon coverage, respectively. Note that the output polygon maps in Fig. 2 and Fig. 3 include the input maps to provide a better visual interpretation of the results while in the original ILWIS output files, they are not present.

Figure 2, Buffer operation applied to a segment coverage using a positive value of buffer distance. On this Figure, the input segment map is on the right followed by the generated buffer around the segment.
Figure 3, Buffer operation applied to a polygon coverage using a nagative value of buffer distance. On this Figure, the input polygon map is on the right followed by the generated buffer within the polygon.