C# Class Shapefile.Shape

Show file Open project: TNOCS/csTouch Class Usage Examples

Public Methods

Method Description
GetMetadata ( string name ) : string

Gets the metadata (as a string) for a given name (key). Valid names for this shape can be retrieved by calling GetMetadataNames().

GetMetadataNames ( ) : string[]

Gets an array of valid metadata names (keys) for this shape. Returns null if not metadata exists.

Protected Methods

Method Description
ParseBoundingBox ( byte value, int startIndex, ProvidedOrder order ) : RectangleD

Extracts a double precision rectangle (RectangleD) from a byte array - assumes that the called has validated that there is enough space in the byte array for four doubles (32 bytes)

ParsePolyLineOrPolygon ( byte shapeData, RectangleD &boundingBox, List &parts ) : void

The PolyLine and Polygon shapes share the same structure, this method parses the bounding box and list of parts for both

ParsePolygonZ ( byte shapeData, RectangleD &boundingBox, List &parts ) : void

The PolygonZ shape share the same structure, this method parses the bounding box and list of parts for both

Shape ( ShapeType shapeType, int recordNumber, StringDictionary metadata, IDataRecord dataRecord ) : System

Base Shapefile shape - contains only the shape type and metadata plus helper methods. An instance of Shape is the Null ShapeType. If the Type field is not ShapeType.Null then cast to the more specific shape (i.e. ShapePolygon).

Method Details

GetMetadata() public method

Gets the metadata (as a string) for a given name (key). Valid names for this shape can be retrieved by calling GetMetadataNames().
public GetMetadata ( string name ) : string
name string The name to retreieve
return string

GetMetadataNames() public method

Gets an array of valid metadata names (keys) for this shape. Returns null if not metadata exists.
public GetMetadataNames ( ) : string[]
return string[]

ParseBoundingBox() protected method

Extracts a double precision rectangle (RectangleD) from a byte array - assumes that the called has validated that there is enough space in the byte array for four doubles (32 bytes)
protected ParseBoundingBox ( byte value, int startIndex, ProvidedOrder order ) : RectangleD
value byte byte array
startIndex int start index in the array
order ProvidedOrder byte order of the doubles to be extracted
return RectangleD

ParsePolyLineOrPolygon() protected method

The PolyLine and Polygon shapes share the same structure, this method parses the bounding box and list of parts for both
protected ParsePolyLineOrPolygon ( byte shapeData, RectangleD &boundingBox, List &parts ) : void
shapeData byte The shape record as a byte array
boundingBox RectangleD Returns the bounding box
parts List Returns the list of parts
return void

ParsePolygonZ() protected method

The PolygonZ shape share the same structure, this method parses the bounding box and list of parts for both
protected ParsePolygonZ ( byte shapeData, RectangleD &boundingBox, List &parts ) : void
shapeData byte The shape record as a byte array
boundingBox RectangleD Returns the bounding box
parts List Returns the list of parts
return void

Shape() protected method

Base Shapefile shape - contains only the shape type and metadata plus helper methods. An instance of Shape is the Null ShapeType. If the Type field is not ShapeType.Null then cast to the more specific shape (i.e. ShapePolygon).
protected Shape ( ShapeType shapeType, int recordNumber, StringDictionary metadata, IDataRecord dataRecord ) : System
shapeType ShapeType The ShapeType of the shape
recordNumber int The record number in the Shapefile
metadata System.Collections.Specialized.StringDictionary Metadata about the shape (optional)
dataRecord IDataRecord IDataRecord associated with the shape
return System