NetTopologySuite.IO.Esri.Shapefile
Manages configurations and constants specific to the structure and operation of DBF files in the dBASE III format.
The Latin1 Encoding
Get the language driver id for an encoding
The encoding
A language driver id
Get the Encoding for an language driver id
Language Driver ID
Encoding
Class that allows records in a dbase file to be enumerated.
Sets or returns the date this file was last updated.
Return the number of records in the file.
RecordCount is saved in DBF file as 32-bit unisigned integer. Record count is limited to 1 Billion (http://www.dbase.com/Knowledgebase/faq/dBASE_Limits_FAQ.html), so it is les than int.MaxValue
Return the length of the records in bytes.
Returns the fields in the dbase file.
Encoding used by dBASE file.
Initializes new instance of the reader.
Stream of source DBF file.
DBF file encoding or null if encoding should be resolved from DBF reserved bytes.
Initializes new instance of the reader.
Path to DBF file.
DBF file encoding or null if encoding should be resolved from DBF reserved bytes.
Reads field values from underlying stream and advances the enumerator to the next record.
true if the enumerator was successfully advanced to the next record;
false if the enumerator has passed the end of the table.
Reads field values from underlying stream and advances the enumerator to the next record.
Indicates if the record was marked as deleted.
true if the enumerator was successfully advanced to the next record;
false if the enumerator has passed the end of the table.
Reads values from underlying stream and advances the enumerator to the next record.
Array of field values. If null specified new array will be created.
Indicates if the reacord was marked as deleted.
true if the enumerator was successfully advanced to the next element;
false if the enumerator has passed the end of the collection.
Moves enumerator to specified position and reads values from underlying stream.
Thre record index.
Table containing record fields (attributes).
dBASE field type
Character
Date - 8 bytes (stored as a string in the format YYYYMMDD).
Numeric - positive or negative numbers. Number stored as a string. Can store integer and decimal numbers but Esri software uses it only for integer values.
Positive or negative numbers. Identical to Numeric; maintained for compatibility. Used by Esri software.
Logical - one character ('T','F')
Shapefile's shape stored in SHP file (not dBASE standard).
Class that allows records in a dbase file to be enumerated.
Returns the fields in the dbase file.
Encoding of dBASE file
Return the length of the records in bytes.
Return the number of records in the file.
RecordCount is saved in DBF file as 32-bit unisigned integer. Record count is limited to 1 Billion (http://www.dbase.com/Knowledgebase/faq/dBASE_Limits_FAQ.html), so it is les than int.MaxValue
Initializes new DbaseStreamReader
Stream of source DBF file.
dBASE field definitions.
DBF file encoding. Defaults to UTF8.
Initializes new DbaseStreamReader
Path to DBF file.
dBASE field definitions.
DBF file encoding. Defaults to UTF8.
Writes field values to the underlying stream and advances the position to the next record.
true if the enumerator was successfully advanced to the next element;
false if the enumerator has passed the end of the collection.
Writes record values to the underlying stream and advances the position to the next record.
true if the enumerator was successfully advanced to the next element;
false if the enumerator has passed the end of the collection.
Character field definition.
Initializes a new instance of the field class.
Field name.
Field length.
String representation of current field value.
Date field definition.
Initializes a new instance of the field class.
Field name.
Field length.
Date representation of current field value.
dBASE field definition.
Field Name.
Field Type.
Length of the data in bytes or total number of digits in the numeric value.
Number of digits after the decimal point in the numeric value.
Initializes a new instance of the field class.
Field name (max 10 characters).
Field type.
Field length.
Decimal places count.
Current field value.
is used by shapefile readers and writers to hold current record field value.
Determines if the field currently does not contain any value.
Creates dBASE field determined using specified value.
Field name.
Field value type.
dBase field definition.
Collection of dBASE field definitions.
Gets the field at the specified index.
The zero-based index of the field to get.
The field at the specified index.
Gets the field with specified name.
The of the field.
The field with specified name or null if name was not found.
Gets the number of fields contained in the collection.
Reads current fields values.
Dictionary containging field names and values.
Reads current fields values.
Dictionary containging field names and values.
Reads current fields values.
Array of field values.
Sets current filed values.
Sets current filed values.
DbfField collection extensions.
Adds a DBF field.
The field list.
Field name.
Field type.
Adds a DBF field.
The field list.
Field name.
Adds a character string field.
The field list.
Field name.
Field lenght.
Adds a date field.
The field list.
Field name.
Adds a logical field.
The field list.
Field name.
Adds an Int32 field.
The field list.
Field name.
Adds an Int64 field.
The field list.
Field name.
Adds a Double field.
The field list.
Field name.
Adds a float field.
The field list.
Field name.
Numeric field definition.
Intializes new instance of the numerif field class.
Field name.
The number of significant digits (including decimal separator).
The number of fractional digits.
Initializes a new instance of the field class.
Field name.
Logical field definition.
Initializes a new instance of the field class.
Field name.
Field length.
Logical representation of current field value.
Int64 field definition.
Intializes new instance of the numerif field class.
Field name.
The number of significant digits (including decimal separator).
The number of fractional digits.
Initializes a new instance of the field class.
Field name.
Int64 field definition.
Intializes new instance of the numerif field class.
Field name.
The number of significant digits (including decimal separator).
The number of fractional digits.
Initializes a new instance of the field class.
Field name.
Numeric field definition.
Numeric field definition.
Numeric representation of current field value.
Converts the number to its string representation.
Number to convert.
A string that is equivalent to the specified numer.
Converts the string representation of a number to its number equivalent.
A string that contains a number to convert.
A number that is equivalent to the specified string representation of numeric value.
Int32 field definition.
Intializes new instance of the numerif field class.
Field name.
The number of digits.
Initializes a new instance of the field class.
Field name.
Int64 field definition.
Intializes new instance of the numerif field class.
Field name.
The number of digits.
Initializes a new instance of the field class.
Field name.
Feature helper methods.
Gets default for specified geometry.
A Geometry object.
Shape type.
Base class witha a mechanism for releasing managed resources.
Adds a resource which will be disposed at the end of life of this instance.
Disposes managed objects assosiated with this instance.
Moves data processing ahead a specified number of items.
Clears the content of the stream and loads content
from stream. Copying begins at the current position
in the stream and ends after
specifed of bytes.
Writes string to BinaryDataWriter.
Data stream.
String value to write.
Bytes count to be written in BinaryDataWriter.
Encoding used to translate string to bytes.
Base shapefile class.
Minimal Measure value considered as not "no-data".
Any floating point number smaller than –10E38 is considered by a shapefile reader
to represent a "no data" value. This rule is used only for measures (M values).
http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf (page 2, bottom)
Shape type.
Reads shape type information from SHP stream.
SHP file stream.
Shape type.
Gets default for specified geometry.
A Geometry object.
Shape type.
Reads shape type information from SHP file.
Path to SHP file.
Shape type.
Opens shapefile reader.
SHP stream.
DBF stream.
Reader options.
Shapefile reader.
Opens shapefile reader.
Path to shapefile.
Reader options.
Shapefile reader.
Reads all features from shapefile.
shp stream.
dbf stream.
Reader options.
Reads all features from shapefile.
Path to shapefile.
Reader options.
Shapefile features.
Reads all geometries from SHP file.
Path to SHP file.
Reader options.
Shapefile geometries.
Opens shapefile writer.
SHP stream.
SHX stream.
DBF stream.
PRJ stream.
Writer options.
Shapefile writer.
Opens shapefile writer.
Path to shapefile.
Writer options.
Shapefile writer.
Writes features to the shapefile.
Features to be written.
SHP stream.
SHX stream.
DBF stream.
PRJ stream.
Projection metadata for the shapefile (content of the PRJ file).
DBF file encoding (if not set UTF8 is used).
Writes features to the shapefile.
Features to be written.
Path to shapefile.
Projection metadata for the shapefile (content of the PRJ file).
DBF file encoding (if not set UTF8 is used).
Validates a 2 GB size limit for any shapefile component file.
Shapefile component file size.
The exception that is thrown when a non-fatal application error occurs related to Shapefile functionality.
Specifies the geometry building algorithm to use.
Rings order explained.
Shape geometry will be read assuming that it does conform to ESRI Shapefile specification.
For example polygons will be created based on Shapefile's ring orientation semantics.
Ring typeOrientation
- ShellClockwise, Shapefile's left-hand-rule
- HoleCounter-Clockwise, Shapefile's right-hand-rule
In case of an invalid shape an error will be thrown.
Shape geometry will be read assuming that it does conform to ESRI Shapefile specification.
In case of an invalid shape generated geometry will be empty or will have property set to false.
Shape geometry that does not conform to ESRI Shapefile specification will be skipped.
The reader will omit the geometry and related attributes as if they didn't exist.
This will result in proceding the enumeration until the end of the file is reached
even if some features are corrupted (so possibly valid shapes are not ignored).
Invalid shape geometry will will be tried to be fixed using all possible methods.
For polygons following logic will be applied:
- Sort all rings.
- Consider all rings as a potential shell, search the valid holes for any possible shell.
- Check if the ring is inside any shell: if true, it can be considered a potential hole for the shell.
- Check if the ring is inside any hole of the shell: if true, this means that is actually a shell of a distinct geometry,
and NOT a valid hole for the shell. A hole inside another hole is not allowed.
This option is considerably slower, especially for complex geometries
(i.e.: polygons with a large number of holes having large numer of vertices).
Invalid shape geometry will will be tried to be fixed using only basic methods.
For polygons following logic will be applied:
- Do not sort rings but assume that polygons are serialized in the following order: Shell[, Holes][, Shell[, Holes][, ...]].
- Assume that the first ring that is not contained by the current polygon is the start of a new polygon.
This option is is faster than but can result in geometries having property set to false.
MultiPoint shapefile reader.
Point shapefile reader.
Polygon shapefile reader.
PolyLine shapefile reader.
Base class for reading a shapefile.
Encoding used by the shapefile.
Well-known text representation of coordinate reference system metadata from .prj file.
https://support.esri.com/en/technical-article/000001897
/>
The Bounding Box stored in the SHP file header representing the actual extent of the shapes in the file.
If the shapefile is empty (that is, has no records), the Bounding Box values are unspecified.
Shape geometry.
Shapefile attribute definitions with current attribute values.
Record count.
Initializes a new instance of the reader class.
DBF file stream reader.
Moves reader back to its initial position.
Reads feature geometry and attributes from underlying SHP and DBF files.
Indicates if the record was marked as deleted.
Shapefile feature.
true if the enumerator was successfully advanced to the next record;
false if the enumerator has passed the end of the table.
Reads feature geometry and attributes from underlying SHP and DBF files into and properties.
Indicates if the record was marked as deleted.
true if the enumerator was successfully advanced to the next record;
false if the enumerator has passed the end of the table.
Reads feature geometry and attributes from underlying SHP and DBF files into and properties.
true if the enumerator was successfully advanced to the next record;
false if the enumerator has passed the end of the table.
Generic base class for reading a shapefile.
Shape geometry.
Initializes a new instance of the reader class.
SHP file stream.
DBF file stream.
Reader options.
Initializes a new instance of the reader class.
Path to SHP file.
Reader options.
Reads feature geometry and attributes from underlying SHP and DBF files.
Indicates if the record was marked as deleted.
true if the enumerator was successfully advanced to the next record;
false if the enumerator has passed the end of the table.
Shapefile reader options
Geometry factory
DBF file encoding. If null encoding will be guess from related .CPG file or from reserved DBF bytes
Specifies the geometry building algorithm to use.
The minimum bounding rectangle (BMR) used to filter out shapes located outside it.
Minimum bounding rectangle (MBR) filtering options.
Minimum bounding rectangle (MBR) filtering options.
Filter by geometry extent. This option is faster but gives less acurate results (it can get some shapes that are not actually in the MBR).
Filter by geometry shape. This option gives precise results but it also greatly affect the performance.
MultiPoint shapefile writer.
Point shapefile writer.
Polygon shapefile writer.
PolyLine shapefile writer.
Base class for writing a shapefile.
Shape geometry.
Initializes a new instance of the writer class.
DBF file stream writer.
Wrties geometry and attributes into underlying SHP and DBF files.
Attribute values must be set using Value property of DbfFiled(s) provided during initialization.
Writes feature to the shapefile.
Writes features to the shapefile.
Generic base class for writing a shapefile.
Shape geometry.
Initializes a new instance of the writer class.
SHP file stream.
SHX file stream.
DBF file stream.
PRJ file stream.
Writer options.
Initializes a new instance of the writer class.
Path to SHP file.
Writer options.
Wrties geometry and attributes into underlying SHP and DBF files.
Attribute values must be set using Value property of DbfFiled(s) provided during initialization.
Shapefile writer options
Shape type.
Shapefile fields definitions.
DBF file encoding.
Projection metadata for the shapefile (content of the PRJ file).
Creates new instance of ShapefileWriterOptions class.
Shape type.
Shapefile fields definitions.
Creates new instance of ShapefileWriterOptions class based on existing ShapefileReader.
Shape reader.
Adds a DBF field (feature attribute).
Field name.
Field type.
Adds a DBF field.
Field name.
Adds a character string field (feature attribute).
Field name.
Field lenght.
Adds a date field (feature attribute).
Field name.
Adds a float field (feature attribute).
Field name.
Adds a logical field (feature attribute).
Field name.
Adds an Int32 field (feature attribute).
Field name.
Adds an Int64 field (feature attribute).
Field name.
Adds a Double field (feature attribute).
Field name.
Shapefile geometry types.
Null Shape
Indicates a null shape, with no geometric data for the shape. Each feature type (point, line, polygon, etc.)
supports nulls - it is valid to have points and null points in the same shapefile. Often null shapes are place
holders - they are used during shapefile creation and are populated with geometric data soon after they are created.
Point in the X, Y space.
PolyLine in the X, Y space.
A PolyLine is an ordered set of vertices that consists of one or more parts.
A part is a connected sequence of two or more points.
Parts may or may not be connected to one another. Parts may or may not intersect one another.
Polygon in the X, Y space.
A polygon consists of one or more rings. A ring is a connected sequence of four or more points that form a closed, non-self-intersecting loop.
A polygon may contain multiple outer rings. The order of vertices or orientation for a ring indicates which side of the ring
is the interior of the polygon. The neighborhood to the right of an observer walking along
the ring in vertex order is the neighborhood inside the polygon. Vertices of rings defining
holes in polygons are in a counterclockwise direction. Vertices for a single, ringed
polygon are, therefore, always in clockwise order. The rings of a polygon are referred to
as its parts.
MultiPoint in the X, Y space.
A MultiPoint represents a set of points.
Measured Point in the X, Y, Z space.
Named as PointZ in ESRI Shapefile Technical Description.
Measured PolyLine in the X, Y, Z space.
Named as PolyLineZ in ESRI Shapefile Technical Description.
Measured Polygon in the X, Y, Z space.
Named as PolygonZ in ESRI Shapefile Technical Description.
Measured MultiPoint in the X, Y, Z space.
Named as MultiPointZ in ESRI Shapefile Technical Description.
Measured Point in the X, Y space.
Measured LineString in the X, Y space.
Measured Polygon in the X, Y space.
Measured MultiPoint in the X, Y space.
MultiPatch
Helper methods for ShapeType enumeration.
Indicates if the geometric data for the shape associated with this type contains Z coordinate.
Indicates if the geometric data for the shape associated with this type contains Measure value.
Indicates if shape associated with this type is a Point.
Indicates if shape associated with this type is a MultiPoint.
Indicates if shape associated with this type is a PolyLine.
Indicates if shape associated with this type is a Polygon.
MultiPoint SHP file reader.
Point SHP file reader.
Base class class for reading a fixed-length file header and variable-length records from a *.SHP file.
Initializes a new instance of the ShpReader class.
Shape type.
The Bounding Box stored in the SHP file header representing the actual extent of the shapes in the file.
If the shapefile is empty (that is, has no records), the Bounding Box values are unspecified.
Shape geometry.
Reads content of the from the underlying stream.
Value indicating if reading next record was successful.
Base class class for reading a fixed-length file header and variable-length records from a *.SHP file.
Shapefile Spec:
The one-to-one relationship between geometry and attributes is based on record number.
Attribute records in the dBASE file must be in the same order as records in the main file.
DBF does not have recor number attribute.
Errors which occured during reading process. Valid only if ShapefileReaderOptions.SkipFailures option is set to true.
SHP geometry.
Initializes a new instance of the reader class.
SHP file stream.
Reader options.
Base class class for reading and writing a fixed-length file header and variable-length records from a *.SHP file.
Shape type.
Initializes a new instance of the reader class.
Shape type.
Opens SHP reader.
SHP file stream.
Reader options.
SHP reader.
Helper methods for ordinate converting as specified in the ESRI Shapefile Technical Description.
Converts Z ordinate to value as specified in the ESRI Shapefile Technical Description.
Z value.
• 0.0 if specified value is
• if specified value is
• if specified value is
otherwise it returns specified value.
SHP Spec: Floating point numbers must be numeric values. Positive infinity, negative infinity,
and Not-a-Number(NaN) values are not allowed in shapefiles.
Converts Measure to value as specified in the ESRI Shapefile Technical Description.
Measure value.
• value less than –10E38 if specified value is
• if specified value is
• -10E38 if specified value is
otherwise it returns specified value.
SHP Spec: Floating point numbers must be numeric values. Positive infinity, negative infinity,
and Not-a-Number(NaN) values are not allowed in shapefiles. Nevertheless, shapefiles
support the concept of "no data" values, but they are currently used only for measures.
Any floating point number smaller than –10E38 is considered by a shapefile reader to represent a "no data" value.
MultiPoint SHP file writer.
Point SHP file writer.
Polygon SHP file writer.
MultiLine SHP file writer.
Base class class for writing a fixed-length file header and variable-length records to a *.SHP file.
SHP geometry.
Initializes a new instance of the writer class.
SHP file stream.
SHX file stream.
Shape type.
Writes the geometry to the underlying stream.
Writes the geometry to the underlying stream.