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