ShapefileDataSet Class
A dataset that reads and writes ESRI Shapefile vector data.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CEDataSets assembly)
Syntax
public class ShapefileDataSet : MultiFileDataSet,
IReadAttributes,
ISearchable
Remarks
This dataset reads and writes the ESRI Shapefile format. The dataset supports reading both 2D and 3D features, with the exception of MultiPatch objects. You can write 2D features using either the overloaded static method Save or the ShapefileWriter class.
Shapefile data consist of several files with the same base name but different extensions. According to the format specification, the files that are mandatory for reading Shapefile data is the main geometry file with a .shp extension, a corresponding index file with a .shx extension, and a .dbf file that stores the attributes. However, the ShapefileDataSet can read the data if the .shx file is missing, provided that there are no gaps between the records in the .shp file.
If you do not specify a coordinate reference system, the ShapefileDataSet will read the coordinate reference system from the .prj file, a text file containing information in Well-Known Text format.
There can also be a .cpg file that specifies the CodePage for the character encoding.
The .dbf format used for Shapefile attributes has a special type for a date (not including time). Since the Carmenta AttributeType enumeration lacks such a type, any Shapefile date attribute will be read as a String attribute containing the internal representation of the date, which is eight digits on the format YYYYMMDD. This format can be used directly for comparisons in a Condition, for example
BUILD_DATE > "19980630"
since the lexicographic order agrees with the chronological order. But you need application logic or a label expression to display the date in some other format; for example, to display a date label in the format DD/MM/YYYY, you can use a TextVisualizer.Text with an attribute expression like this:
substr(BUILD_DATE, 6, 2) + "/" + substr(BUILD_DATE, 4, 2) + "/" + substr(BUILD_DATE, 0, 4)
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
ResourceObject
DataSet
FileDataSet
MultiFileDataSet
ShapefileDataSet
Platforms
Windows, Linux, Android
ShapefileDataSet Members
The ShapefileDataSet type has the following members.
Constructors
Name | Description |
---|---|
ShapefileDataSet | Initializes a new instance of the ShapefileDataSet class. |
Properties
Name | Description |
---|---|
IReadAttributes.Attributes | Gets a collection whose contents determine which attributes will be read the DataSet. Inherited from IReadAttributes |
ClipSize | Gets or sets a value indicating that large features should be clipped into smaller pieces to improve reading performance. |
CodePage | Gets or sets the code page to use for attribute names and string attribute values. |
Crs | Gets or sets the coordinate reference system of the ShapefileDataSet. Inherited from DataSet |
DatumShiftChoice | Gets or sets a flag that tells how to choose a default datum shift for the Crs. |
Description | Gets or sets a short description of the dataset. Inherited from DataSet |
DisplayName | Gets or sets a display name for the dataset. Inherited from DataSet |
FeatureIndexPath | Gets or sets the directory where the feature index files will be saved. |
FileName | Gets or sets the name of the file to read from. Inherited from FileDataSet |
ISearchable.HasSearchIndex | Gets a value that tells whether a dataset has a search index. Inherited from ISearchable |
Id | Gets a unique identifier for this dataset instance. Inherited from DataSet |
IndexFileName | Gets or sets an explicit index file name used for the generated index files in IndexPath. Inherited from MultiFileDataSet |
IndexPath | Gets or sets the directory where the dataset index files are saved. Inherited from MultiFileDataSet |
IsDisposed | Gets a value that tells whether the current ShapefileDataSet has been disposed. Inherited from EngineObject |
IsoMetadataDocument | Gets or sets the path to an ISO 19139 metadata document for the dataset. Inherited from DataSet |
Name | Gets or sets the name of the ShapefileDataSet. Inherited from ResourceObject |
NativeHandle | Gets the native Carmenta Engine kernel object the current ShapefileDataSet represents. Inherited from EngineObject |
Path | Gets or sets the path to the file or files to read from. Inherited from FileDataSet |
IReadAttributes.ReadAttributes | Gets or sets a value indicating whether the DataSet reads attributes. Inherited from IReadAttributes |
SearchableAttributes | The attributes that will be used to create a search index for the dataset. |
SearchableCondition | Gets or sets a condition that determines which features will be included in the search index for the dataset. |
SearchSubdirectories | Gets or sets a flag indicating if the dataset will search for data files recursively. Inherited from MultiFileDataSet |
SuppressInitializationErrors | Gets or sets a flag indicating how errors during dataset initialization are handled. Inherited from DataSet |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
VerifyIndexFiles | Gets or sets a flag indicating if the contents of index files should be verified before use. Inherited from MultiFileDataSet |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
FindChildObject | Overloaded. Finds the child object with the specified name. Inherited from DataSet |
FlushCache | Frees any information the dataset may have cached, including all cached features. Inherited from DataSet |
GetChildObjects | Overloaded. Gets the child objects of the current object. Inherited from DataSet |
GetDataCoverage | Gets coverage information for this dataset in a given area. Inherited from DataSet |
Looks up an existing dataset instance from a dataset identity. Inherited from DataSet | |
GetDataSetInfo | Returns a dataset info that describes the contents of this dataset. Inherited from DataSet |
GetDataSetInfoAsync | Makes an asynchronous call to GetDataSetInfo. Inherited from DataSet |
GetFeature | Gets the feature with the specified identity. Inherited from DataSet |
GetFeatures | Overloaded. Gets features from the dataset. Inherited from DataSet |
GetFloatValueAt | Overloaded. Gets the float raster value from a cell at the specified position. Inherited from DataSet |
GetFloatValuesAt | Overloaded. Gets a number of float raster values. Inherited from DataSet |
GetLocalizedDescription | Gets a localized version of the dataset description in a specific language. Inherited from DataSet |
GetLocalizedDisplayName | Gets a localized version of the dataset display name in a specific language. Inherited from DataSet |
GetLocalizedIsoMetadataDocument | Gets the path to an ISO 19139 metadata document for a specific language. Inherited from DataSet |
GetNormalizedFloatValueAt | Overloaded. Gets the raster value from a cell at the specified position, normalized by Scale and Offset. Inherited from DataSet |
GetNormalizedFloatValuesAt | Overloaded. Gets a number of raster values, normalized by Scale and Offset. Inherited from DataSet |
GetValueAt | Overloaded. Gets the integer value from a raster cell at the specified position. Inherited from DataSet |
GetValuesAt | Overloaded. Gets a number of raster values. Inherited from DataSet |
HasLocalizedDescription | Checks if a localized version of the dataset description is available in a specific language. Inherited from DataSet |
HasLocalizedDisplayName | Checks if a localized version of the dataset display name is available in a specific language. Inherited from DataSet |
HasLocalizedIsoMetadataDocument | Checks if an ISO 19139 metadata document is available for a specific language. Inherited from DataSet |
HighestRasterValue | Finds the highest raster value inside the given polygon. Inherited from DataSet |
Initialize | Initializes the dataset. Inherited from DataSet |
Overloaded. Writes an enumeration of features to a new Shapefile on disk. | |
ISearchable.Search | Overloaded. Searches for features with an attribute whose value match the specified search text. Inherited from ISearchable |
SetLocalizedDescription | Sets a dataset description in a specific language. Inherited from DataSet |
SetLocalizedDisplayName | Sets a dataset display name in a specific language. Inherited from DataSet |
SetLocalizedIsoMetadataDocument | Sets the path to an ISO 19139 metadata document for the dataset, for a specific language. Inherited from DataSet |
TryGetFloatValueAt | Overloaded. Gets the float value from a raster cell at the specified position. Inherited from DataSet |
TryGetNormalizedFloatValueAt | Overloaded. Gets the float value from a raster cell at the specified position, normalized by Scale and Offset. Inherited from DataSet |
TryGetValueAt | Overloaded. Gets the integer value from a raster cell at the specified position. Inherited from DataSet |