- All Implemented Interfaces:
GeoElement
- Direct Known Subclasses:
ArcGISFeature
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.
- Since:
- 100.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGets a java.util.Map of all the available attributes as name value pairs.Gets theFeatureTablethat this feature belongs to.Gets the geometry which defines the shape and location of the GeoElement.booleanrefresh()Resets the attributes and geometry of this feature to the values of the local backing feature table by discarding any in-memory changes to this feature that have not been applied to the local backing feature table.voidsetGeometry(Geometry geometry) Sets the geometry defines the shape and location of the GeoElement.
-
Method Details
-
getAttributes
Gets a java.util.Map of all the available attributes as name value pairs. Only a subset of all attributes may be available on aServiceFeatureTableif its outfields have been set.Attribute values are returned as Object instances, but the underlying value type is based on the
Field.Type.Below is example of how to change an editable attribute then apply the change to the FeatureTable.
feature.getAttributes().put("fieldName", "attributeValue"); ListenableFuture<Boolean> result = featureTable.updateFeatureAsync(feature);- Specified by:
getAttributesin interfaceGeoElement- Returns:
- all the available attributes as name value pairs.
- Since:
- 100.0.0
- See Also:
-
getGeometry
Description copied from interface:GeoElementGets the geometry which defines the shape and location of the GeoElement.- Specified by:
getGeometryin interfaceGeoElement- Returns:
- the geometry defines the shape and location of the GeoElement, or null if none
-
setGeometry
Description copied from interface:GeoElementSets the geometry defines the shape and location of the GeoElement.- Specified by:
setGeometryin interfaceGeoElement- Parameters:
geometry- the geometry defines the shape and location of the GeoElement
-
getFeatureTable
Gets theFeatureTablethat this feature belongs to.- Returns:
- the
FeatureTablethat this feature belongs to, or null if none - Since:
- 100.0.0
-
refresh
public boolean refresh()Resets the attributes and geometry of this feature to the values of the local backing feature table by discarding any in-memory changes to this feature that have not been applied to the local backing feature table. This method does not make any network requests, data is only refreshed locally as follows:- For a new feature instance that is not added to the table yet, no changes to geometry or attributes.
- For an updated feature that is in the table, geometry and attributes change to the state in the local table.
- For a feature that has been deleted from the table, no changes to geometry or attributes.
- Returns:
- true if the geometry or attributes were reset, false otherwise
- Since:
- 100.4.0
-