PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ SHPComputeExtents()

void SHPAPI_CALL SHPComputeExtents ( SHPObject psObject)

Definition at line 999 of file shpopen.c.

References bHasZ, SHPObject::dfMMax, SHPObject::dfMMin, SHPObject::dfXMax, SHPObject::dfXMin, SHPObject::dfYMax, SHPObject::dfYMin, SHPObject::dfZMax, SHPObject::dfZMin, MAX, MIN, nShapeId, nSHPType, SHPObject::nVertices, nVertices, SHPObject::padfM, SHPObject::padfX, SHPObject::padfY, SHPObject::padfZ, SHPAPI_CALL1, and SHPCreateObject().

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