Merge branch 'develop'

This commit is contained in:
Carla Iriberri
2016-08-18 17:35:36 +02:00
3 changed files with 21 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ BEGIN
convexhull_1 as (
SELECT
ST_ConvexHull(ST_Collect(geomin)) as g,
buffer * |/ st_area(ST_ConvexHull(ST_Collect(geomin))) as r
buffer * |/ (st_area(ST_ConvexHull(ST_Collect(geomin)))/PI()) as r
),
clipper as(
SELECT
@@ -145,15 +145,26 @@ BEGIN
SELECT
(st_dump(v.g)).geom as g
FROM voro_cells v
),
clipped_voro as(
SELECT
ST_intersection(c.g, v.g) as g
FROM
voro_set v,
clipper c
WHERE
ST_GeometryType(v.g) = 'ST_Polygon'
)
SELECT
st_collect(
ST_Transform(ST_intersection(c.g, v.g), 4326)
ST_Transform(
ST_ConvexHull(g),
4326
)
)
INTO geomout
FROM
voro_set v,
clipper c;
clipped_voro;
RETURN geomout;
END;
$$ language plpgsql IMMUTABLE;

View File

@@ -2,6 +2,6 @@ SET client_min_messages TO WARNING;
\set ECHO none
avg_area
----------------------
0.000200480682454162
0.000178661700690617
(1 row)