PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum intersects3d_dwithin ( PG_FUNCTION_ARGS  )

Definition at line 177 of file lwgeom_backend_api.c.

References lwgeom_from_gserialized(), lwgeom_mindistance3d_tolerance(), and LWGEOM::srid.

178 {
179  double mindist;
180  GSERIALIZED *geom1 = (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
181  GSERIALIZED *geom2 = (GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
182  LWGEOM *lwgeom1 = lwgeom_from_gserialized(geom1);
183  LWGEOM *lwgeom2 = lwgeom_from_gserialized(geom2);
184 
185  if (lwgeom1->srid != lwgeom2->srid)
186  {
187  elog(ERROR,"Operation on two GEOMETRIES with different SRIDs\n");
188  PG_RETURN_NULL();
189  }
190 
191  mindist = lwgeom_mindistance3d_tolerance(lwgeom1,lwgeom2,0.0);
192 
193  PG_FREE_IF_COPY(geom1, 0);
194  PG_FREE_IF_COPY(geom2, 1);
195  /*empty geometries cases should be right handled since return from underlying
196  functions should be MAXFLOAT which causes false as answer*/
197  PG_RETURN_BOOL(0.0 == mindist);
198 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int32_t srid
Definition: liblwgeom.h:355
double lwgeom_mindistance3d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance)
Function handling 3d min distance calculations and dwithin calculations.
Definition: measures3d.c:164

Here is the call graph for this function: