Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sdhoek/sleepmap
Browse files Browse the repository at this point in the history
  • Loading branch information
emacgillavry committed Dec 20, 2018
2 parents 5129b62 + dc99c55 commit f032085
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion database/create_isovist_function.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
CREATE OR REPLACE FUNCTION ISOVIST(
IN center geometry,
IN polygons geometry[],
IN radius numeric DEFAULT 150,
IN rays integer DEFAULT 36,
IN heading integer DEFAULT -999,
IN fov integer DEFAULT 360
)
RETURNS geometry AS $$
DECLARE
arc numeric;
angle_0 numeric;
geomout geometry;
BEGIN
arc := fov::numeric / rays::numeric;
arc := fov::numerics / rays::numeric;
IF fov = 360 THEN
angle_0 := 0;
ELSE
Expand Down Expand Up @@ -97,3 +106,4 @@ BEGIN

RETURN geomout;
END;
$$ language plpgsql IMMUTABLE;

0 comments on commit f032085

Please sign in to comment.