Point of intersection

Objective of this request :

       Calculate intersection points in a layer of linear objects (here an hydrographic network -> HydrographyNetwork_Line)

SQL Instruction :

        -- An intermediate layer is created with a name of alias.

       select register('explose');

       -- We use the function called "explode" to decompose multilines.

       create table explose as select STO_explode() from HydrographyNetwork_Line;

       -- We create a new intermediate layer.

       select register('intersection');

       -- We calculate the intersection of every stream included in the layer.

       create table intersection as select ST_intersection(a.the_geom, b.the_geom) as the_geom from explose a, explose b where ST_intersects(a.the_geom, b.the_geom);

       -- We create a new intermediate layer.

       select register('points');

       -- Here, we filter the data to delete the doubloons of points and geometry

       create table points as select distinct the_geom from intersection where ST_dimension(the_geom) = 0;

Result :



(drag & drop the new layer in the TOC to see it)

Copyright - IRSTV - 2009 - www.orbisgis.org