645{
646
653
654
656 {
659 }
660 else
661 {
664 }
665
666
668 {
669 double m1 = 0, m2 = 0;
670 int usebox = false;
671
673
675 {
679 }
681 {
685 }
686 else
687 usebox = true;
688
690 {
694 }
696 {
700 }
701 else
702 usebox = true;
703
704 if (usebox)
705 {
708 {
709 double d;
710
713
716
717 else
718 d = 0;
720 }
721 }
722 else
724
726 }
727
729
730 PG_FREE_IF_COPY(geom1, 0);
731 PG_FREE_IF_COPY(geom2, 1);
733}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Read the box from the GSERIALIZED or calculate it if necessary.
int lwpoint_getPoint4d_p(const LWPOINT *point, POINT4D *out)
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwgeom_closest_line(const LWGEOM *lw1, const LWGEOM *lw2)
LWPOINT * lwline_get_lwpoint(const LWLINE *line, uint32_t where)
Returns freshly allocated LWPOINT that corresponds to the index where.
double lwgeom_interpolate_point(const LWGEOM *lwin, const LWPOINT *lwpt)
Find the measure value at the location on the line closest to the point.
double lwgeom_length(const LWGEOM *geom)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
double lwgeom_length_2d(const LWGEOM *geom)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWGEOM * lwgeom_closest_line_3d(const LWGEOM *lw1, const LWGEOM *lw2)
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
static double distance(double x1, double y1, double x2, double y2)