1 geo.area

Returns the area of a 2D polygon.

<geo.area>
    <geom_column /> *
</geo.area>
Example
Copy
<select>
    <columns>
        <geo.area tol='4326' unit='SQ_KM'>a.the_geom</geo.reverseLine>
    </columns>
    <from table='buildings' alias='a' />
</select>
 

2 geo.distanceCartesian

Calculate the Cartesian distance between two geometric objects. The distance between two geometric objects is the distance between the closest points or segments between both objects.

<geo.distanceCartesian
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geom1> *
        <geom1 /> *
    </geom1>
    <geom2> *
        <geom1 /> *
    </geom2>
</geo.distanceCartesian>
Example
Copy
<select>
    <columns>
        <geo.distanceCartesian ora_tol='0.004' ora_unit='KM'>
             <geom1>a.the_geom</geom1>
             <geom2>a.the_geom</geom2>
        </geo.distanceCartesian>
    </columns>
    <from table='points' alias='a' >
        <join table='points' alias='b'>
        </join>
    </from>
    <where>
        a.id = 134 AND b.id = 24356
    </where>
</select>
 

3 geo.distanceSphere

Returns the linear distance between two lat/long points located on a perfect sphere of radius = 6370986m. It is faster than geo.distanceSpheroid but less accurate.

<geo.distanceSphere
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geom1> *
        <geom1 /> *
    </geom1>
    <geom2> *
        <geom1 /> *
    </geom2>
</geo.distanceSphere>
Example
Copy
<select>
    <columns>
        <geo.distanceSphere ora_tol=''>
             <geom1>a.the_geom</geom1>
             <geom2>a.the_geom</geom2>
        </geo.distanceSphere>
    </columns>
    <from table='points' alias='a' >
        <join table='points' alias='b'>
        </join>
    </from>
    <where>
        a.name = 'Barcelona' AND b.name = 'London'
    </where>
</select>
 

4 geo.distanceSpheroid

Returns the linear distance between two lat/long points located on the indicated spheroid.

<geo.distanceSpheroid
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geom1> *
        <geom1 /> *
    </geom1>
    <geom2> *
        <geom1 /> *
    </geom2>
    <spheroid /> *
</geo.distanceSpheroid>
Example
Copy
<select>
    <columns>
        <geo.distanceSpheroid ora_tol='0.005'>
             <geom1>a.the_geom</geom1>
             <geom2>a.the_geom</geom2>
             <spheroid> 'SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]]'</spheroid>
        </geo.distanceSpheroid>
    </columns>
    <from table='points' alias='a' >
        <join table='points' alias='b'>
        </join>
    </from>
    <where>
        a.name = 'Barcelona' AND b.name = 'London'
    </where>
</select>
 

5 geo.length

Returns the linear distance between two lat/long points located on the indicated spheroid.

<geo.length
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geometry_column /> *
</geo.length>
Example
Copy
<select>
    <columns>
        <geo.length ora_tol='0.005'>a.the_geom</geo.length>
    </columns>
    <from table='roads' alias='a' />
    <where>
        a.name = 'A-7'
    </where>
</select>
 

6 geo.lengthSpheroid

Returns the length of a line on the indicated spheroid.

<geo.lengthSpheroid
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geom1> *
        <geom1 /> *
    </geom1>
    <geom2> *
        <geom1 /> *
    </geom2>
    <spheroid /> *
</geo.lengthSpheroid>
Example
Copy
<select>
    <columns>
        <geo.lengthSpheroid ora_tol='0.005'>
             <geom1>a.the_geom</geom1>
             <spheroid> 'SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]]'</spheroid>
        </geo.distanceSpheroid>
    </columns>
    <from table='points' alias='a' >
        <join table='points' alias='b'>
        </join>
    </from>
    <where>
        a.name = 'Barcelona' AND b.name = 'London'
    </where>
</select>
 

7 geo.perimeter

Returns the perimeter of the geometric object of the argument received by function (geometric column).

<geo.perimeter
    pg_dim='2|3'
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geometry_column /> *
</geo.perimeter>
Example
Copy
<select>
    <columns>
        <geo.perimeter ora_tol='0.005' pg_dim='3' ora_unit='3'>a.the_geom</geo.perimeter>
    </columns>
    <from table='buildings' alias='a' />
    <where>
        a.name = 'MACBA'
    </where>
</select>
 

8 geo.centroid

Returns the geometric center of a geometry or a set of geometries. The geometry must be one or a set of POINTS, POLYGON or MULTIPOLYGON.

<geo.centroid ora_tol='ora_tol'>
    <geometry_column /> *
</geo.centroid>
Example
Copy
<select>
    <columns>
        <geo.centroid ora_tol='0.005'>a.the_geom</geo.centroid>
    </columns>
    <from table='buildings' alias='a' />
    <where>
        a.name = 'MACBA'
    </where>
</select>
 

9 geo.withinDist

Returns the geometric center of a geometry or set of geometries. The geometry must be one or a set of POINTS, POLYGON or MULTIPOLYGON.

<geo.withinDist
    ora_operator='y'
    ora_tol='ora_tol'
    ora_unit='M|KM|CM|MM|MILE|NAUT_MILE|FOOT|INCH|SQ_KM...'
>
    <geom1> *
        <geom1 /> *
    </geom1>
    <geom2> *
        <geom1 /> *
    </geom2>
    <spheroid /> *
</geo.withinDist>
Example
Copy
<select>
    <columns>
       <geo.withinDist ora_unit='KM' ora_tol='' ora_operator='y'>
            <geom1>geometry_col_1</geom1>
            <geom2>geometry_col_2</geom2>
            <dist>10</dist>
       </geo.withinDist>
    </columns>
    <from table='buildings' alias='a' />
    <where>
        a.name = 'MACBA'
    </where>
</select>