Changes between Version 13 and Version 14 of UsersWikiplpgsqlfunctions
- Timestamp:
- 09/10/09 14:05:21 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsersWikiplpgsqlfunctions
v13 v14 26 26 endpointutm := st_transform(endpoint,utmzone(endpoint)); 27 27 28 midpointrads := abs(st_azimuth( startpointutm,arcenterutm) - st_azimuth(endpointutm,arcenterutm))/2;28 midpointrads := abs(st_azimuth(arcenterutm,startpointutm) - st_azimuth(arcenterutm,endpointutm))/2; 29 29 IF direction = 'cw' THEN thedirection := -1*midpointrads; ELSE thedirection := midpointrads; END IF; 30 30 pointonarc := ST_Translate( ST_Rotate( ST_Translate( startpointutm, -1*ST_X(arcenterutm), -1*ST_Y(arcenterutm)), thedirection), ST_X(arcenterutm), ST_Y(arcenterutm)); … … 34 34 $$ 35 35 LANGUAGE 'plpgsql' IMMUTABLE; 36 COMMENT ON FUNCTION st_createarc(geometry,geometry,geometry,text) IS 'Generates an arc based on starting point, ending point, centre of arc, and direction (clockwise: 'cw', counter-clockwise: 'cc'). All geometries must be of type POINT and this function returns a linestring of the arc based on the original SRID and 32 points per quarter circle. Requires the utmzone function.'; 36 COMMENT ON FUNCTION st_createarc(geometry,geometry,geometry,text) IS 'Generates an arc based on starting point, ending point, centre of arc, and direction (clockwise: \'cw\', conter-clockwise: \'cc\'). All geometries must be of type POINT and this function returns a linestring of the arc based on the original SRID and 32 points per quarter circle. Requires the utmzone function.'; 37 37 38 38 39 }}}