Transform - Geometry: Buffer

The Buffer template appears in the template list when a geometry field, of type geom, geommfd, or geomwkb, has been picked in the Transform pane.    It creates inner and outer buffer zones.



Compute buffer zone geometry given the Distance and Unit of measure specified and save into the specified Result destination, using the geometry type of the destination or choosing geom, geommfd, or geomwkb when saving to a new field or new table.  


Launch the template by choosing a geometry field and then double-clicking the Buffer template.  When the template launches we can specify options.



A positive Distance creates a buffer zone area surrounding points, lines and areas.  A negative Distance writes  NULL geometry for points and lines, and for areas creates a inner buffer zone area that is reduced from the original area boundary by the distance of the buffer.  If the area is so small that the inner buffer zone is reduced to nothing a NULL geometry value is written.


The units of measure provided depend upon the unit of measure used in the geometry field.  For radial coordinate systems (for example, using degrees for units of measure as in Latitude / Longitude) available units will be Arc Minute, Arc Second, Degree, and Radian.  For linear coordinate systems (for example, Pseudo-Mercator), the Unit box will be populated with the long list of linear units Manifold knows.



With the focus on the Objects Drawing window, in the Transform pane we choose the Geom field and then we double-click the Buffer template to launch it in the Transform pane.



In the Buffer template, we enter 5 for the Distance.  Given the Unit setting of Meter, that is a choice of 5 meters.   We leave the Result set to the Same Field, to update the Geom field in place.



The preview shows the buffers that will be created.


The dark "tips" of objects are a summary of rounded edges in the buffer areas as seen in the zoomed-in view below.



Example: Set the size of a buffer with an expression.



We have a drawing that shows springs as points.  



For each spring our table gives the name of the spring plus a field called CFS that gives the flow of water for that spring.  We wish to draw a buffer around each spring where the radius of the buffer for each spring is set by the formula


(3.6 * CFS)/(2 * pi)


With the focus on the map window, we launch the Transform pane.  We choose the Springs drawing layer, the Geom field, and the Buffer template.



We click into the icon in the Distance box and we choose Expression in the pull down menu.   The Expression dialog pops open and  we enter the expression


(3.6 * [CFS])/(2 * pi)


Manifold reserves pi as the name of a constant, 3.141592..., so we can use that instead of writing out pi as a number.   We can enter the name of the field CFS either using square brackets as [CFS] as written above or simply as CFS without brackets.  When field names do not include spaces or otherwise would be ambiguous, the use of square brackets is optional.


In the Expression dialog we press OK to get back to the Transform pane.   We choose Kilometer as the unit of measure, since the expression is designed to produce reasonably-sized buffers when kilometers are the unit of measure.    For the Result we specify a new geometry field, called GeomBuffer, and a new drawing called Springs Buffer based on that geometry field.    That sets up the Transform pane as illustrated above.  


Press Transform.  



The transform creates a new GeomBuffer field in the table, writes buffers to that new field, and then creates a new Springs Buffer drawing using that geometry field.   We drag and drop the new Springs Buffer drawing into our map to create the display above.   Each new buffer area has been sized based on the expression using the CFS field.



To create the display above we used Style to change the fill color of areas in the Springs Buffers drawing to green, and then we set layer opacity of the buffers layer to 30%, to provide a nice, see-through effect.


Tech tip: The Unit box provides a choice of whatever style units, angular or metric, are the units of the coordinate system in use.  We therefore should use a rational coordinate system, for example a metric system, for the Springs drawing and then also ensure that whatever expression we write provides a result scaled to the units, such as kilometers, we plan on using.  




Curvilinear segments - As a practical matter, most people doing GIS will use straight line segments for lines and areas.   Few GIS systems do a good job of supporting curved segments, so there is much less data published using curved segments.   Manifold's ability to work with curved segments allows us to use that data within Manifold in a limited way, at least for display and interactive editing.  


However, most processing tools in Manifold, such as Transform templates and various Geom SQL functions, do their work by first converting a curvilinear segment into a straight line segment between the same two start and finish coordinates.  That will often lead to weird or otherwise unexpected results.  To avoid such problems, first convert curvilinear segments into equivalent constellations of straight line segments at whatever resolution is desired, using the Clean transform template with the convert curves to lines operation option and the number of linear segments desired to approximate the curve in the Curve limit parameter.   See the Curved Segments discussion in the Drawings topic.


See Also

Transform Pane


Transform Reference


Transform - Expression


Transform - Geometry


Example: Flooded Roads - We consider a hypothetical case of a 10 meter rise in sea level in the San Francisco Bay area, and we find what highways and major roads would be flooded by such a rise.   The example uses both raster and vector data sets, combines a number of techniques and uses the Contour, Buffer, Merge, and Clip transform templates.