Including GIS data in SQL queries

You can include data in GIS layers in your SQL queries.

To include GIS data:

  1. Select the GIS layer in the GIS Layer box.

    The GIS layer must be loaded in the GeoPlan window. The layer is then referred to in the query as gislayer.

  2. Optionally, select the field in the GIS Field box.

    Tip: It is more flexible to use the syntax shown Closedin the example below where the field name is included in the query - gislayer.STRUCTURE

  3. Choose the GIS Search Type.

    The search types are described below.

    Now you can use the GIS fields in the query in exactly the same way as network object fields

The example below uses GIS data to find damaged concrete pipes at least 300mm in diameter that lie within 2 metres of a minor road.

ClosedShow GIS search example

GIS Search Example

Sequence of operations

Note: If both GIS select options and object type select options are defined in the query, the GIS search is carried out first. The main query using object type criteria is then carried out on the results of the GIS search.

For example:

  • This query will search for any pipes crossing any object in the layer 'Roads'.
  • From the set of objects found in step 1, pipes with a width greater than 200 will be selected.

GIS search type and geometry

The combinations of geometry and search type listed in the table below are valid.

Notes:

GIS search type Search type description InfoWorks WS Pro geometry GIS geometry

Cross

Searches for network objects which intersect a GIS layer line or polygon area

Line

Line

Polygon

Polygon

Line

Polygon

Inside

Searches for network objects inside a GIS layer polygon

Point

Polygon

Line

Polygon

Polygon

Polygon

Contains

Searches for network polygons with GIS objects inside the polygon.

Polygon

Point

Line

Polygon

Distance

Searches for network objects within a Search Distance of a GIS layer line or polygon area

Point

Point

Line

Polygon

Line

Point

Line

Polygon

Polygon

Point

Line

Polygon


SQL and stored queries