Guest User

Untitled

a guest
Jul 5th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. CREATE TYPE region_distance AS (boundary_gid integer, distance double precision);
  3.  
  4. CREATE OR REPLACE FUNCTION nt_compute_boundary_distances ( geometry ) RETURNS setof region_distance AS $$
  5. DECLARE
  6. BEGIN
  7.     RETURN QUERY select Q.gid, sum(dist) from
  8.         (select gid, length(transform(intersection(the_geom, $1),27500)) as dist
  9.             from boundary_p_v2 where intersects(the_geom, $1) is true ) Q
  10.                 group by gid;
  11. END;
  12. $$
  13. LANGUAGE 'plpgsql';
Add Comment
Please, Sign In to add comment