Distance
This class provides a standardized interface for representing and converting distance measurements across a wide variety of units. It supports arithmetic operations, such as multiplication with other distance objects to produce area measurements or with numeric types for scaling. The class also includes an extensive mapping of unit aliases to ensure compatibility with Spatial Reference WKT definitions.
Attributes
| Attribute | Type | Description |
|---|---|---|
| STANDARD_UNIT | string = "m" | The base unit of measurement used for internal calculations and normalization, defined as meters. |
| UNITS | dict | A mapping of unit names to their conversion factors relative to the standard unit of meters. |
| ALIAS | dict | A dictionary mapping common unit names and Spatial Reference WKT terms to their internal unit keys. |
| LALIAS | dict | A lowercase version of the ALIAS mapping used for case-insensitive unit lookups. |
Constructor
Signature
def Distance()