PostGIS  2.1.10dev-r@@SVN_REVISION@@
int lw_dist2d_distribute_fast ( LWGEOM lwg1,
LWGEOM lwg2,
DISTPTS dl 
)

Here the geometries are distributed for the new faster distance-calculations.

Definition at line 482 of file measures.c.

References LWGEOM::bbox, LINETYPE, lw_dist2d_fast_ptarray_ptarray(), LW_FALSE, LWDEBUGF, lwerror(), lwtype_name(), POLYGONTYPE, DISTPTS::twisted, and LWGEOM::type.

Referenced by lw_dist2d_recursive().

483 {
484  POINTARRAY *pa1, *pa2;
485  int type1 = lwg1->type;
486  int type2 = lwg2->type;
487 
488  LWDEBUGF(2, "lw_dist2d_distribute_fast is called with typ1=%d, type2=%d", lwg1->type, lwg2->type);
489 
490  switch (type1)
491  {
492  case LINETYPE:
493  pa1 = ((LWLINE *)lwg1)->points;
494  break;
495  case POLYGONTYPE:
496  pa1 = ((LWPOLY *)lwg1)->rings[0];
497  break;
498  default:
499  lwerror("Unsupported geometry1 type: %s", lwtype_name(type1));
500  return LW_FALSE;
501  }
502  switch (type2)
503  {
504  case LINETYPE:
505  pa2 = ((LWLINE *)lwg2)->points;
506  break;
507  case POLYGONTYPE:
508  pa2 = ((LWPOLY *)lwg2)->rings[0];
509  break;
510  default:
511  lwerror("Unsupported geometry2 type: %s", lwtype_name(type1));
512  return LW_FALSE;
513  }
514  dl->twisted=1;
515  return lw_dist2d_fast_ptarray_ptarray(pa1, pa2, dl, lwg1->bbox, lwg2->bbox);
516 }
#define LINETYPE
Definition: liblwgeom.h:61
GBOX * bbox
Definition: liblwgeom.h:354
#define POLYGONTYPE
Definition: liblwgeom.h:62
int lw_dist2d_fast_ptarray_ptarray(POINTARRAY *l1, POINTARRAY *l2, DISTPTS *dl, GBOX *box1, GBOX *box2)
The new faster calculation comparing pointarray to another pointarray the arrays can come from both p...
Definition: measures.c:1750
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
#define LW_FALSE
Definition: liblwgeom.h:52
int twisted
Definition: measures.h:27
uint8_t type
Definition: liblwgeom.h:352
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the call graph for this function:

Here is the caller graph for this function: