cfdm.core.Coordinate.get_geometry¶
-
Coordinate.
get_geometry
(default=ValueError())[source]¶ Return the geometry type.
New in version (cfdm): 1.8.0
See also
- Parameters
- default: optional
Return the value of the default parameter if the geometry type has not been set.
If set to an
Exception
instance then it will be raised instead.
- Returns
str
The geometry type.
Examples
>>> f = cfdm.core.read('file.nc')[0] >>> c = f.construct('axis=X') >>> c.has_geometry() True >>> c.get_geometry() 'line' >>> b = c.del_geometry() >>> c.has_geometry() False >>> print(c.get_geometry(None)) None
>>> c.set_geometry(b) >>> c.has_geometry() True