geometry.Geometry.convert_field#
- Geometry.convert_field(name, totype='node', new_name=None)#
Convert the data field with the specified name to another type.
Parameters#
- name: str
The name of the data Field to convert to another type. A nonexisting name is silently ignored.
- totype: str
The field type to convert to. See
Fieldfor details.- new_name: str
The name of the new (converted) Field (and key to store it). If the same name is specified as the old Field, that one will be overwritten by the new. Otherwise, both will be kept in the Geometry object’s
fieldsdict. If no new name is given, then the name of the old Field will be used.
Returns#
FieldThe converted and stored data field. Returns None if the original data field does not exist.
Examples#
See
add_field().