libpcidsk
|
Interface to PCIDSK vector segment. More...
#include <pcidsk_vectorsegment.h>
Public Member Functions | |
virtual std::string | GetRst ()=0 |
Fetch RST. | |
virtual int | GetFieldCount ()=0 |
Get field count. | |
virtual std::string | GetFieldName (int field_index)=0 |
Get field name. | |
virtual std::string | GetFieldDescription (int field_index)=0 |
Get field description. | |
virtual ShapeFieldType | GetFieldType (int field_index)=0 |
Get field type. | |
virtual std::string | GetFieldFormat (int field_index)=0 |
Get field format. | |
virtual ShapeField | GetFieldDefault (int field_index)=0 |
Get field default. | |
virtual ShapeIterator | begin ()=0 |
Get iterator to first shape. | |
virtual ShapeIterator | end ()=0 |
Get iterator to end of shape lib (a wrapper for NullShapeId). | |
virtual ShapeId | FindFirst ()=0 |
Fetch first shapeid in the layer. | |
virtual ShapeId | FindNext (ShapeId id)=0 |
Fetch the next shape id after the indicated shape id. | |
virtual void | GetVertices (ShapeId id, std::vector< ShapeVertex > &list)=0 |
Fetch the vertices for the indicated shape. | |
virtual void | GetFields (ShapeId id, std::vector< ShapeField > &list)=0 |
Fetch the fields for the indicated shape. |
Interface to PCIDSK vector segment.
The vector segment contains a set of vector features with a common set of attribute data (fields). Each feature has a numeric identifier (ShapeId), a set of field values, and a set of geometric vertices. The layer as a whole has a description of the attribute fields, and an RST (Representation Style Table).
The geometry and attribute fields of shapes can be fetched with the GetVertices() and GetFields() methods by giving the ShapeId of the desired feature. The set of shapeid's can be identified using the FindFirst(), and FindNext() methods or the STL compatible ShapeIterator (begin() and end() methods).
The PCIDSKSegment interface for the segment can be used to fetch the LAYER_TYPE metadata describing how the vertices should be interpreted as a geometry. Some layers will also have a RingStart attribute field which is used in conjunction with the LAYER_TYPE to interprete the geometry. Some vector segments may have no LAYER_TYPE metadata in which case single vertices are interpreted as points, and multiple vertices as linestrings.
More details are available in the GDB.HLP description of the GDB vector data model.
Note that there are no mechanisms for fast spatial or attribute searches in a PCIDSK vector segment. Accessing features randomly (rather than in the order shapeids are returned by FindFirst()/FindNext() or ShapeIterator ) may result in reduced performance, and the use of large amounts of memory for large vector segments.
virtual ShapeIterator PCIDSK::PCIDSKVectorSegment::begin | ( | ) | [pure virtual] |
Get iterator to first shape.
virtual ShapeIterator PCIDSK::PCIDSKVectorSegment::end | ( | ) | [pure virtual] |
Get iterator to end of shape lib (a wrapper for NullShapeId).
virtual ShapeId PCIDSK::PCIDSKVectorSegment::FindFirst | ( | ) | [pure virtual] |
Fetch first shapeid in the layer.
virtual ShapeId PCIDSK::PCIDSKVectorSegment::FindNext | ( | ShapeId | id | ) | [pure virtual] |
Fetch the next shape id after the indicated shape id.
id | the previous shapes id. |
virtual int PCIDSK::PCIDSKVectorSegment::GetFieldCount | ( | ) | [pure virtual] |
Get field count.
Note that this includes any system attributes, like RingStart, that would not normally be shown to the user.
virtual ShapeField PCIDSK::PCIDSKVectorSegment::GetFieldDefault | ( | int | field_index | ) | [pure virtual] |
Get field default.
field_index | index of the field requested from zero to GetFieldCount()-1. |
virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldDescription | ( | int | field_index | ) | [pure virtual] |
Get field description.
field_index | index of the field requested from zero to GetFieldCount()-1. |
virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldFormat | ( | int | field_index | ) | [pure virtual] |
Get field format.
field_index | index of the field requested from zero to GetFieldCount()-1. |
virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldName | ( | int | field_index | ) | [pure virtual] |
Get field name.
field_index | index of the field requested from zero to GetFieldCount()-1. |
virtual void PCIDSK::PCIDSKVectorSegment::GetFields | ( | ShapeId | id, |
std::vector< ShapeField > & | list | ||
) | [pure virtual] |
Fetch the fields for the indicated shape.
id | the shape to fetch |
list | the field list is updated with the field values for this shape. |
virtual ShapeFieldType PCIDSK::PCIDSKVectorSegment::GetFieldType | ( | int | field_index | ) | [pure virtual] |
Get field type.
field_index | index of the field requested from zero to GetFieldCount()-1. |
virtual std::string PCIDSK::PCIDSKVectorSegment::GetRst | ( | ) | [pure virtual] |
Fetch RST.
No attempt is made to parse the RST, it is up to the caller to decode it.
NOTE: There is some header info on RST format that may be needed to do this for older RSTs.
virtual void PCIDSK::PCIDSKVectorSegment::GetVertices | ( | ShapeId | id, |
std::vector< ShapeVertex > & | list | ||
) | [pure virtual] |
Fetch the vertices for the indicated shape.
id | the shape to fetch |
list | the list is updated with the vertices for this shape. |