Changes between Version 29 and Version 30 of UsersWikiplpgsqlfunctions
- Timestamp:
- 08/05/20 10:38:19 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsersWikiplpgsqlfunctions
v29 v30 1 1 2 = AdditionalUser-contributed Functions =2 = User-contributed Functions = 3 3 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] 4 This is an area to put utility functions or wrappers around PostGIS. 6 5 7 6 == Construct an arc given two points on the arc, the centre point and direction or size == … … 9 8 {{{ 10 9 #!sql 11 CREATE FUNCTION st_createarc(startpoint geometry, endpoint geometry, arcenter geometry, direction text) RETURNS geometry10 CREATE FUNCTION ST_Arc(startpoint geometry, endpoint geometry, arcenter geometry, direction text) RETURNS geometry 12 11 AS $$ 13 12 DECLARE … … 179 178 }}} 180 179 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 183 CREATE 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) 185 186 RETURNS geometry AS 186 187 $$ 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) 188 189 $$ 189 190 LANGUAGE 'sql';