PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_maxdistance3d()

Datum LWGEOM_maxdistance3d ( PG_FUNCTION_ARGS  )

Definition at line 1012 of file lwgeom_functions_basic.c.

1013 {
1014  double maxdist;
1015  GSERIALIZED *geom1 = PG_GETARG_GSERIALIZED_P(0);
1016  GSERIALIZED *geom2 = PG_GETARG_GSERIALIZED_P(1);
1017  LWGEOM *lwgeom1 = lwgeom_from_gserialized(geom1);
1018  LWGEOM *lwgeom2 = lwgeom_from_gserialized(geom2);
1019 
1020  error_if_srid_mismatch(lwgeom1->srid, lwgeom2->srid);
1021 
1022  maxdist = lwgeom_maxdistance3d(lwgeom1, lwgeom2);
1023 
1024  PG_FREE_IF_COPY(geom1, 0);
1025  PG_FREE_IF_COPY(geom2, 1);
1026 
1027  /*if called with empty geometries the ingoing mindistance is untouched, and makes us return NULL*/
1028  if (maxdist>-1)
1029  PG_RETURN_FLOAT8(maxdist);
1030 
1031  PG_RETURN_NULL();
1032 }
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:338
double lwgeom_maxdistance3d(const LWGEOM *lw1, const LWGEOM *lw2)
Function initializing 3d max distance calculation.
Definition: measures3d.c:314
int32_t srid
Definition: liblwgeom.h:402

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

Here is the call graph for this function: