MCPcopy
hub / github.com/django/django / units

Method units

django/contrib/gis/gdal/srs.py:242–254  ·  view source on GitHub ↗

Return a 2-tuple of the units value and the units name. Automatically determine whether to return the linear or angular units.

(self)

Source from the content-addressed store, hash-verified

240
241 @property
242 def units(self):
243 """
244 Return a 2-tuple of the units value and the units name. Automatically
245 determine whether to return the linear or angular units.
246 """
247 units, name = None, None
248 if self.projected or self.local:
249 units, name = capi.linear_units(self.ptr, byref(c_char_p()))
250 elif self.geographic:
251 units, name = capi.angular_units(self.ptr, byref(c_char_p()))
252 if name is not None:
253 name = force_str(name)
254 return (units, name)
255
256 # #### Spheroid/Ellipsoid Properties ####
257 @property

Callers

nothing calls this directly

Calls 3

force_strFunction · 0.90
linear_unitsMethod · 0.45
angular_unitsMethod · 0.45

Tested by

no test coverage detected