PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 59 of file measures3d.c.

60{
61
62 LWPOINT *lwpoints[2];
63 GBOX gbox;
64 int rv = lwgeom_calculate_gbox(lwgeom, &gbox);
65
66 if (rv == LW_FAILURE)
67 return NULL;
68
69 lwpoints[0] = lwpoint_make3dz(srid, x, y, gbox.zmin);
70 lwpoints[1] = lwpoint_make3dz(srid, x, y, gbox.zmax);
71
72 return (LWGEOM *)lwline_from_ptarray(srid, 2, lwpoints);
73}
LWPOINT * lwpoint_make3dz(int32_t srid, double x, double y, double z)
Definition lwpoint.c:173
#define LW_FAILURE
Definition liblwgeom.h:110
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:737
LWLINE * lwline_from_ptarray(int32_t srid, uint32_t npoints, LWPOINT **points)
Definition lwline.c:228
double zmax
Definition liblwgeom.h:345
double zmin
Definition liblwgeom.h:344

References LW_FAILURE, lwgeom_calculate_gbox(), lwline_from_ptarray(), lwpoint_make3dz(), 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: