PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ SHPComputeExtents()

void SHPAPI_CALL SHPComputeExtents ( SHPObject psObject)

Definition at line 999 of file shpopen.c.

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 }
#define MIN(a, b)
Definition: shpopen.c:283
#define MAX(a, b)
Definition: shpopen.c:284
double dfZMin
Definition: shapefil.h:356
double dfZMax
Definition: shapefil.h:361
double dfXMax
Definition: shapefil.h:359
double dfYMax
Definition: shapefil.h:360
double dfMMin
Definition: shapefil.h:357
int nVertices
Definition: shapefil.h:348
double dfMMax
Definition: shapefil.h:362
double dfYMin
Definition: shapefil.h:355
double * padfZ
Definition: shapefil.h:351
double * padfX
Definition: shapefil.h:349
double * padfM
Definition: shapefil.h:352
double dfXMin
Definition: shapefil.h:354
double * padfY
Definition: shapefil.h:350

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.