ShapefileFeatureTable Class

  • ShapefileFeatureTable
  • class Esri::ArcGISRuntime::ShapefileFeatureTable

    A feature table created from a shapefile. More...

    Header: #include <ShapefileFeatureTable.h>
    Since: Esri::ArcGISRuntime 100.2
    Inherits: Esri::ArcGISRuntime::FeatureTable

    This class was introduced in Esri::ArcGISRuntime 100.2.

    Public Functions

    ShapefileFeatureTable(const QString &path, QObject *parent = nullptr)
    virtual ~ShapefileFeatureTable() override
    void close()
    Esri::ArcGISRuntime::ShapefileInfo info() const
    bool isSpatialIndexEnabled() const
    QString path() const

    Detailed Description

    A shapefile is a simple, nontopological format for storing the geometric location and attribute information of geographic features. A shapefile is one of the spatial data formats that you can work with and edit in ArcGIS.

    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 larger than 2 GB), the table will fail to load. If the file permissions are read-only, features cannot be edited. On-the-fly projection of a shapefile is only 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.

    Member Function Documentation

    ShapefileFeatureTable::ShapefileFeatureTable(const QString &path, QObject *parent = nullptr)

    Constructor that takes the path to the shapefile and an optional parent.

    The file referenced must have the .shp extension.

    [override virtual] ShapefileFeatureTable::~ShapefileFeatureTable()

    Destructor.

    void ShapefileFeatureTable::close()

    Closes the ShapefileFeatureTable by forcefully removing all internal references to it.

    Sometimes it is necessary to close a ShapefileFeatureTable and remove references to it so the source shapefile can be deleted by the same app that has been using it. This workflow can be difficult when there can be outstanding references that may be difficult to track and delete.

    Stop using the ShapefileFeatureTable before calling close. For example, remove from maps any feature layers use the ShapefileFeatureTable.

    After calling ShapefileFeatureTable::close, the ShapefileFeatureTable object is in an undefined state and should no longer be used.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    Esri::ArcGISRuntime::ShapefileInfo ShapefileFeatureTable::info() const

    Returns the ShapefileInfo for the specified shapefile.

    If the shapefile has an associated .xml file, a shapefile info object will be created and populated with metadata from the file. Otherwise this will return an empty object.

    bool ShapefileFeatureTable::isSpatialIndexEnabled() const

    Returns whether the shapefile uses spatial indexes.

    ArcGIS Desktop can be used to create spatial indexes for shapefiles, stored in .sbn and .sbx files. 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.

    QString ShapefileFeatureTable::path() const

    Returns the path to the shapefile used to create this object.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.