Database Reference
In-Depth Information
THEN
ST_Multi(ST_Intersection(r1.the_geom,r2.the_geom))ELSE
ST_CollectionExtract(ST_Intersection(r1.the_geom,r2.the_geom),
1)
END AS the_geom
FROM chp03.rivers r1
JOIN chp03.rivers r2
ON ST_Intersects(r1.the_geom,
r2.the_geom)
WHERE r1.gid != r2.gid
) AS only_multipoints_geometries;
6. You may see the difference between the two processes, counting the total
number of points in each of the generated tables, as follows:
postgis_cookbook=# SELECT
SUM(ST_NPoints(the_geom)) FROM
chp03.intersections_simple; --2268 points
per 1444 records
postgis_cookbook=# SELECT
SUM(ST_NPoints(the_geom)) FROM
chp03.intersections_all; --2282 points
per 1448 records
7. Inthefollowingscreenshot(takenfromQGIS),youmaynoticethegenerated
intersectionswithbothapproaches.Inthecaseofthe intersection_all
layer, you will notice that some more intersections have been computed (in
red).
Search WWH ::




Custom Search