PolygonZ

A PolygonZ consists of a number of rings. A ring is a closed, non-self-intersecting loop. A PolygonZ may contain multiple outer rings. The rings of a PolygonZ are referred to as its parts.

The following fields are for a PolygonZ:
Box
The bounding box for the PolygonZ stored in the order Xmin, Ymin, Xmax, Ymax
NumParts
The number of rings in the PolygonZ
NumPoints
The total number of points for all rings
Parts
An array of length NumParts

Stores, for each ring, the index of its first point in the points array. Array indexes are numbered with respect to 0.

Points
An array of length NumPoints

The points for each ring in the PolygonZ are stored end to end. The points for ring 2 follow the points for ring 1, and so on. The parts array holds the array index of the starting point for each ring. There is no delimiter in the points array between rings.

Z Range
The minimum and maximum Z values for the PolygonZ stored in the order Zmin, Zmax
Z Array
An array of length NumPoints

The Z values for each ring in the PolygonZ are stored end to end. The Z values for ring 2 follow the Z values for ring 1, and so on. The parts array holds the array index of the starting Z value for each ring. There is no delimiter in the Z value array between rings.

The following are important notes about PolygonZ shapes:
  • The rings are closed (the first and last vertex of a ring must be the same).
  • The order of rings in the points array is not significant.
The following table shows PolygonZ byte stream contents.
Position Field Value Type Number Byte order
Byte 0 Shape Type 19 Integer 1 Little endian
Byte 4 Box Box Double 4 Little endian
Byte 36 NumParts NumParts Integer 1 Little endian
Byte 40 NumPoints NumPoints Integer 1 Little endian
Byte 44 Parts Parts Integer NumParts Little endian
Byte X Points Points Point NumPoints Little endian
Byte Y Zmin Zmin Double 1 Little endian
Byte Y+8 Zmax Zmax Double 1 Little endian
Byte Y+16 Z Array Z Array Double NumPoints Little endian
Tip: X = 44 + (4 * NumParts), Y = X + (16 * NumPoints)