Changes between Version 29 and Version 30 of UsersWikiplpgsqlfunctions


Ignore:
Timestamp:
Aug 5, 2020, 10:38:19 AM (4 years ago)
Author:
mdavis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiplpgsqlfunctions

    v29 v30  
    11
    2 = Additional User-contributed Functions =
     2= User-contributed Functions =
    33 
    4 This is an area to put utility functions or wrappers around PostGIS
    5 [wiki:UsersWikiplpgsqlfunctionsDistance Distance /Spatial Reference support functions PL/PGSQL/SQL Functions]
     4This is an area to put utility functions or wrappers around PostGIS.
    65
    76== Construct an arc given two points on the arc, the centre point and direction or size ==
     
    98{{{
    109#!sql
    11  CREATE FUNCTION st_createarc(startpoint geometry, endpoint geometry, arcenter geometry, direction text) RETURNS geometry
     10 CREATE FUNCTION ST_Arc(startpoint geometry, endpoint geometry, arcenter geometry, direction text) RETURNS geometry
    1211    AS $$
    1312  DECLARE
     
    179178}}}
    180179
    181 == Construct Ellipse (x,y,rx,ry,rotation,#of segments in 1/4 of ellipse) ==
    182 {{{
    183 #!sql
    184 CREATE OR REPLACE FUNCTION ST_Ellipse(double precision, double precision, double precision, double precision, double precision, integer)
     180== Construct Ellipse ( x,y, rx,ry [,rotation [,#of segments in 1/4 of ellipse] ] ) ==
     181{{{
     182#!sql
     183CREATE OR REPLACE FUNCTION ST_Ellipse(x double precision, y double precision,
     184  rx double precision, ry double precision,
     185  rotation double precision DEFAULT 0.0, quadSeg integer DEFAULT 8)
    185186 RETURNS geometry AS
    186187 $$
    187    SELECT ST_Translate( ST_Rotate( ST_Scale( ST_Buffer(ST_Point(0,0), 0.5, $6), $3, $4), $5), $1, $2)
     188   SELECT ST_Translate( ST_Rotate( ST_Scale( ST_Buffer(ST_Point(0,0), 0.5, quadSeg), rx, ry), rotation), x, y)
    188189$$
    189190 LANGUAGE 'sql';