PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ create_v_line()

static LWGEOM* create_v_line ( const LWGEOM lwgeom,
double  x,
double  y,
int  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 geoemtrie that has z values.

Definition at line 71 of file measures3d.c.

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().

72 {
73 
74  LWPOINT *lwpoints[2];
75  GBOX gbox;
76  int rv = lwgeom_calculate_gbox(lwgeom, &gbox);
77 
78  if ( rv == LW_FAILURE )
79  return NULL;
80 
81  lwpoints[0] = lwpoint_make3dz(srid, x, y, gbox.zmin);
82  lwpoints[1] = lwpoint_make3dz(srid, x, y, gbox.zmax);
83 
84  return (LWGEOM *)lwline_from_ptarray(srid, 2, lwpoints);
85 }
LWLINE * lwline_from_ptarray(int srid, uint32_t npoints, LWPOINT **points)
Definition: lwline.c:243
#define LW_FAILURE
Definition: liblwgeom.h:79
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:701
double zmax
Definition: liblwgeom.h:297
LWPOINT * lwpoint_make3dz(int srid, double x, double y, double z)
Definition: lwpoint.c:173
double zmin
Definition: liblwgeom.h:296
Here is the call graph for this function:
Here is the caller graph for this function: