PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ST_LineCrossingDirection()

Datum ST_LineCrossingDirection ( PG_FUNCTION_ARGS  )

Definition at line 475 of file lwgeom_functions_analytic.c.

476 {
477  int type1, type2, rv;
478  LWLINE *l1 = NULL;
479  LWLINE *l2 = NULL;
480  GSERIALIZED *geom1 = PG_GETARG_GSERIALIZED_P(0);
481  GSERIALIZED *geom2 = PG_GETARG_GSERIALIZED_P(1);
482 
483  gserialized_error_if_srid_mismatch(geom1, geom2, __func__);
484 
485  type1 = gserialized_get_type(geom1);
486  type2 = gserialized_get_type(geom2);
487 
488  if ( type1 != LINETYPE || type2 != LINETYPE )
489  {
490  elog(ERROR,"This function only accepts LINESTRING as arguments.");
491  PG_RETURN_NULL();
492  }
493 
496 
497  rv = lwline_crossing_direction(l1, l2);
498 
499  PG_FREE_IF_COPY(geom1, 0);
500  PG_FREE_IF_COPY(geom2, 1);
501 
502  PG_RETURN_INT32(rv);
503 
504 }
void gserialized_error_if_srid_mismatch(const GSERIALIZED *g1, const GSERIALIZED *g2, const char *funcname)
Definition: gserialized.c:404
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
Definition: gserialized.c:89
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
Definition: lwgeom.c:161
#define LINETYPE
Definition: liblwgeom.h:117
int lwline_crossing_direction(const LWLINE *l1, const LWLINE *l2)
Given two lines, characterize how (and if) they cross each other.
Definition: lwalgorithm.c:462

References gserialized_error_if_srid_mismatch(), gserialized_get_type(), LINETYPE, lwgeom_as_lwline(), lwgeom_from_gserialized(), and lwline_crossing_direction().

Here is the call graph for this function: