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 std::vector< double > GetProjection (std::string &geosys)=0
 Fetch Projection.
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 int GetShapeCount ()=0
 Fetch the number of shapes in this segment.
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.
virtual void SetProjection (std::string geosys, std::vector< double > parms)=0
 Set the projection for the segment.
virtual void AddField (std::string name, ShapeFieldType type, std::string description, std::string format, ShapeField *default_value=NULL)=0
 Create new attribute field.
virtual ShapeId CreateShape (ShapeId id=NullShapeId)=0
 Create a new shape.
virtual void DeleteShape (ShapeId id)=0
 Delete a shape.
virtual void SetVertices (ShapeId id, const std::vector< ShapeVertex > &list)=0
 Assign vertices to shape.
virtual void SetFields (ShapeId id, const std::vector< ShapeField > &list)=0
 Assign attribute value to a 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 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 std::vector<double> PCIDSK::PCIDSKVectorSegment::GetProjection ( std::string &  geosys  )  [pure virtual]

Fetch Projection.

The returned values are the projection parameters in the same form returned by PCIDSKGeoref::GetParameters() and the passed in geosys argument is updated with the coordinate system string.

Returns:
Projection parameters as a vector.

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 std::string PCIDSK::PCIDSKVectorSegment::GetFieldName ( int  field_index  )  [pure virtual]

Get field name.

Parameters:
field_index index of the field requested from zero to GetFieldCount()-1.
Returns:
the field name.

virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldDescription ( int  field_index  )  [pure virtual]

Get field description.

Parameters:
field_index index of the field requested from zero to GetFieldCount()-1.
Returns:
the field description, often empty.

virtual ShapeFieldType PCIDSK::PCIDSKVectorSegment::GetFieldType ( int  field_index  )  [pure virtual]

Get field type.

Parameters:
field_index index of the field requested from zero to GetFieldCount()-1.
Returns:
the field type.

virtual std::string PCIDSK::PCIDSKVectorSegment::GetFieldFormat ( int  field_index  )  [pure virtual]

Get field format.

Parameters:
field_index index 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 ShapeField PCIDSK::PCIDSKVectorSegment::GetFieldDefault ( int  field_index  )  [pure virtual]

Get field default.

Parameters:
field_index index of the field requested from zero to GetFieldCount()-1.
Returns:
the field default value.

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

virtual int PCIDSK::PCIDSKVectorSegment::GetShapeCount (  )  [pure virtual]

Fetch the number of shapes in this segment.

Returns:
the shape count.

virtual void PCIDSK::PCIDSKVectorSegment::GetVertices ( ShapeId  id,
std::vector< ShapeVertex > &  list 
) [pure virtual]

Fetch the vertices for the indicated shape.

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

virtual void PCIDSK::PCIDSKVectorSegment::GetFields ( ShapeId  id,
std::vector< ShapeField > &  list 
) [pure virtual]

Fetch the fields for the indicated shape.

Parameters:
id the shape to fetch
list the field list is updated with the field values for this shape.

virtual void PCIDSK::PCIDSKVectorSegment::SetProjection ( std::string  geosys,
std::vector< double >  parms 
) [pure virtual]

Set the projection for the segment.

For details on the geosys and parms values see the PCIDSKGeoref class.

Parameters:
geosys the usual 16 character coordinate system string.
parms additional parameters needed for user parametrized projection.

virtual void PCIDSK::PCIDSKVectorSegment::AddField ( std::string  name,
ShapeFieldType  type,
std::string  description,
std::string  format,
ShapeField default_value = NULL 
) [pure virtual]

Create new attribute field.

Parameters:
name the field name, should be unique in layer.
type the field type.
description the field description.
format the C style format string or "" for default formatting.
default_value the default value for this field or NULL for system default.

virtual ShapeId PCIDSK::PCIDSKVectorSegment::CreateShape ( ShapeId  id = NullShapeId  )  [pure virtual]

Create a new shape.

Newly created shapes have no geometry or attribute values.

Parameters:
id The ShapeId to assign to the new shape, or default to assign the next available shapeid.
Returns:
the shapeid assigned to the newly created shape.

virtual void PCIDSK::PCIDSKVectorSegment::DeleteShape ( ShapeId  id  )  [pure virtual]

Delete a shape.

An exception is thrown if the shape does not exist.

Parameters:
id the shapeid to delete.

virtual void PCIDSK::PCIDSKVectorSegment::SetVertices ( ShapeId  id,
const std::vector< ShapeVertex > &  list 
) [pure virtual]

Assign vertices to shape.

Parameters:
id the shape to assign vertices to.
list the list of vertices to assign.

virtual void PCIDSK::PCIDSKVectorSegment::SetFields ( ShapeId  id,
const std::vector< ShapeField > &  list 
) [pure virtual]

Assign attribute value to a shape.

The list of fields should match the types and length from the schema (GetFieldCount(), GetFieldType()).

Parameters:
id the shape to update.
list the list of field value to assign.


The documentation for this class was generated from the following file:
Generated on Fri Jul 16 16:01:31 2010 for libpcidsk by  doxygen 1.5.1