The functions described below are implemented without having an operator. If you are missing some functions, see Section 5 and use the operators.
The area
function returns the area of a
spherical object in square radians. Supported data types are:
scircle, spolygon (if the polygon
is convex), and sbox.
The functions
returns the longitude or latitude value of a
spherical position p
in radians.
The functions
return the Cartesian
x, y or
z value of a spherical position
p
. The returned values are always
between -1.0 and +1.0.
Example 38. Get the Cartesian z-value of a spherical point
sql> SELECT z ( spoint '(10d,-90d)' ) AS z; z ---- -1 (1 row)
You can get a float8 array of Cartesian values using the function
Using the function
strans_zxz(strans),
you can convert
an Euler transformation to ZXZ axes
transformation.
It is possible to get the components of an Euler transformation.
Table 4. Getting Euler transformation attributes
function | description |
---|---|
phi
| first angle of a transformation |
theta
| second angle of a transformation |
psi
| third angle of a transformation |
axes
| transformation axes as a three letter code |
The angles will always returned as a float8 value in radians. The axes are returned as a three letter code.
You can get the radius of a spherical circle in radians using
the radius
function. The center of the
circle is available with
the operator @@ (Section 5.7).
pgSphere provides 4 functions to get the parameters of a spherical ellipse:
Table 5. Getting spherical ellipse attributes
function | description |
---|---|
lrad
| the major radius of the ellipse |
srad
| the minor radius of the ellipse |
center
| the center of the ellipse |
inc
| the inclination of the ellipse |
To get the ellipse center, you can use the
operator @@ (Section 5.7)
instead of using the function
center(sellipse)
.
To get the beginning and the end of a line, pgSphere provides two functions:
You can create a meridian as a line using the function
The function returns a line starting at a latitude of
-90° and ending at a latitude of 90°. The line goes
along the given longitude lng
in
radians.
You can get the count of points of a spherical path using the function:
pgSphere provides two functions to get points at a path.
The first function returns the i
-th
point of a path. If i
is less than 1
or larger than the count of spath points, the
function returns NULL. The second
function does nearly the same, but does linear interpolation
between edge positions.
Similar to an spath (Section 6.7.1), you can get the count of edges of a spherical polygon using the function:
The functions
return the corresponding southwest, northeast, southeast, or northwest edge. The returned value will be a spherical point.