71 if ( ! triangle )
return;
85 lwerror(
"printLWTRIANGLE called with something else than a Triangle");
101 LWDEBUGF(2,
"lwtriangle_clone called with %p", g);
159 lwerror(
"lwtriangle_from_lwline: shell must have exactly 4 points");
163 lwerror(
"lwtriangle_from_lwline: shell must be closed");
169 lwerror(
"lwtriangle_from_lwline: some points are repeated in triangle");
198 area += ( p1.
x * p2.
y ) - ( p1.
y * p2.
x );
uint8_t gflags(int hasz, int hasm, int geodetic)
Construct a new flags char.
int ptarray_is_closed_3d(const POINTARRAY *pa)
#define FLAGS_SET_BBOX(flags, value)
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
void printPA(POINTARRAY *pa)
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
double ptarray_length_2d(const POINTARRAY *pts)
Find the 2d length of the given POINTARRAY (even if it's 3d)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
#define FLAGS_NDIMS(flags)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
void ptarray_free(POINTARRAY *pa)
void * lwalloc(size_t size)
int ptarray_is_closed_2d(const POINTARRAY *pa)
LWGEOM * lwtriangle_as_lwgeom(const LWTRIANGLE *obj)
#define LW_TRUE
Return types for functions with status returns.
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
void ptarray_reverse_in_place(POINTARRAY *pa)
LWLINE * lwline_clone(const LWLINE *lwgeom)
double ptarray_length(const POINTARRAY *pts)
Find the 3d/2d length of the given POINTARRAY (depending on its dimensionality)
char ptarray_same(const POINTARRAY *pa1, const POINTARRAY *pa2)
POINTARRAY * ptarray_remove_repeated_points(const POINTARRAY *in, double tolerance)
int ptarray_isccw(const POINTARRAY *pa)
Datum area(PG_FUNCTION_ARGS)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
double lwtriangle_area(const LWTRIANGLE *triangle)
Find the area of the outer ring.
double lwtriangle_perimeter_2d(const LWTRIANGLE *triangle)
LWTRIANGLE * lwtriangle_clone(const LWTRIANGLE *g)
int lwtriangle_is_clockwise(LWTRIANGLE *triangle)
double lwtriangle_perimeter(const LWTRIANGLE *triangle)
LWTRIANGLE * lwtriangle_from_lwline(const LWLINE *shell)
char lwtriangle_same(const LWTRIANGLE *t1, const LWTRIANGLE *t2)
void lwtriangle_force_clockwise(LWTRIANGLE *triangle)
static char lwtriangle_is_repeated_points(LWTRIANGLE *triangle)
int lwtriangle_is_empty(const LWTRIANGLE *triangle)
void lwtriangle_free(LWTRIANGLE *triangle)
LWTRIANGLE * lwtriangle_construct(int srid, GBOX *bbox, POINTARRAY *points)
void printLWTRIANGLE(LWTRIANGLE *triangle)
LWTRIANGLE * lwtriangle_construct_empty(int srid, char hasz, char hasm)
void lwtriangle_release(LWTRIANGLE *lwtriangle)