Work with vertex attributes


About work with vertex attributes

Each vertex of a geometry, in addition to its x,y coordinates, can optionally have additional attributes, or vertex attributes.
The z-vertex attribute is a double-precision value that can be used to represent heights or depths relative to a vertical coordinate system. The m-vertex attribute, or measure, is a double-precision value that can be used to establish a linear reference system on a geometry (usually a polyline), such as the exits along a highway. The ID vertex attribute, or point ID, is a signed integer that can be used as a foreign database key to associate additional information with each vertex such as survey measurements.
The ID attribute is a numeric label but does not serve any computational purpose. Vertex attributes can be added to, or removed from, any geometry at any time and in any combination. For example, a polyline can start with no vertex attributes, have Zs added to it, have IDs added to it, then have its Zs removed.
When a geometry is aware of its vertex attributes, those attributes are persisted as part of the geometry and included in the output of topological operations that involve that geometry. If a geometry is not aware of its attributes, those attributes are ignored when the geometry is persisted and the attributes do not appear in the output of a topological operation involving that geometry. The attribute awareness of a geometry is controlled by one of the interfaces IZAware, IMAware, and IPointIDAware. The attribute values are not actually removed from a geometry if its awareness is disabled.
See the following code example:
[Java]
IPoint pnt = new Point();
pnt.putCoords(1, 1);
IZAware zAware = (IZAware)pnt;
zAware.setZAware(true);
pnt.setZ(11.1);