Feature
gma.gio.Feature
[class] Feature(geom = None, values = [], gtype = None, ftypes = None, crs = None):Create a Feature object.
**Optional:
geom = None||Geometry. Default None.
The geometry of the feature. If None, create an empty geometry.
values = list. Default [].
The field values of the feature.
gtype = str||None. Default None.
The geometry type of the feature. See `dtypes.DefinedGeomTypes` for valid types. If None, use the geometry type of `geom`.
ftypes = None||list of FieldType. Default None.
The FieldTypes of the feature. If None, create an empty FieldTypes.
crs = str||int||None. Default None.
The projection of the geometry. If None, no projection is set.
Method
copy
[method] .copy():
copy self. --> Feature
plot
[method] .plot(ax = None, **kwargs):
Make plots of Geometry.
**Optional:
ax = None||matplotlib. ~.AxesSubplot. Default None.
A matplotlib subplot. If None, a default axes will be created.
**kwargs
Other plotting parameters. For more, see:
~.carto.utils.PolyCollection/LineCollection/PointCollection.
Returns:
matplotlib.~.AxesSubplot
set_fid
[method] .set_fid(fid):
Set the feature identifier.
Parameters:
fid: int.
the new feature identifier value to assign.
set_geom
[method] .set_geom(geom):
Set feature geometry. This function updates the features geometry, except that this function does not assume ownership of the passed geometry, but instead makes a copy of it.
Parameters:
geom: Geometry.
new geometry to apply to feature.
update
[method] .update(other):
Set one feature from another. Overwrite the contents of this feature from the geometry and attributes of another.
Parameters:
other: Feature.
feature from which geometry and field values will be copied.
Property
crs
[property] .crs
Get coordinate reference system. --> CoordinateReferenceSystem
fid
[property] .fid
Get feature identifier. --> int
fields
[property] .fields
Get fields for feature. --> dict
ftypes
[property] .ftypes
Get field types for feature. --> FieldTypes
geom
[property] .geom
Get geometry for feature. --> Geometry