Representation of Geometry

AutoCAD Map 3D Geospatial Platform API

 
Representation of Geometry
 
 
 

AutoCAD Map 3D can represent geometric data in 3 different forms:

  • AGF text format, which is an extension of the Open Geospatial Consortium (OGC) Well Known Text (WKT) format. This is used to represent geometry as a character string.
  • Binary AGF format. The is used by the FDO technology supporting the Feature Service.
  • Internal representation, using MgGeometry and classes derived from it.

To convert between AGF text and the internal representation, use an MgWktReaderWriter object. Call MgWktReaderWriter.Read() to convert AGF text to MgGeometry. Call MgWktReaderWriter.Write() to convert MgGeometry to AGF text.

To convert between binary AGF and the internal representation, use an MgAgfReaderWriter object. Call MgAgfReaderWriter.Read() to convert binary AGF to MgGeometry. Call MgAgfReaderWriter.Write() to convert MgGeometry to binary AGF.

For example, if you have a WKT representation of the geometry, you could create a geometry object as follows:

MgWktReaderWriter wktReaderWriter = new MgWktReaderWriter();
MgGeometry geometry = wktReaderWriter.Read(wktGeometry);