A representation of a real-world geographic entity. More...
Header: | #include <Feature.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::GeoElement |
Inherited By: |
Public Functions
virtual | ~Feature() override |
Esri::ArcGISRuntime::FeatureObjectType | featureObjectType() const |
Esri::ArcGISRuntime::FeatureTable * | featureTable() const |
bool | refresh() |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::AttributeListModel * | attributes() const override |
virtual Esri::ArcGISRuntime::Geometry | geometry() const override |
virtual void | setGeometry(const Esri::ArcGISRuntime::Geometry &geometry) override |
Signals
void | geometryChanged() |
Detailed Description
Features are composed of both a geometry (point, polyline, or polygon) and attributes. The geometry represents the location and shape of the real-world entity; the attributes (key-value pairs) represent the fields and values that describe the entity. Examples of features include roads, fire hydrants, and property boundaries. Applications can access features from a feature layer or a feature collection to visualize the feature's geographic and attribute information, execute spatial queries, perform analyses, or make edits to the feature's data directly. Feature attribute values can be changed, but attribute definitions cannot be added, deleted, or modified.
Features are typically persisted in a data source (such as a feature service, geodatabase, shapefile, GeoJSON file, or GeoPackage) and have a common attribute schema. Features can also be stored directly in a feature collection in a map or scene. A feature collection groups logically related tables of features that may have different schema, geometry types, and symbology. See FeatureCollectionLayer for more information.
Feature is the base class for ArcGISFeature. ArcGIS features are stored in ArcGIS specific data sources such as GeodatabaseFeatureTable and ServiceFeatureTable.
Relevant samples:
- Add features (feature service): Add features to a feature layer.
- Add features with contingent values: Create and add features whose attribute values satisfy a predefined set of contingencies.
- Delete features (feature service): Delete features from an online feature service.
- Edit features with feature-linked annotation: Edit feature attributes which are linked to annotation through an expression.
- Feature collection layer: Create a Feature Collection Layer from a Feature Collection Table, and add it to a map.
- Feature layer selection: Select features in a feature layer.
- List related features: List features related to a selected feature.
- Update geometry (feature service): Update a feature's location in an online feature service.
- Viewshed (Geoprocessing): Calculate a viewshed using a geoprocessing service, in this case showing which parts of a landscape are visible from points on mountainous terrain.
See also ArcGISFeature, ArcGISFeatureTable, GeoPackageFeatureTable, OgcFeatureCollectionTable, ShapefileFeatureTable, WfsFeatureTable, and FeatureCollectionTable.
Member Function Documentation
[override virtual]
Feature::~Feature()
Destructor.
[override virtual]
Esri::ArcGISRuntime::AttributeListModel *Feature::attributes() const
Reimplements: GeoElement::attributes() const.
Returns a list model of all the feature attributes as key-value pairs.
Esri::ArcGISRuntime::FeatureObjectType Feature::featureObjectType () const
Returns the type of feature.
Esri::ArcGISRuntime::FeatureTable *Feature::featureTable () const
Returns the FeatureTable that this feature belongs to.
[override virtual]
Esri::ArcGISRuntime::Geometry Feature::geometry() const
Reimplements: GeoElement::geometry() const.
Returns the geometry for this feature.
See also setGeometry().
[signal, since Esri::ArcGISRuntime 100.2.1]
void Feature::geometryChanged ()
Signal emitted when the geometry is changed.
This function was introduced in Esri::ArcGISRuntime 100.2.1.
See also GeoElement.
[since Esri::ArcGISRuntime 100.4]
bool Feature::refresh()
Resets the attributes and geometry to the values in the data source, returning true
on success or false
otherwise.
Discards any in-memory changes to the feature that have not been applied to its table, and reloads the feature's geometry and all attributes.
This function was introduced in Esri::ArcGISRuntime 100.4.
[override virtual]
void Feature::setGeometry (const Esri::ArcGISRuntime::Geometry &geometry)
Reimplements: GeoElement::setGeometry(const Esri::ArcGISRuntime::Geometry &geometry).
Sets the geometry for the feature.
See also geometry().