PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ LWGEOM_maxdistance3d()

Datum LWGEOM_maxdistance3d ( PG_FUNCTION_ARGS  )

Definition at line 993 of file lwgeom_functions_basic.c.

References error_if_srid_mismatch(), lwgeom_from_gserialized(), LWGEOM_longitude_shift(), lwgeom_maxdistance3d(), PG_FUNCTION_INFO_V1(), and LWGEOM::srid.

Referenced by LWGEOM_dfullywithin3d().

994 {
995  double maxdist;
996  GSERIALIZED *geom1 = PG_GETARG_GSERIALIZED_P(0);
997  GSERIALIZED *geom2 = PG_GETARG_GSERIALIZED_P(1);
998  LWGEOM *lwgeom1 = lwgeom_from_gserialized(geom1);
999  LWGEOM *lwgeom2 = lwgeom_from_gserialized(geom2);
1000 
1001  error_if_srid_mismatch(lwgeom1->srid, lwgeom2->srid);
1002 
1003  maxdist = lwgeom_maxdistance3d(lwgeom1, lwgeom2);
1004 
1005  PG_FREE_IF_COPY(geom1, 0);
1006  PG_FREE_IF_COPY(geom2, 1);
1007 
1008  /*if called with empty geometries the ingoing mindistance is untouched, and makes us return NULL*/
1009  if (maxdist>-1)
1010  PG_RETURN_FLOAT8(maxdist);
1011 
1012  PG_RETURN_NULL();
1013 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void error_if_srid_mismatch(int srid1, int srid2)
Definition: lwutil.c:341
int32_t srid
Definition: liblwgeom.h:383
double lwgeom_maxdistance3d(const LWGEOM *lw1, const LWGEOM *lw2)
Function initializing 3d max distance calculation.
Definition: measures3d.c:290
Here is the call graph for this function:
Here is the caller graph for this function: