2687{
2691
2692 switch (lwgeom->
type)
2693 {
2697 }
2702 else
2703 {
2711
2712 return (
LWGEOM *)lwmpoint;
2713 }
2714 }
2719 uint32_t n = 0;
2720
2721 for (uint32_t i = 0; i < lwmline->
ngeoms; i++)
2722 {
2724 if (!points)
2725 continue;
2726
2727 for (uint32_t k = 0; k < points->
ngeoms; k++)
2728 {
2730
2732 for (uint32_t j = 0; j < n; j++)
2733 {
2734 if (memcmp(&(out[j]), &pt,
sizeof(
POINT4D)) == 0)
2735 {
2737 out[j] = out[--n];
2738 break;
2739 }
2740 }
2741 if (!seen)
2742 out[n++] = pt;
2743 }
2744
2746 }
2747
2749
2750 for (uint32_t i = 0; i < n; i++)
2752
2754
2755 return (
LWGEOM *)lwmpoint;
2756 }
2761 }
2764
2766 for (uint32_t i = 0; i < lwpoly->
nrings; i++)
2767 {
2770 }
2771
2772
2775 return lwout;
2776 }
2780
2781 for (uint32_t i = 0; i < lwcurvepoly->
nrings; i++)
2783
2785 }
2791
2792 for (uint32_t i = 0; i < lwcol->
ngeoms; i++)
2794
2797
2798 return lwout;
2799 }
2800 default:
2802 return NULL;
2803 }
2804}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
POINT4D getPoint4d(const POINTARRAY *pa, uint32_t n)
LWMLINE * lwmline_construct_empty(int32_t srid, char hasz, char hasm)
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
void * lwalloc(size_t size)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWMLINE * lwmline_add_lwline(LWMLINE *mobj, const LWLINE *obj)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
LWMPOINT * lwmpoint_construct_empty(int32_t srid, char hasz, char hasm)
LWPOINT * lwpoint_make(int32_t srid, int hasz, int hasm, const POINT4D *p)
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
#define LW_TRUE
Return types for functions with status returns.
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
int lwgeom_is_closed(const LWGEOM *geom)
Return true or false depending on whether a geometry is a linear feature that closes on itself.
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
LWGEOM * lwgeom_boundary(LWGEOM *lwgeom)
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
LWGEOM * lwgeom_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
LWMPOINT * lwgeom_as_lwmpoint(const LWGEOM *lwgeom)
void lwgeom_free(LWGEOM *lwgeom)
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep-clone an LWGEOM object.
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)