A spatial SQL allows users to make selections or carry out other SQL functionality based on how objects are spatially related to each other. Such as where object as lines ‘cross’ each other. If an object is ‘inside’ another such as a node in a zone, or ‘contains’, where the zone contains incidents say. Finally if an object is at a ‘distance’ from other.
The spatial SQL when executed works on all the ‘Object Type’ specified. However it is possible to run two queries to make a spatial selection query on a selection if you can spare a user number field on the table with the selection.
The two queries in a group should be as follows:
The first should set user number 1 (or another user number) to 1 for the selection and 0 otherwise With:
SET user_number_1 = 0;
UPDATE SELECTED SET user_number_1 = 1;
The second uses the spatial stuff with a network layer e.g.