Package com.esri.arcgisruntime.data
Class ShapefileFeatureTable
- java.lang.Object
-
- com.esri.arcgisruntime.data.FeatureTable
-
- com.esri.arcgisruntime.data.ShapefileFeatureTable
-
- All Implemented Interfaces:
Loadable
,PopupSource
public final class ShapefileFeatureTable extends FeatureTable
Represents a shapefile table. 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.- Since:
- 100.2.0
-
-
Constructor Summary
Constructors Constructor Description ShapefileFeatureTable(java.lang.String shapefilePath)
Constructs a ShapefileFeatureTable object from a local shapefile path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this shapefile.ShapefileInfo
getInfo()
Gets the shapefile info that contains metadata for the dataset.java.lang.String
getPath()
Gets the path to the shapefile.boolean
isSpatialIndexEnabled()
Gets whether the shapefile uses spatial indexes.-
Methods inherited from class com.esri.arcgisruntime.data.FeatureTable
addDoneLoadingListener, addFeatureAsync, addFeaturesAsync, addLoadStatusChangedListener, canAdd, cancelLoad, canDelete, canEditGeometry, canUpdate, createFeature, createFeature, deleteFeatureAsync, deleteFeaturesAsync, getDisplayName, getExtent, getFeatureLayer, getField, getFields, getGeometryType, getLayer, getLoadError, getLoadStatus, getPopupDefinition, getSpatialReference, getTableName, getTotalFeatureCount, hasGeometry, hasM, hasZ, isEditable, isPopupEnabled, loadAsync, onDoneLoadingInternal, queryExtentAsync, queryFeatureCountAsync, queryFeaturesAsync, queryStatisticsAsync, removeDoneLoadingListener, removeLoadStatusChangedListener, retryLoadAsync, setDisplayName, setPopupDefinition, setPopupEnabled, updateFeatureAsync, updateFeaturesAsync
-
-
-
-
Constructor Detail
-
ShapefileFeatureTable
public ShapefileFeatureTable(java.lang.String shapefilePath)
Constructs a ShapefileFeatureTable object from a local shapefile path. A shapefile dataset consists of at least three files (.shp, .shx, .dbf), and may include many others. Each of the files of a shapefile must be smaller than 2 GB. When creating a shapefile feature table, the path must point to the .shp file, the associated .shx and .dbf files must be present at the same location, otherwise the ShapefileFeatureTable will fail to load.- Parameters:
shapefilePath
- a path to a local (.shp) shapefile- Throws:
java.lang.IllegalArgumentException
- if shapefilePath is null, an invalid file path or or security permission- Since:
- 100.2.0
-
-
Method Detail
-
getInfo
public ShapefileInfo getInfo()
Gets the shapefile info that contains metadata for the dataset.- Returns:
- a ShapefileInfo object containing metadata of the dataset
- Since:
- 100.2.0
- See Also:
ShapefileInfo
-
isSpatialIndexEnabled
public boolean isSpatialIndexEnabled()
Gets whether the shapefile uses spatial indexes.The spatial indexes for a shapefile are stored in *.sbn and *.sbx files. Usually they are created by ESRI ArcGIS for Desktop. Having the spatial indexes ensures that high performance is maintained when drawing and working with the shapefile's features and that the shapefile's extent is accurate.
- Returns:
- true if the shapefile has a spatial index, otherwise false
- Since:
- 100.2.0
-
getPath
public java.lang.String getPath()
Gets the path to the shapefile.- Returns:
- the path to the shapefile
- Since:
- 100.2.0
-
close
public void close()
Closes this shapefile. Any operation on a closed shapefile will fail, therefore before closing a shapefile make sure it is no longer in use, e.g., by a feature layer. After closing a shapefile the underlying files can safely be deleted or moved, etc.- Since:
- 100.3.0
-
-