41.8 RECTANGLE Function
This function creates a rectangle from point at (p_lon1
, p_lat1
) to (p_lon2
, p_lat2
).
Syntax
APEX_SPATIAL.RECTANGLE (
p_lon1 IN NUMBER,
p_lat1 IN NUMBER,
p_lon2 IN NUMBER,
p_lat2 IN NUMBER,
p_srid IN t_srid DEFAULT c_wgs_84 )
RETURN mdsys.sdo_geometry;
Parameters
Table 41-9 RECTANGLE Parameters
Parameter | Description |
---|---|
|
Longitude position of the lower left point. |
|
Latitude position of the lower left point. |
|
Longitude position of the upper right point. |
|
Latitude position of the upper right point. |
|
Reference system (default c_wgs_84). |
Returns
Table 41-10 RECTANGLE Function Returns
Return | Description |
---|---|
|
The geometry for the rectangle (p_lon1, p_lon2, p_lon2, p_lat2). |
Example
This example is a query that returns a rectangle from (10, 50) to (11, 51).
select apex_spatial.rectangle(10, 50, 11, 51) from dual
This example is equivalent to:
select mdsys.sdo_geometry(
2003, 4326, null,
sdo_elem_info_array(1, 1003, 1),
sdo_ordinate_array(10, 50, 11, 50, 11, 51, 10, 51, 10, 50))
from dual;
Parent topic: APEX_SPATIAL