10.12.2012 Views

Oracle Spatial User's Guide and Reference - InfoLab

Oracle Spatial User's Guide and Reference - InfoLab

Oracle Spatial User's Guide and Reference - InfoLab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SDO_LRS.PERCENTAGE_TO_MEASURE<br />

Usage Notes<br />

Examples<br />

This function returns the measure value corresponding to this percentage of the<br />

measure range. (The measure range is the end measure minus the start measure.)<br />

For example, if the measure range of geom_segment is 50 <strong>and</strong> percentage is 40,<br />

the function returns 20 (because 40% of 50 = 20).<br />

This function performs the reverse of the SDO_LRS.MEASURE_TO_PERCENTAGE<br />

function, which returns the percentage value that corresponds to a measure.<br />

An exception is raised if geom_segment has an invalid geometry type or<br />

dimensionality, or if percentage is less than 0 or greater than 100.<br />

The following example returns the measure that is 50 percent of the measure range<br />

of the geometric segment representing Route 1. (This example uses the definitions<br />

from the example in Section 7.7.) The measure range of this segment is 27, <strong>and</strong> 50<br />

percent of 27 is 13.5.<br />

SELECT SDO_LRS.PERCENTAGE_TO_MEASURE(a.route_geometry, m.diminfo, 50)<br />

FROM lrs_routes a, user_sdo_geom_metadata m<br />

HERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY'<br />

AND a.route_id = 1;<br />

SDO_LRS.PERCENTAGE_TO_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,50)<br />

------------------------------------------------------------<br />

13.5<br />

16-80 <strong>Oracle</strong> <strong>Spatial</strong> User’s <strong>Guide</strong> <strong>and</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!