May 2017
Beginner to intermediate
328 pages
7h 17m
English
In contrast to crossing and overlapping, containing means a geometry must be completely covered by the reference geometry, and no point may be located outside. To test this, two functions are provided: ST_Within and ST_Contains. The only difference is the order of arguments.
First, we will use the ST_Within function to determine how many water bodies are within the boundaries of Rybnik (which literally means fish pond in Czech, by the way):
SELECT name,wkb_geometry FROM multipolygons WHERE "natural"='water' AND ST_Within(wkb_geometry, (SELECT wkb_geometry FROM multipolygons WHERE name='Rybnik' AND admin_level='7'));

Read now
Unlock full access