IBM® Informix® 12.10

Units of measure

Units of measure define the conversion factor between meters and other units.

You include the unit of measure information when you calculate distance or area for geometries that have angular units with the following functions:

Include the appropriate value from the unit_name column of the st_units_of_measure table when you run the function.

You can also use units of measure in your applications when you need to convert between units.

To create a new unit of measure, insert a row into the st_units_of_measure table. Specify values for the following columns:

Example

The following statement creates a linear unit of measure that is named half_meter and has a conversion factor of .5:

INSERT INTO sde.st_units_of_measure 
       VALUES('half_meter','linear',.5,'test uom');

Compare the results of the following two queries. The following query returns the length of a linestring in meters:

EXECUTE FUNCTION round(st_length
              ('32605 linestring(503208 43653, 503210 43653)'::st_linestring, 
               'meter'),2);

    (expression)

2.00000000000000

1 row(s) retrieved.

The following query returns the length of the same linestring in half-meter units:

EXECUTE FUNCTION round(st_length
              ('32605 linestring(503208 43653, 503210 43653)'::st_linestring, 
               'half_meter'),2);

    (expression)

4.00000000000000

1 row(s) retrieved.


Examples exchange | Troubleshooting

To find the PDF, see Publications for the IBM Informix 12.10 family of products.
For the release notes, documentation notes, and/or machine notes, see the Release Notes page.