ShapefileFeatureTable

A table of features that typically represents real-world objects created from a local shapefile data source. A shapefile is a vector data storage format that stores the location, shape, and attributes of geographic features with the same geometry type (such as point, line, and polygon) and the same spatial reference. A shapefile dataset consists of at least three files (.shp, .shx, .dbf), and may include many others. Each of the component files of a shapefile must be smaller than 2 GB. If the minimum required files are not present (or are larger than 2 GB), the table will fail to load. If the file permissions are read-only, features cannot be edited.

See Shapefiles in ArcGIS Pro[https://pro.arcgis.com/en/pro-app/latest/help/data/shapefiles/working-with-shapefiles-in-arcgis-pro.htm] for more information about shapefile data types and limitations.

On-the-fly projection of a shapefile is supported if an associated .prj file is present. Otherwise, the features are assumed to have the same spatial reference as the map.

A default renderer is used to render a shapefile feature table in a feature layer. In most cases, the default should be replaced with a custom renderer.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(shapefilePath: String)

Creates a shapefile feature table from the local shapefile (.shp) at the given path. When creating a shapefile feature table, the path must point to the .shp file and the associated .shx and .dbf files must be present at the same location.

Properties

Link copied to clipboard

Shapefile info that contains metadata for the dataset. If the shapefile has an associated .xml file, a shapefile info object will be created and populated with metadata from the file. If an .xml file does not exist, this object will be null.

Link copied to clipboard

The path to the shapefile. The path must point to the .shp file in a folder accessible by the application and the associated .shx and .dbf files must be present at the same location. The path can only be assigned if the ShapefileFeatureTable is not loaded or has previously failed to load.

Link copied to clipboard

True if the shapefile has a spatial index, false otherwise. The spatial indexes for a shapefile are stored in .sbn and .sbx files. Usually they are created by ArcGIS Pro. Having a current spatial index ensures that a high level of performance is maintained when drawing and working with the shapefile's features and that the shapefile's extent is accurate.

Inherited properties

Link copied to clipboard

A user-friendly name that can be displayed in the UI (for example, in a Table of Contents). If the table is displayed with a FeatureLayer, the FeatureTable.displayName is used as the FeatureLayer.name.

Link copied to clipboard

The geographic extent of features within the table. This is calculated differently for specific types and modes of feature tables:

Link copied to clipboard
open val fields: List<Field>

The collection of Field objects representing the fields of the feature table.

Link copied to clipboard

The type of geometry of the features stored in this table. If FeatureTable.hasGeometry is false, then the geometry type is GeometryType.Unknown.

Link copied to clipboard

True if the feature table supports geographic features, false otherwise.

Link copied to clipboard

True if the feature table supports geometries with M values, false otherwise.

Link copied to clipboard

True if the feature table supports geometries with Z values, false otherwise.

Link copied to clipboard

True if this feature table is editable, false otherwise. Underlying file permissions (for subclasses such as ShapefileFeatureTable and GeodatabaseFeatureTable) can be changed while the feature table is open. In these cases the value of this property may not be accurate.

Link copied to clipboard
open override var isPopupEnabled: Boolean

A flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable. Will return false if an error occurs.

Link copied to clipboard
val layer: Layer?

The layer that displays this table, if any. The Layer type depends on how the feature table is created. For example, a Layer will be an AnnotationLayer if the FeatureTable is created from a table that supports annotation. See Layer for more information about the supported layer types.

Link copied to clipboard
open override val loadStatus: StateFlow<LoadStatus>

The load status.

Link copied to clipboard

The number of features in the table. If all the features are stored in the local table, for example with a GeodatabaseFeatureTable or a ShapefileFeatureTable, then the FeatureTable.numberOfFeatures will return the full number of features.

Link copied to clipboard
open override var popupDefinition: PopupDefinition?

The pop-up definition. The PopupDefinition associated with the popup source. A null if an error occurs or if the popup source is not associated with a pop-up definition.

Link copied to clipboard

The spatial reference of the table. A spatial reference defines how the coordinates of a feature's Geometry correspond to locations in the real world. For more information, see the SpatialReference class or the Spatial references[https://developers.arcgis.com/documentation/spatial-references/] documentation.

Link copied to clipboard

The name of the table in the source dataset.

Functions

Link copied to clipboard
fun close()

Closes the shapefile feature table. Before you close a shapefile feature table you should remove all references to the data it contains, such as removing the feature layer from a map and releasing the shapefile feature table. Attempts to access a shapefile feature table after it is closed will fail, resulting in an error.

Inherited functions

Link copied to clipboard
suspend fun addFeature(feature: Feature): Result<Unit>

Adds a feature to the table. Adding a feature that contains a Geometry causes the geometry to become simplified. This may change a single part geometry to a multipart geometry, or round off X, Y, Z, and M coordinate values that are above the resolution set by the SpatialReference.

Link copied to clipboard
suspend fun addFeatures(features: Iterable<Feature>): Result<Unit>

Adds a collection of features to the table.

Link copied to clipboard

Determines whether you can add new features to the table. Although this method may state that the table allows new features to be added, the application may not be licensed to permit this. For example, a user cannot add features to a secured feature table if the application is licensed at the Lite level (LicenseLevel.Lite).

Link copied to clipboard
open override fun cancelLoad()

Cancels loading metadata for the Loadable object.

Link copied to clipboard
fun canDelete(feature: Feature): Boolean

Determines whether you can delete the feature from the table. Although this method may state that the table allows the feature to be deleted, the application may not be licensed to permit this. For example, a user cannot delete features from a secured feature table if the application is licensed at the Lite level (LicenseLevel.Lite).

Link copied to clipboard

Determines whether you can edit the geometry field in a table. Although this method may state that the table allows geometry fields to be edited, the application may not be licensed to permit this. For example, a user cannot update geometry in a secured feature table if the application is licensed at the Lite level (LicenseLevel.Lite).

Link copied to clipboard
fun canUpdate(feature: Feature): Boolean

Determines whether you can update the feature in the table. Although this method may state that the table allows the feature to be updated, the application may not be licensed to permit this. For example, a user cannot update features in a secured feature table if the application is licensed at the Lite level (LicenseLevel.Lite).

Link copied to clipboard

Creates a new empty feature. The new feature is only available in memory at this point. Execute FeatureTable.addFeature(Feature) to commit the new Feature to the table.

fun createFeature(attributes: Map<String, Any?>, geometry: Geometry?): Feature

Creates a new feature with the provided attribute values and, optionally, geometry. The new feature is only available in memory at this point. Execute FeatureTable.addFeature(Feature) to commit the new Feature to the table.

Link copied to clipboard
suspend fun deleteFeature(feature: Feature): Result<Unit>

Deletes a feature from the table. Deleting a feature from a GeodatabaseFeatureTable in a stand-alone mobile geodatabase created with ArcGIS Pro is not supported when the table participates in a controller dataset, such as a utility network or parcel fabric. Use FeatureTable.canDelete(Feature) to determine if this operation is allowed.

Link copied to clipboard
suspend fun deleteFeatures(features: Iterable<Feature>): Result<Unit>

Deletes a collection of features from the table.

Link copied to clipboard
fun getField(fieldName: String): Field?

Retrieves the field with the given fieldName.

Link copied to clipboard
open suspend override fun load(): Result<Unit>

Loads the metadata for the object.

Link copied to clipboard
suspend fun queryExtent(queryParameters: QueryParameters): Result<Envelope>

Determines the minimum bounding envelope that contains features satisfying the provided query parameters. If no features meet the query criteria, an empty envelope is returned.

Link copied to clipboard
suspend fun queryFeatureCount(queryParameters: QueryParameters): Result<Long>

Determines the count of features that satisfy the provided query parameters.

Link copied to clipboard

Submits a query against the table.

Link copied to clipboard
suspend fun queryStatistics(statisticsQueryParameters: StatisticsQueryParameters): Result<StatisticsQueryResult>

Calculates values for the requested statistics. Statistics query parameters may also define fields on which results are grouped or sorted.

Link copied to clipboard
open suspend override fun retryLoad(): Result<Unit>

Loads or retries loading metadata for the object.

Link copied to clipboard
suspend fun updateFeature(feature: Feature): Result<Unit>

Updates a feature in the table. If you update a feature that contains a Geometry, the geometry becomes simplified. This may change a single part geometry to a multipart geometry, or round X, Y, Z, and M coordinate values that are above the resolution set by the SpatialReference.

Link copied to clipboard
suspend fun updateFeatures(features: Iterable<Feature>): Result<Unit>

Updates a collection of features in the table.