Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TYPE region_distance AS (boundary_gid integer, distance double precision);
- CREATE OR REPLACE FUNCTION nt_compute_boundary_distances ( geometry ) RETURNS setof region_distance AS $$
- DECLARE
- BEGIN
- RETURN QUERY select Q.gid, sum(dist) from
- (select gid, length(transform(intersection(the_geom, $1),27500)) as dist
- from boundary_p_v2 where intersects(the_geom, $1) is true ) Q
- group by gid;
- END;
- $$
- LANGUAGE 'plpgsql';
Add Comment
Please, Sign In to add comment