July 2010
Intermediate to advanced
840 pages
16h 33m
English
Although polygons are not actually part of graph theory, this chapter seemed to be the reasonable place to put this section, since it is also related to spatial queries. A polygon can be described as a set of corner points in an (x, y) coordinate system. The usual query is to tell whether a given point is inside or outside of the polygon.
This algorithm is due to Darel R. Finley. Its main advantage is that it can be done in Standard SQL without trigonometry functions. Its disadvantage is that it does not work for concave polygons. The workaround is to dissect the convex polygons into concave polygons, then add a column for the name of the original area.
-- set up polygon, with any ordering of the corners CREATE TABLE ...
Read now
Unlock full access