Using the Libraries Control Bar to create a Spatial Filter based on an existing one
Using an overlay Spatial Filter
Clearing an overlay Spatial Filter
A Spatial Filter is a region used to include or exclude items based on their positions and geometry relative to the Spatial Filter.
Spatial Filters can be created from any item on an editable or hittable overlay. A Spatial Filter can be used once, or saved as a named object in a library for future use. You use the Libraries Control Bar to inspect and amend stored Spatial Filters.
You can choose from a number of tests for the Spatial Filter to apply. For instance, if the Spatial Filter is based on a Polygon item or closed LineString item, it could exclude all items which lie outside it; if it were based on an open LineString item, it could include only those items which intersect with it; or if based on a point item, it could include only those items which contain it.
Once created, a Spatial Filter can be used for the following purposes:
Select the Find items that... pass or fail as required.
Click on ... the filter... drop-down box arrow and select the filter to apply to items in the SWD.
Filter types:
Class Filter - uses each item’s class to decide whether it is included or not. The possible classes are LineString, Point, Polygon etc.
Compound Filter - can be used to speed up a Property Filter. You can use a different Property Filter filter for each item class.
Feature Filter - uses each item's feature code to decide whether it is included or not.
Property Filter - this is the most general type of filter. Using this filter type you could in theory do the job of all the other filter types. But the drawbacks of this filter type are that it is more complicated to use, and will probably operate slower than the other specialised filters.
A Spatial Filter applied to an overlay stays in force until it is explicitly cleared.
If you want to create a new Spatial Filter using a graphical item which has not been the basis of a Spatial Filter before, you must use Spatial Filter [Create-Miscellaneous].
Alternatively, construct an item to use for the Spatial Filter. If this is the sole purpose of the item, it may be better to place it on a separate overlay from other data.
If you want to save it for future use, check the Save Spatial Filter as tickbox, and enter a name. The Spatial Filter will be stored in the current library.
There are two variables:
- Test to apply - this is the geometric test the Spatial Filter will apply. See Spatial Filter tests below.
- Component of item to test - drop-down box to select the geometry component that the Spatial Filter will compare against - their extents, their geometry, or their origin.
Items will be displayed only if they pass both components of this test. In the above example, the Spatial Filter must contain an item’s geometry for it to be displayed/selected.
The geometry of the test item is always used, the component to test (geometry, extents, or origin) applies to the candidate items.
Like all Named Objects, a Spatial Filter can be copied into another editable library, and the new copy renamed and its properties changed. There are of course no Spatial Filters in the (standard) library, but once you have created Spatial Filters in your own libraries, you can use this method to create other new Spatial Filters. See Named Object Libraries (NOLs).
The Spatial Filter has the options detailed below. There are some exceptions, marked with *
Spatial Filter options
Test to apply | Component of item to test | Description | |
---|---|---|---|
*Contain | Extent | retains items where extent is contained by the spatial filter. | |
*Cross | Extent | retains items where extent is contained or crossed by the spatial filter. | |
*Cross by | Extent | retains items where extent is crossed by the spatial filter. | |
*Disjoint | Extent | retains items where their extents are not contained by the spatial filter. | |
*Equal | Extent | the geometry of the test item cannot equal the extents of a candidate item, except in the following case: where the test item is rectangular and aligned with the axes, and the candidate extents are the same as the rectangle. | |
*Intersect | Extent | retains items where their extents are intersected by the spatial filter (LineString items where not touching the spatial filter but extents are). | |
*Overlap | Extent | extents are entirely overlapping spatial filter. | |
*Touch | Extent | extents are touching outer rim of the spatial filter. Extents are not inside or overlapping. | |
*Within | Extent | retains those items for whom the spatial filter is wholly within their extents. | |
*Contain | Geometry | retains those items which are contained by the spatial filter. | |
*Cross | Geometry | retains those items which are crossed by the spatial filter as well as those contained by the spatial filter. | |
*Cross by | Geometry | retains those items which are crossed by the spatial filter but not those contained by the spatial filter. | |
*Disjoint | Geometry | retains those items which are not crossed by the spatial filter or those contained by the spatial filter. | |
*Equal | Geometry | retains only those items which are equal to the spatial filter in area and location. | |
*Intersect | Geometry | retains those items which intersect the spatial filter. | |
*Overlap | Geometry | retains those items which overlap the spatial filter. | |
*Touch | Geometry | retains those items which touch the spatial filter but do not overlap. | |
*Within | Geometry | retains those items which are wholly within the spatial filter. | |
*Contain | Origin | retains Point/LineString/Polygon items which are contained by the spatial filter. | |
*Cross | Origin | retains Point/LineString/Polygon items for which their origins are contained by the spatial filter. | |
*Cross by | Origin | The candidate item (a point) does not go outside the test item (the polygon), except where the test item is rectangular and aligned. | |
*Disjoint | Origin | retains items where their origins are not contained by the spatial filter. | |
*Equal | Origin | the geometry of the test item cannot equal the origin of a candidate item, except in the following case: where the test item is rectangular and aligned with the axes, and the candidate extents are the same as the rectangle. | |
*Intersect | Origin | retains origins within or intersecting. | |
*Overlap | Origin | the test item (the polygon) contains the candidate item (a point). | |
*Touch | Origin | retains items where origin touches the spatial filter but does not overlap. | |
*Within | Origin | the test item (the polygon) is not inside the candidate item (a point). |
The following tables describe the spatial tests used in SIS.
For example, in the first row, you have selected the rectangular Polygon item, and you want to find the square Polygon item which lies inside it. You can use the Contain, Cross and Intersect tests. In these tables, the double arrow (?) at the top of a column indicates that the test item is also returned in the results. So, if you use Contain or Intersect, the test item (a rectangle in this example) is returned.
In this table, the selected item is a Polygon item, and the tests are looking for Polygon items.
In this table, the selected item is a Polygon item, and the tests are looking for LineString items.
In this table, the selected item is a Polygon item, and the tests are looking for Point items.
In this table, the selected item is a LineString item, and the tests are looking for LineString items.
In this table, the selected item is a LineString item, and the tests are looking for Polygon items.
In this table, the selected item is a LineString item, and the tests are looking for Point items.
In this table, the selected item is a Point item, and the tests are looking for Polygon items.
In this table, the selected item is a Point item, and the tests are looking for LineString items.
In this table, the selected item is a Point item, and the tests are looking for Point items.
As you progress through Spatial Filter [Create-Miscellaneous] it prompts you for the overlays to apply the Spatial Filter to. However, if you want to use an existing Spatial Filter on different overlays, follow these steps.
the Spatial Test may be viewed from the Spatial Filter drop-down box:
On the selected overlay, only those items which pass the chosen Spatial Filter are displayed.
Once applied to an overlay, a Spatial Filter stays in force until you clear it. There are two ways you can do this:
Find [Home-Selection] allows you to use an existing Spatial Filter, either on its own or in combination with a filter and/or expression, to select certain items in the map window and not others.
All items found are highlighted in the map window, and the number found (total number and number of editable items) is shown on the status bar. If you cannot see the selected items, pan and/or zoom until you can, or use Selection [Home-Zoom]. The Flicker selection option (User interface and Commands tab of the Options... dialog) may be useful here, as it highlights selected items by making them appear to flicker.
If you set an expression and/or a filter as well as the Spatial Filter, items are selected only if they pass the Spatial Filter test plus the expression and/or Filter. See Creating Filters and expressions.
In the Libraries Control Bar you can inspect all libraries currently in use, and their properties.
Using the Spatial Filter local menu, you can rename the Spatial Filter:
or use the Properties... command to see and change details of the test it applies.
Click to return to www.cadcorp.com
© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).