doc

advertisement
Buffering in GIS
BYLINE
Nagapramod Mandagere, Graduate Student, University of Minnesota
SYNONYMS
Buffer Management, Buffering Operations
DEFINITION
A buffer is a region of memory used to temporarily hold output or input data. In case of
GIS, the units of buffering are points, lines and polygons. Buffer operation refers the
creation of a zone of a specified width around a point or a line or a polygon area. It is also
referred to as a zone of specified distance around coverage features. There are two types
of buffers, namely – constant width buffers and variable width buffers. Both types can be
generated for a set of coverage features based on each features attribute values. These
zones or buffers can be used in queries to determine which entities occur either within or
outside the defined buffer zone. Analogous to buffering in raster GIS is distance analysis.
In practical situations one needs to buffer multiple regions (points, lines and polygons)
simultaneously. This gives rise to the idea of buffer allocation and replacement. Data
movement happens by making use of primitive buffer operations such as point buffer
operation, line buffer operation and polygon buffer operations. Buffer management
involves the process of allocation of buffers and replacement of buffers when not needed.
Several allocation policies and replacement policies that have been used in the context of
memory buffers in computer science are directly applicable here.
HISTORICAL BACKGROUND
[500 or fewer words describing when/why the concept or technique developed]
SCIENTIFIC FUNDAMENTALS
Let us start with the primitive buffer operations. In GIS, we can differentiate these
primitives into point buffering operations, line buffering operations and polygon
buffering operations.
Buffer operations:
Buffering points:
A point is the basic unit of resolution in any GIS system. Buffering point data
involves creation of a circular polygon about the point of interest. The radius of this
circular polygon is called the buffer distance. In this scheme the buffer distance or the
radius of the circle could be fixed for all points in a layer or the user could specify it. If
multiple points in the same layer are being buffered, then buffer distances of each point
are either specified in an attribute table or a look up table. If one is buffering multiple
points in the same layer, then the buffering algorithms check for overlaps in each point’s
buffer and remove the overlapping sections. The figure below illustrates the concept of
removal of overlaps when multiple points are being buffered.
C
A
B
Figure 1. Point Buffering with overlap removed
If multiple point buffers intersect or overlap, then the system takes all the
overlapping polygons and combines then into one or more polygons that represent a
layer. This process of removal of overlapping sections involves the use of intersection
and dissolves. In the example illustrated above, polygons 1,2 and 3 describe the layer
with four points of interest. The point to note here is that now one needs to also keep
track as to whether a polygon lies within the buffer zone or outside a buffer zone. For this
purpose, the system maintains a table of constituent polygons and their corresponding
attribute (inside or outside) per layer. The table below shows the mapping for layer
considered in the above example.
Polygon
A
B
C
Inside
1
0
1
Buffering Lines:
Buffering of lines is a little more complicated than buffering point data. This is
complicated even more due to the fact that lines can be made up of multiple segments.
Line segments are handled independently of each other. Consider the example given
below. Here we can see two line segments. First let us consider L1 with end points
(E1,N1) and (E2,N2). Using these coordinates one can calculate dx and dy between the
two end points. Now, we can represent two parallel lines at a distance of m (buffer
distance) from L1 using the sine and cosine components of line L1 along with m, the
buffer distance.
(E2,N2)
L1
(E1,N1)
Figure 2. Line Buffering
After determining the two parallel line segments, we can now process the next
line segment in a similar way. Next, we perform a line intersection test to eliminate
common regions or overlapping regions. Finally, we add the bounds to the parallel
buffers by capping the start point and end point of the line with half circular polygons of
radius m. The next task is to look for overlaps between line buffers. For instance, if we
have multiple lines being buffered, each composed of multiple line segments. Again, the
same process used for point buffers is applied. As a result we get one or more polygons
representing a layer. The figure below illustrates the same along with the concept of
polygon table. Here polygon 1 is inside the buffer zone and polygon 2 is outside of the
buffer zone.
1
2
Figure 3. Line buffering with overlap removed
Buffering Polygons:
Buffering of polygonal surfaces uses most of the same concepts used for line
buffering. The only significant change is that the polygon buffer is created on only one
side of the line that defines the polygon. In case of polygon buffering two options are
available, namely – an outside polygon which surrounds/contains the polygonal surface
under consideration or an inside polygon that is contained inside the polygonal surface
under consideration. The figure below illustrates the concept of polygonal buffering.
Outer Polygon
Inner Polygon
Figure 4. Polygon Buffering
Buffer Management:
Buffer Allocation:
Buffer or memory is often a limited shared resource. Often need arises to buffer multiple
regions such as points, lines or polygons simultaneously. Multiple applications or streams
share common buffers. Buffer allocation involves the process of segmenting or dividing
these buffer regions amongst competing applications or processes. Different allocation
schemes have been proposed in computer science. Most of them can be readily applied to
GIS with minimal modifications. One could perform static allocation or dynamic on
demand allocation of buffers. Dynamic allocation is more complex to implement but
more resilient to changes. Buffer regions could be strictly partitioned between competing
processes or a global buffering scheme could be used.
Buffer Replacement:
Buffer is a limited region of memory. Since the data set size is larger than the buffer size,
the need arises to replace existing data in order to accommodate new data. This process is
referred to as buffer replacement. A number of buffer replacement algorithms that have
been proposed in computer science are directly applicable here. Some of the most popular
algorithms include, Not Recently Used (NRU), Least Recently Used (LRU), Clock
Algorithm, Second Chance, Working Set, First In First Out (FIFO), Last In First Out
(LIFO) and Aging.
Not Recently Used (NRU) page replacement algorithm favors keeping pages that
have been recently used. When a page is referenced, a referenced bit will be set for that
page, marking it as referenced. Similarly, when a page is modified (written to), a
modified bit will be set. The setting of the bits is usually done by the hardware, software
implementations are possible as well. At a certain preset interval, the clock interrupt
triggers and clears the referenced bit of all the pages, so only pages referenced within the
current clock interval are marked with a referenced bit. When a buffer slot needs to be
freed, the system divides the pages into different categories and identifies the buffer slot
to free or evict.
First In First Out (FIFO) page replacement algorithm is a very low-overhead
algorithm that requires little bookkeeping. As the name suggests - the system keeps track
of all the buffered regions in the buffer in a queue, with the most recent arrival at the
back, and the earliest arrival in front. When a region needs to be replaced, the region at
the front of the queue is selected. This scheme is cheap and intuitive but it performs
relatively badly in practical application. It suffers from a common problem called
Belady’s Anamoly (performance may not improve with increase in buffer size).
Second chance page replacement algorithm is a variant of FIFO. It performs
relatively better than FIFO. It works by looking at the front of the queue as FIFO does,
but instead of immediately swapping out that region, it checks to see if its referenced bit
is set. If it is not set, the region is swapped out. Otherwise, the referenced bit is cleared,
and the region is inserted at the back of the queue, as if it were a new region, and this
process is repeated. If all the regions have their referenced bit set, on the second
encounter of the first region in the list, that region will be swapped out, as it now has its
referenced bit cleared.
LRU keeps track of buffer region usage over a short period of time. LRU works
on the idea that the regions which have been most heavily used in the past few queries
will be used heavily in the next few queries too. It provides near-optimal performance but
is expensive to implement in practice. Different implementation techniques have been
proposed to reduce overhead of LRU. The most expensive method is the linked list
method, whereby there is a linked list containing all the regions in memory. At the back
of this list is the least recently used region, and at the front is the most recently used
region. The cost of this implementation lies in the fact that items in the list will have to be
moved about every memory reference (expensive operation). Another mechanism uses
hardware support. The hardware provides 64-bit counter that is incremented at every
query. Whenever a region is accessed, it gains a value equal to the counter at the time of
access. Whenever a region needs to be replaced, the algorithm simply picks out the
region that has the lowest counter, and swaps it out.
Aging algorithm works by incrementing the counters of regions referenced,
putting equal emphasis on region references regardless of the time, the reference counter
on a page is first shifted right, before adding the referenced bit to the left of that binary
number. In do so region references closer to the present have more impact than region
references long ago. This ensures that regions referenced more recently, though less
frequently referenced, will have higher priority over regions more frequently referenced
in the past. Thus, when a region needs to be swapped out, one with lowest counter will be
chosen.
Out of these LRU and its variants are the most popular algorithms. In case of GIS
applications FIFO might make more sense if there if little repeatability of buffer regions.
The choice of buffer replacement algorithm completely depends on the application for
which it is being used.
Pre-fetching of Buffers:
In certain situations one could predict buffer access patterns. For instance if the GIS
application is working over a specific region of the map, one could think of buffering all
polygons that are adjacent to the polygon under consideration. This works like a look
ahead of a pre-fetch mechanism. This pre-fetching can often lead to huge performance
improvement in terms of response times for queries. Another mechanism that uses prefetching uses the application knowledge pre-fetch relevant regions. Specifically,
application can predict its own access pattern and inform the system to pre-fetch certain
regions. Again based on the application domain different pre-fetching schemes are used.
KEY APPLICATIONS
In this section first we consider real world examples where buffering of point, line or
polygons are used. Next, we explore applications of various schemes which make use of
buffer operations.
Consider the following scenario for point buffering. University of Minnesota
wants to make sure that every inch of the main campus is covered by the wireless
network. The university has deployed a large number of wireless access points at various
points on campus. Now, the goal is to find if the wireless network covers all points in the
map shown. For the buffer distance lets assume that the wireless range of each access
point is 500m. Now, lets apply the concept of point buffering for the wireless access
points with a buffer distance of 500m. Next step is to remove overlaps. Now the region
that does not fall under the resultant buffer polygon(s) are the regions that do not have
any wireless network coverage.
Next, let us look at a real world application of line buffering. Consider a huge
ship. The boundary of the ship can be modeled as a set of line segments. The owners of
the ship want to know if all the deck areas near the edges of have been water proofed. For
this example, let us say that only deck areas within a distance of 50 feet from any edge
need to be water proofed. Now, by applying line buffering to all line segments that form
the exterior of the ship with a buffer distance of 50 feet, we obtain a polygonal area that
needs to be water proofed. By checking if all area under this polygon for water proofing
the owner achieves his/her goal.
Now, let us look at a real world application of polygonal buffering. Consider a
scenario where the university is hosting a special event and hence is planning to create a
few make shift parking spots around the campus. Now, a few rules which need to be
followed are, no vehicle can be parked with in 50 feet of any campus building and all
parking spots need to be off road parking. We can model this situation by buffering
polygons around each campus building with a buffer distance of 50 feet. Here we make
use of outer polygonal buffering. After eliminating the overlaps, all areas that do not fall
under the resultant buffer polygon(s) are free for parking.
FUTURE DIRECTIONS
CROSS REFERENCES
[Other topics in the Encyclopedia which may be of interest to the reader of this entry]
RECOMMENDED READING
[1] Tutorials on Topics in GIS:
http://www.sli.unimelb.edu.au/gisweb/BuffersModule/BuffSelect.htm
[2] Glossary and definition of key terms in GIS: http://en.mimi.hu/gis/buffer.html
TEMPLATE FOR DEFINITIONAL ENTRY
TITLE
BYLINE
[Name of expert writing the entry, expert’s affiliation]
SYNONYMS
[Entry title and up to four additional synonyms]
DEFINITION
[250 or fewer words defining the entry title]
MAIN TEXT
[250 words outlining the key points]
CROSS REFERENCES
[Listing of related entries, e.g. Remote Sensing, Spatial Data Quality, etc.]
REFERENCES*
[An optional list of 1-3 citations that give the reader a place to find more information]
Download