libpcidsk
Public Member Functions
PCIDSK::PCIDSKVectorSegment Class Reference

Interface to PCIDSK vector segment. More...

#include <pcidsk_vectorsegment.h>

List of all members.

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.

Detailed Description

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.


Member Function Documentation

virtual ShapeIterator PCIDSK::PCIDSKVectorSegment::begin ( ) [pure virtual]

Get iterator to first shape.

Returns:
iterator.
virtual ShapeIterator PCIDSK::PCIDSKVectorSegment::end ( ) [pure virtual]

Get iterator to end of shape lib (a wrapper for NullShapeId).

Returns:
iterator.
virtual ShapeId PCIDSK::PCIDSKVectorSegment::FindFirst ( ) [pure virtual]

Fetch first shapeid in the layer.

Returns:
first shape's shapeid.
virtual ShapeId PCIDSK::PCIDSKVectorSegment::FindNext ( ShapeId  id) [pure virtual]

Fetch the next shape id after the indicated shape id.

Parameters:
idthe previous shapes id.
Returns:
next shape's shapeid.
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.

Returns:
the number of attribute fields defined on this layer.
virtual ShapeField PCIDSK::PCIDSKVectorSegment::GetFieldDefault ( int  field_index) [pure virtual]

Get field default.

Parameters:
field_indexindex of the field requested from zero to GetFieldCount()-1.
Returns:
the field default value.
virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldDescription ( int  field_index) [pure virtual]

Get field description.

Parameters:
field_indexindex of the field requested from zero to GetFieldCount()-1.
Returns:
the field description, often empty.
virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldFormat ( int  field_index) [pure virtual]

Get field format.

Parameters:
field_indexindex of the field requested from zero to GetFieldCount()-1.
Returns:
the field format as a C style format string suitable for use with printf.
virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldName ( int  field_index) [pure virtual]

Get field name.

Parameters:
field_indexindex of the field requested from zero to GetFieldCount()-1.
Returns:
the field name.
virtual void PCIDSK::PCIDSKVectorSegment::GetFields ( ShapeId  id,
std::vector< ShapeField > &  list 
) [pure virtual]

Fetch the fields for the indicated shape.

Parameters:
idthe shape to fetch
listthe field list is updated with the field values for this shape.
virtual ShapeFieldType PCIDSK::PCIDSKVectorSegment::GetFieldType ( int  field_index) [pure virtual]

Get field type.

Parameters:
field_indexindex of the field requested from zero to GetFieldCount()-1.
Returns:
the field type.
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.

Returns:
RST as a string.
virtual void PCIDSK::PCIDSKVectorSegment::GetVertices ( ShapeId  id,
std::vector< ShapeVertex > &  list 
) [pure virtual]

Fetch the vertices for the indicated shape.

Parameters:
idthe shape to fetch
listthe list is updated with the vertices for this shape.

The documentation for this class was generated from the following file:

Generated for GDAL by doxygen 1.7.5.