Class Feature

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class Feature
    extends Object
    implements GeoElement
    A representation of a real-world object on a map. A feature is persisted in a FeatureTable in a data store (such as a database or service) or in a map. Features in the same data store or feature layer have a common attribute schema.
    • Method Detail

      • getAttributes

        public Map<String,​Object> 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 a ServiceFeatureTable if 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:
        getAttributes in interface GeoElement
        all the available attributes as name value pairs.
        See Also:
      • getGeometry

        public Geometry getGeometry()
        Description copied from interface: GeoElement
        Gets the geometry of this geoelement.
        Specified by:
        getGeometry in interface GeoElement
        the geometry of this geoelement
      • setGeometry

        public void setGeometry​(Geometry geometry)
        Description copied from interface: GeoElement
        Sets the GeoElement's geometry.
        Specified by:
        setGeometry in interface GeoElement
        geometry - the geometry to set
      • getFeatureTable

        public FeatureTable getFeatureTable()
        Gets a reference to the FeatureTable that this feature came from.
        a reference to the FeatureTable that this feature came from
      • 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.
        true if the geometry or attributes were reset, false otherwise