-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathST_3D_GeoAstroide_csccs
More file actions
38 lines (34 loc) · 1.38 KB
/
Copy pathST_3D_GeoAstroide_csccs
File metadata and controls
38 lines (34 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
DROP FUNCTION IF EXISTS ST_3D_GeoAstroide_csccs(
geom GEOMETRY,
distance float,
direction_degrees_teta numeric,
direction_degrees_fi numeric,
first_numerator_exponentiation numeric,
first_denominator_exponentiation numeric,
second_numerator_exponentiation numeric,
second_denominator_exponentiation numeric,
third_numerator_exponentiation numeric,
third_denominator_exponentiation numeric)
CREATE OR REPLACE FUNCTION ST_3D_GeoAstroide_csccs(
geom GEOMETRY,
distance float,
direction_degrees_teta numeric,
direction_degrees_fi numeric,
first_numerator_exponentiation numeric,
first_denominator_exponentiation numeric,
second_numerator_exponentiation numeric,
second_denominator_exponentiation numeric,
third_numerator_exponentiation numeric,
third_denominator_exponentiation numeric)
RETURNS GEOMETRY AS
$BODY$
SELECT ST_MakePoint((ST_X($1)+$2*(COSD($3)*SIND($4)))^$5*$6,
(ST_Y($1)+$2*(COSD($3)*COSD($4)))^$7*$8,
(ST_Z($1)+$2*SIND($3))^$9*$10);
$BODY$
LANGUAGE SQL
SELECT ST_ASText(ST_SetSrid(ST_MakeLine(ST_3D_GeoAstroide_csccs(geom, 1, i, r, 1, 1, 1, 1, 1, 1)),4326)) geom FROM
(SELECT ST_MakePoint(0, 0, 0) geom, generate_series (0,360) i) foo CROSS JOIN generate_series (0,360,10) r;
*experimental*
* Note
To visualize the result of building ST_3D() function it is necessary to use PostGIS ST_AsX3D() function. The link to an example of its use is located at - https://postgis.net/docs/ST_AsX3D.html