32.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 32-9 RECTANGLE Parameters

Parameter Description

p_lon1

Longitude position of the lower left point.

p_lat1

Latitude position of the lower left point.

p_lon2

Longitude position of the upper right point.

p_lat2

Latitude position of the upper right point.

p_srid

Reference system (default c_wgs_84).

Returns

Table 32-10 RECTANGLE Function Returns

Return Description

mdsys.sdo_geometry

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;