MapGuide API Reference
|
An MgPoint is a 0-dimensional geometry and represents a single location in coordinate space. More...
Public Member Functions | |
virtual MgGeometricEntity * | Copy () |
virtual MgCoordinate * | GetCoordinate () |
virtual MgCoordinateIterator * | GetCoordinates () |
Returns an iterator over the coordinates included in this geometric entity. | |
virtual INT32 | GetDimension () |
virtual INT32 | GetGeometryType () |
virtual bool | IsClosed () |
virtual bool | IsEmpty () |
virtual MgGeometricEntity * | Transform (MgTransform *transform) |
Returns a transformed copy of this geometric entity. |
An MgPoint is a 0-dimensional geometry and represents a single location in coordinate space.
$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";
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 )"