PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ create_v_line()

static LWGEOM* create_v_line ( const LWGEOM lwgeom,
double  x,
double  y,
int32_t  srid 
)
static

This function is used to create a vertical line used for cases where one if the geometries lacks z-values.

The vertical line crosses the 2d point that is closest and the z-range is from maxz to minz in the geometry that has z values.

Definition at line 93 of file measures3d.c.

94 {
95 
96  LWPOINT *lwpoints[2];
97  GBOX gbox;
98  int rv = lwgeom_calculate_gbox(lwgeom, &gbox);
99 
100  if (rv == LW_FAILURE)
101  return NULL;
102 
103  lwpoints[0] = lwpoint_make3dz(srid, x, y, gbox.zmin);
104  lwpoints[1] = lwpoint_make3dz(srid, x, y, gbox.zmax);
105 
106  return (LWGEOM *)lwline_from_ptarray(srid, 2, lwpoints);
107 }
LWLINE * lwline_from_ptarray(int32_t srid, uint32_t npoints, LWPOINT **points)
Definition: lwline.c:228
#define LW_FAILURE
Definition: liblwgeom.h:96
LWPOINT * lwpoint_make3dz(int32_t srid, double x, double y, double z)
Definition: lwpoint.c:173
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate bounding box of a geometry, automatically taking into account whether it is cartesian or ge...
Definition: lwgeom.c:755
double zmax
Definition: liblwgeom.h:359
double zmin
Definition: liblwgeom.h:358

References LW_FAILURE, lwgeom_calculate_gbox(), lwline_from_ptarray(), lwpoint_make3dz(), pixval::x, pixval::y, GBOX::zmax, and GBOX::zmin.

Referenced by lw_dist3d_distanceline(), and lw_dist3d_distancepoint().

Here is the call graph for this function:
Here is the caller graph for this function: