It is possible to carry out spatial searches using the SPATIAL keyword, or between any two network layers or between a network layer and a background network layer or GIS layer as outlined below:
Select Layer Type:
When searching using a background network layer or GIS layer, the layer must be loaded in the GeoPlan View.
When searching using a spatial rain layer, the results of the simulation must be loaded in the the GeoPlan View.
The layer is then referred to in the query as spatial.
Click on the image below to show an example which uses GIS data to find damaged concrete pipes at least 300 mm in diameter that lie within 2 metres of a minor road.
Example
GIS Search Example
For example:
|
This query will:
|
The combinations of geometry and search type listed in the table below are valid.
Spatial Search Type |
Search Type Description |
Geometry |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Cross |
Searches for network objects which intersect a layer line or polygon area. |
|
||||||||||
Inside |
Searches for network objects inside a layer polygon. |
|
||||||||||
Contains |
Searches for network polygons with layer objects inside the polygon. |
|
||||||||||
Distance |
Searches for network objects within a search Distance of a layer line or polygon area. |
|
||||||||||
Nearest |
Searches for nearest network object within a specified Distance. If there is more than one object within the specified distance, the first one found is returned as the result. |
|
The main advantage of using the SPATIAL keyword for spatial searches is that it allows a mixture of lines in the SQL block, some of which use the spatial search and some of which don’t.
The possible forms the clauses setting up the spatial search may take are:
The Geometry Types are:
Of these, Distance and Nearest require the distance field, the others must not have it.
The Distance field can be a numeric constant or a scalar variable.
The Layer Type can be:
The layer name must be a string in quotes for GIS and a table name (not in quotes, optionally enclosed by [ ] if it is a single word without spaces, or compulsorily enclosed by [ ] if it isn’t) for the other types.
This works in the way as the other controls on the SQL dialog i.e. the options specified in the combo boxes and text box serves as the initial spatial configuration until it is changed by a SPATIAL statement.
Any SPATIAL clause only remains in force until the end of the block containing it i.e. if it is within an IF / ELSE / ELSEIF block then it ceases to have any effect at the end of that block, if it is in a WHILE block it ceases to have any effect at the end of that block. It remains in force in any new IF / WHILE blocks contained within that block.