PostGIS  2.1.10dev-r@@SVN_REVISION@@
void SHPAPI_CALL SHPComputeExtents ( SHPObject psObject)

Definition at line 1000 of file shpopen.c.

References SHPObject::dfMMax, SHPObject::dfMMin, SHPObject::dfXMax, SHPObject::dfXMin, SHPObject::dfYMax, SHPObject::dfYMin, SHPObject::dfZMax, SHPObject::dfZMin, MAX, MIN, SHPObject::nVertices, SHPObject::padfM, SHPObject::padfX, SHPObject::padfY, and SHPObject::padfZ.

1002 {
1003  int i;
1004 
1005 /* -------------------------------------------------------------------- */
1006 /* Build extents for this object. */
1007 /* -------------------------------------------------------------------- */
1008  if( psObject->nVertices > 0 )
1009  {
1010  psObject->dfXMin = psObject->dfXMax = psObject->padfX[0];
1011  psObject->dfYMin = psObject->dfYMax = psObject->padfY[0];
1012  psObject->dfZMin = psObject->dfZMax = psObject->padfZ[0];
1013  psObject->dfMMin = psObject->dfMMax = psObject->padfM[0];
1014  }
1015 
1016  for( i = 0; i < psObject->nVertices; i++ )
1017  {
1018  psObject->dfXMin = MIN(psObject->dfXMin, psObject->padfX[i]);
1019  psObject->dfYMin = MIN(psObject->dfYMin, psObject->padfY[i]);
1020  psObject->dfZMin = MIN(psObject->dfZMin, psObject->padfZ[i]);
1021  psObject->dfMMin = MIN(psObject->dfMMin, psObject->padfM[i]);
1022 
1023  psObject->dfXMax = MAX(psObject->dfXMax, psObject->padfX[i]);
1024  psObject->dfYMax = MAX(psObject->dfYMax, psObject->padfY[i]);
1025  psObject->dfZMax = MAX(psObject->dfZMax, psObject->padfZ[i]);
1026  psObject->dfMMax = MAX(psObject->dfMMax, psObject->padfM[i]);
1027  }
1028 }
int nVertices
Definition: shapefil.h:349
double dfZMax
Definition: shapefil.h:362
double dfZMin
Definition: shapefil.h:357
double * padfX
Definition: shapefil.h:350
#define MIN(a, b)
Definition: shpopen.c:284
double * padfY
Definition: shapefil.h:351
double dfYMin
Definition: shapefil.h:356
double dfXMax
Definition: shapefil.h:360
double dfXMin
Definition: shapefil.h:355
#define MAX(a, b)
Definition: shpopen.c:285
double * padfZ
Definition: shapefil.h:352
double dfMMax
Definition: shapefil.h:363
double dfYMax
Definition: shapefil.h:361
double * padfM
Definition: shapefil.h:353
double dfMMin
Definition: shapefil.h:358