MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
MgPoint Class Reference

An MgPoint is a 0-dimensional geometry and represents a single location in coordinate space. More...

+ Inheritance diagram for MgPoint:

List of all members.

Public Member Functions

virtual MgGeometricEntityCopy ()
virtual MgCoordinateGetCoordinate ()
 
virtual MgCoordinateIteratorGetCoordinates ()
 Returns an iterator over the coordinates included in this geometric entity.
virtual INT32 GetDimension ()
 
virtual INT32 GetGeometryType ()
virtual bool IsClosed ()
virtual bool IsEmpty ()
 
virtual MgGeometricEntityTransform (MgTransform *transform)
 Returns a transformed copy of this geometric entity.

Detailed Description

An MgPoint is a 0-dimensional geometry and represents a single location in coordinate space.

Remarks:
An instance of this class is constructed by calling a non-static MgGeometryFactory::CreatePoint() method and, once constructed, is immutable.
Example (PHP)
The following code shows the construction of a point

 $geometryFactory = new MgGeometryFactory();

 // create a coordinate
 $oordinate = $geometryFactory->CreateCoordinateXY(0,2);

 // create a point
 $point = $geometryFactory->CreatePoint($coordinate);

 // print out the Agf Text string for the geometry
 $pointAgfText = $wktReaderWriter->Write($point);
 echo "AGF Text representation of Point: $pointAgfText\n";
Example (C#)
 using OSGeo.MapGuide;

 private MgPoint pt11;
 private MgPoint pt11FromText;
 private String pt11TextSpec = "POINT XY ( 1 1 )";
 private MgWktReaderWriter wktReaderWriter;
 private MgGeometryFactory geometryFactory;
 private String geometryAgfText;


 public MgPoint CreateAPointXY(double x, double y)
 {
     MgCoordinate coord = geometryFactory.CreateCoordinateXY(x, y);
     return geometryFactory.CreatePoint(coord);
 }

 wktReaderWriter = new MgWktReaderWriter();
 geometryFactory = new MgGeometryFactory();
 // create a geometry using the geometry factory
 pt11 = CreateAPointXY(1, 1);
 // create a geometry from an Agf textual specification
 pt11FromText = wktReaderWriter.Read(pt11TextSpec) as MgPoint;
 // print out the Agf Text string for the geometry
 geometryAgfText = wktReaderWriter.Write(pt11);
 // geometryAgfText now contains:
 // "POINT XY ( 1 1 )"