Instead of pointing at the polygons or specifying a search condition based on the user-defined attributes, we can also select polygons within a specified area.

 

 

 

 

 

Select polygons within an area.

NOTE:  To use the area which was used to create the screenshots as follows, centre map at (288577,740339) and use a scale of 1:800. 

1. Pick the MapQuery > By User Defined Area ... menu item.

2. Click on Yes button  to indicate that you want to select the features wholly or partially overlapping the area you are going to define.

2. When the name is highlighted, click the left mouse button to confirm.

3. Use the crosshair to draw the outline of the area. Click on the right mouse button to close. The polygon will be highlighted for your confirmation. Click on the left mouse button to confirm.

(288577,740339), 1:800

4. The parcels within the polygon will be retrieved from the database.

5. Colour fill the parcels selected.

 

Search for polygons overlapping an irregular area.

In the database, we keep a record for each polygon. The structure of each record is rather involved, but in essence it provides information about the theme to which the polygon belongs, the arcs forming its outline, its area, its perimeter, its key, and so on.

A method of searching for polygons overlapping a user-defined area, called a window, is as follows.

1. For each polygon in the database retrieve its outline.

2. If the polygon is entirely within the window, then they overlap.

3. If any side of the polygon intersects any side of the window, then they also overlap.

This method involves a considerable number of geometrical tests on intersections - the vectors on the outline of each polygon will be checked against the vectors on the outline of the window. Although the mathematics involved is not very complicated, the number of intersection tests to be performed could be prohibitively large.

One way of reducing the number of intersection tests is to first check whether the bounding rectangle of the polygon overlaps with that of the window. A bounding rectangle is one bounding a feature, and it can be defined by two diagonal points, one from the smallest x and y coordinates, and the other from the largest x and y coordinates of the feature.

If the bounding rectangle of a polygon is outside that of the window, then they certainly do not overlap. If the two bounding rectangles cross each other, then we need to invoke the intersection test to ascertain whether they overlap. If one bounding rectangle is entirely within another, then we still need to invoke the intersection test because it is possible that they do not overlap at all, as shown in the following diagram.

Each bounding rectangle is composed of just four vectors. This greatly reduces the number of intersection tests required to find out whether the bounding rectangles are overlapping or disjoint.

The bounding rectangles are so useful for solving this and similar problems that they are computed by the GIS and stored as system-defined attributes for the features.