[gdal-dev] How to get the size of a OGRGeometry

Jorge Arévalo jorge.arevalo at gmail.com
Tue Jul 7 18:19:52 EDT 2009


Hello,

If I have an OGRGeometry object (said poGeom), I can get its coords by:

OGREnvelope * poE = new OGREnvelope();
poGeom->getEnvelope(poE);

// poE->MinX, poE->MinY, poE->MaxX, poE->MaxY are the limit coords

If I want the size of the Geometry:

double dSizeX = poE->MaxX - poE->MinX;
double dSizeY = poE->MaxY - poE->MinY;

Is it the correct way?

Thanks in advance
Jorge


More information about the gdal-dev mailing list