Merge branch 'develop' of github.com:CartoDB/crankshaft into add-voronoi
This commit is contained in:
@@ -74,11 +74,11 @@ BEGIN
|
||||
SELECT array_agg(v) INTO vertex FROM a;
|
||||
|
||||
-- retrieve the value of each vertex
|
||||
WITH a AS(SELECT unnest(vertex) as geo, unnest(colin) as c)
|
||||
WITH a AS(SELECT unnest(geomin) as geo, unnest(colin) as c)
|
||||
SELECT c INTO va FROM a WHERE ST_Equals(geo, vertex[1]);
|
||||
WITH a AS(SELECT unnest(vertex) as geo, unnest(colin) as c)
|
||||
WITH a AS(SELECT unnest(geomin) as geo, unnest(colin) as c)
|
||||
SELECT c INTO vb FROM a WHERE ST_Equals(geo, vertex[2]);
|
||||
WITH a AS(SELECT unnest(vertex) as geo, unnest(colin) as c)
|
||||
WITH a AS(SELECT unnest(geomin) as geo, unnest(colin) as c)
|
||||
SELECT c INTO vc FROM a WHERE ST_Equals(geo, vertex[3]);
|
||||
|
||||
SELECT ST_area(g), ST_area(ST_MakePolygon(ST_MakeLine(ARRAY[point, vertex[2], vertex[3], point]))), ST_area(ST_MakePolygon(ST_MakeLine(ARRAY[point, vertex[1], vertex[3], point]))), ST_area(ST_MakePolygon(ST_MakeLine(ARRAY[point,vertex[1],vertex[2], point]))) INTO sg, sa, sb, sc;
|
||||
|
||||
@@ -162,13 +162,14 @@ $$ language plpgsql IMMUTABLE;
|
||||
* @function : FindCircle
|
||||
* @precis : Function that determines if three points form a circle. If so a table containing
|
||||
* centre and radius is returned. If not, a null table is returned.
|
||||
* @version : 1.0
|
||||
* @version : 1.0.1
|
||||
* @param : p_pt1 : First point in curve
|
||||
* @param : p_pt2 : Second point in curve
|
||||
* @param : p_pt3 : Third point in curve
|
||||
* @return : geometry : In which X,Y ordinates are the centre X, Y and the Z being the radius of found circle
|
||||
* or NULL if three points do not form a circle.
|
||||
* @history : Simon Greener - Feb 2012 - Original coding.
|
||||
* Rafa de la Torre - Aug 2016 - Small fix for type checking
|
||||
* @copyright : Simon Greener @ 2012
|
||||
* Licensed under a Creative Commons Attribution-Share Alike 2.5 Australia License. (http://creativecommons.org/licenses/by-sa/2.5/au/)
|
||||
**/
|
||||
|
||||
Reference in New Issue
Block a user