SDTSRawPolygon Class Reference

#include <sdts_al.h>

Inheritance diagram for SDTSRawPolygon:
SDTSFeature

List of all members.

Public Member Functions

int AssembleRings ()
virtual void Dump (FILE *)

Public Attributes

int nRings
int nVertices
int * panRingStart
double * padfX
double * padfY
double * padfZ

Detailed Description

Class for holding information about a polygon feature.

When directly read from a polygon module, the polygon has no concept of it's geometry. Just it's ID, and references to attribute records. However, if the SDTSLineReader::AttachToPolygons() method is called on the module containing the lines forming the polygon boundaries, then the nEdges/papoEdges information on the SDTSRawPolygon will be filled in.

Once this is complete the AssembleRings() method can be used to fill in the nRings/nVertices/panRingStart/padfX/padfY/padfZ information defining the ring geometry.

Note that the rings may not appear in any particular order, nor with any meaningful direction (clockwise or counterclockwise).


Member Function Documentation

int SDTSRawPolygon::AssembleRings (  ) 

This method will assemble the edges associated with a polygon into rings, returning FALSE if problems are encountered during assembly.

Form border lines (arcs) into outer and inner rings.

See SDTSPolygonReader::AssemblePolygons() for a simple one step process to assembling geometry for all polygons in a transfer.

This method will assemble the lines attached to a polygon into an outer ring, and zero or more inner rings. Before calling it is necessary that all the lines associated with this polygon have already been attached. Normally this is accomplished by calling SDTSLineReader::AttachToPolygons() on all line layers that might contain edges related to this layer.

This method then forms the lines into rings. Rings are formed by:

  1. Take a previously unconsumed line, and start a ring with it. Mark it as consumed, and keep track of it's start and end node ids as being the start and end node ids of the ring.
  2. If the rings start id is the same as the end node id then this ring is completely formed, return to step 1.
  3. Search all unconsumed lines for a line with the same start or end node id as the rings current node id. If none are found then the assembly has failed. Return to step 1 but report failure on completion.
  4. Once found, add the line to the current ring, dropping the duplicated vertex and reverse order if necessary. Mark the line as consumed, and update the rings end node id accordingly.
  5. go to step 2.

Once ring assembly from lines is complete, another pass is made to order the rings such that the exterior ring is first, the first ring has counter-clockwise vertex ordering and the inner rings have clockwise vertex ordering. This is accomplished based on the assumption that the outer ring has the largest area, and using the +/- sign of area to establish direction of rings.

Returns:
TRUE if all rings assembled without problems or FALSE if a problem occured. If a problem occurs rings are still formed from all lines, but some of the rings will not be closed, and rings will have no particular order or direction.
void SDTSRawPolygon::Dump ( FILE *   )  [virtual]

Dump reable description of feature to indicated stream.

Implements SDTSFeature.


Member Data Documentation

Number of rings in assembled polygon.

Total number of vertices in all rings of assembled polygon.

List of nVertices X coordinates for the polygon (split over multiple rings via panRingStart.

List of nVertices Y coordinates for the polygon (split over multiple rings via panRingStart.

List of nVertices Z coordinates for the polygon (split over multiple rings via panRingStart. The values are almost always zero.

Offsets into padfX/padfY/padfZ for the beginning of each ring in the polygon. This array is nRings long.


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

Generated on 2 Aug 2014 for SDTS_AL by  doxygen 1.6.1