Class DimensionLayer

  • All Implemented Interfaces:
    RemoteResource, LayerContent, Loadable

    public final class DimensionLayer
    extends Layer
    implements RemoteResource
    A layer that can visualize dimension features data.

    Dimension features are a special kind of annotation feature for showing specific lengths or distances on a map. A dimension may indicate the length of a side of a building or land parcel, or the distance between two features, such as a fire hydrant and the corner of a building. They are described in detail in "Dimension".

    Each Dimension feature has specific text and specific locations for its schematic lines and arrows.

    Dimension features are not linked to other point, line or polygon features, even if the dimension measurement was created to refer to one or more features.

    You can construct a dimension layer using a feature table containing dimension features:

    Dimension layers can be taken offline from a feature service hosted on ArcGIS Enterprise 10.9 or later, using the GeodatabaseSyncTask. Dimension layers are also supported in mobile map packages or mobile geodatabases created in ArcGIS Pro 2.9 or later.

    Dimension respects the reference scale defined by the map, so dimension will always be presented to the user at the correct size and position, as defined by the dimension author.

    Dimension features cannot be added, changed or deleted by Runtime users. (Attempts will produce a "Geodatabase table not editable" (3016) error)

    The fields of a Dimension feature can be queried by Runtime users or used in the definition expression, but not have their values changed. The automatic fields are described in detail in "Dimension fields". Authors may have added additional fields relevant to their data description.

    The Runtime user does not have access to, and cannot change, the Renderer or the Styles used for rendering dimensions.

    Since:
    100.13.0
    See Also:
    Layer
    • Constructor Detail

      • DimensionLayer

        public DimensionLayer​(ArcGISFeatureTable featureTable)
        Creates a dimension layer from a feature table containing dimension features.

        If the feature table does not contain dimension data then the DimensionLayer will fail to load. ArcGISFeatureTable.getLayerInfo() and ArcGISFeatureLayerInfo.getServiceType() can be checked, to verify the feature type, before attempting to create a Layer.

        Parameters:
        featureTable - the feature table, containing dimension features, used as the source of the dimension layer
        Throws:
        java.lang.IllegalArgumentException - if featureTable is null
        Since:
        100.13.0
        See Also:
        ArcGISFeatureTable
      • DimensionLayer

        public DimensionLayer​(PortalItem item,
                              long layerId)
        Creates a new dimension layer object from a feature service portal item.
        Parameters:
        item - a feature service PortalItem
        layerId - the layer ID for which to create the layer
        Throws:
        java.lang.IllegalArgumentException - if item is null
        Since:
        100.13.0
        See Also:
        Layer.getItem()
      • DimensionLayer

        public DimensionLayer​(java.lang.String uri)
        Creates a new dimension layer from a feature service URI.

        If the specified URI is not a valid Feature Service endpoint, then it will fail to load.

        Parameters:
        uri - the URI to the feature service layer
        Throws:
        java.lang.IllegalArgumentException - if uri is null or empty
        Since:
        100.13.0
    • Method Detail

      • getUri

        public java.lang.String getUri()
        Gets the URI of a feature service to define the layer.
        Specified by:
        getUri in interface RemoteResource
        Returns:
        the URI of a feature service to define the layer
        Since:
        100.13.0
      • getBarrierWeight

        public LabelBarrierWeight getBarrierWeight()
        Gets the weight of dimension features when considered as barriers to labeling.

        The default is LabelBarrierWeight.HIGH.

        Returns:
        the weight of dimension features when considered as barriers to labeling
        Since:
        100.14.0
      • setBarrierWeight

        public void setBarrierWeight​(LabelBarrierWeight barrierWeight)
        Sets the weight of dimension features when considered as barriers to labeling.

        The default is LabelBarrierWeight.HIGH.

        Parameters:
        barrierWeight - the weight of dimension features when considered as barriers to labeling
        Throws:
        java.lang.IllegalArgumentException - if barrierWeight is null
        Since:
        100.14.0
      • getDefinitionExpression

        public java.lang.String getDefinitionExpression()
        Gets an expression which is a SQL statement where clause to specify the subset of features to be displayed.

        The definition expression string uses the SQL-92 where clause syntax The default value is an empty string, which will allow all dimension features in the data source to be used by the DimensionLayer.

        Be sure to escape special characters in the expression string as required for your platform. The DATE keyword expects the date format yyyy-mm-dd and the TIMESTAMP keyword expects the time stamp format yyyy-mm-dd hh:mm:ss. See the ArcGIS Blog article entitled "Querying Feature Services Date-Time Queries" for more information.

        Returns:
        an expression which is a SQL statement where clause to specify the subset of features to be displayed
        Since:
        100.13.0
      • setDefinitionExpression

        public void setDefinitionExpression​(java.lang.String definitionExpression)
        Sets an expression which is a SQL statement where clause to specify the subset of features to be displayed.

        The definition expression string uses the SQL-92 where clause syntax The default value is an empty string, which will allow all dimension features in the data source to be used by the DimensionLayer.

        Be sure to escape special characters in the expression string as required for your platform. The DATE keyword expects the date format yyyy-mm-dd and the TIMESTAMP keyword expects the time stamp format yyyy-mm-dd hh:mm:ss. See the ArcGIS Blog article entitled "Querying Feature Services Date-Time Queries" for more information.

        Parameters:
        definitionExpression - an expression which is a SQL statement where clause to specify the subset of features to be displayed
        Throws:
        java.lang.IllegalArgumentException - if definitionExpression is null
        Since:
        100.13.0
      • getFeatureTable

        public ArcGISFeatureTable getFeatureTable()
        Gets the feature table associated with this layer.
        Returns:
        the feature table associated with this layer, or null if none
        Since:
        100.13.0
      • getLayerId

        public long getLayerId()
        Gets the layer ID that defines the layer within the feature service portal item.
        Returns:
        the layer ID that defines the layer within the feature service portal item
        Since:
        100.13.0
        See Also:
        Layer.getItem(), getLayerId()
      • getReferenceScale

        public double getReferenceScale()
        Gets the reference scale for the layer.

        The reference scale of the layer is the scale at which a client should view the layer for the schematic lines and text to appear at its authored size.

        If the client changes the viewing scale, then schematic lines and text will grow or shrink to keep a consistent size on the map (not the screen).

        For a valid layer, the reference scale will always be a finite value, greater than zero. Until the layer is loaded, the reference scale will be zero.

        Returns:
        the reference scale for the layer
        Since:
        100.13.0
      • clearSelection

        public void clearSelection()
        Updates any selected features in the layer back to the un-selected state.
        Since:
        100.13.0
      • resetFeaturesVisible

        public void resetFeaturesVisible()
        Resets the visibility of the layer's features back to the original visibility when loaded from the data source.
        Since:
        100.13.0
      • selectFeature

        public void selectFeature​(Feature feature)
        Selects the given feature and adds it to the current list of selected features.
        Parameters:
        feature - the feature
        Throws:
        java.lang.IllegalArgumentException - if feature is null
        Since:
        100.13.0
      • selectFeatures

        public void selectFeatures​(java.lang.Iterable<Feature> features)
        Selects the features in the list and adds them to the current list of selected features.
        Parameters:
        features - a Iterable of Feature. Contents of the Iterable are copied.
        Throws:
        java.lang.IllegalArgumentException - if features is null
        Since:
        100.13.0
      • selectFeaturesAsync

        public ListenableFuture<FeatureQueryResult> selectFeaturesAsync​(QueryParameters parameters,
                                                                        FeatureLayer.SelectionMode mode)
        Selects the features that match the criteria in the QueryParameters object and adds them to the current list of selected features.
        Parameters:
        parameters - the definition of the query to submit to the feature table
        mode - defines how the list of currently selected features will be updated with the features returned from the query.
        Returns:
        a ListenableFuture that returns a FeatureQueryResult
        Throws:
        java.lang.IllegalArgumentException - if parameters is null
        java.lang.IllegalArgumentException - if mode is null
        Since:
        100.13.0
      • setFeatureVisible

        public void setFeatureVisible​(Feature feature,
                                      boolean visible)
        Sets the visibility of the given feature.
        Parameters:
        feature - the feature
        visible - true to show, false to hide
        Throws:
        java.lang.IllegalArgumentException - if feature is null
        Since:
        100.13.0
      • setFeaturesVisible

        public void setFeaturesVisible​(java.lang.Iterable<Feature> features,
                                       boolean visible)
        Sets the visibility of the given features.
        Parameters:
        features - a Iterable of Feature. Contents of the Iterable are copied.
        visible - true to show, false to hide
        Throws:
        java.lang.IllegalArgumentException - if features is null
        Since:
        100.13.0
      • unselectFeature

        public void unselectFeature​(Feature feature)
        Unselects the given feature and removes it from the current list of selected features.
        Parameters:
        feature - the feature
        Throws:
        java.lang.IllegalArgumentException - if feature is null
        Since:
        100.13.0
      • unselectFeatures

        public void unselectFeatures​(java.lang.Iterable<Feature> features)
        Unselects the features in the given list and removes them from the current list of selected features.
        Parameters:
        features - a Iterable of Feature. Contents of the Iterable are copied.
        Throws:
        java.lang.IllegalArgumentException - if features is null
        Since:
        100.13.0
      • copy

        public DimensionLayer copy()
        Creates a deep copy of this DimensionLayer instance. This means that copies of all fields of this layer are made including its load state.
        Returns:
        a deep copy of this DimensionLayer instance
        Since:
        100.13.0
      • getCredential

        public Credential getCredential()
        Description copied from interface: RemoteResource
        Gets the Credential that is set on the network-enabled resource.

        Only applicable if the resource is secured.

        Specified by:
        getCredential in interface RemoteResource
        Returns:
        the Credential, or null if there is none
      • setCredential

        public void setCredential​(Credential credential)
        Description copied from interface: RemoteResource
        Sets a Credential to be used by the network-enabled resource in the event of an authentication challenge. The default credential is null.

        Only applicable if the resource is secured.

        Specified by:
        setCredential in interface RemoteResource
        Parameters:
        credential - the Credential to be used for authentication