2715{
2719
2720 switch (lwgeom->
type)
2721 {
2725 }
2730 else
2731 {
2739
2740 return (
LWGEOM *)lwmpoint;
2741 }
2742 }
2747 uint32_t n = 0;
2748
2749 for (uint32_t i = 0; i < lwmline->
ngeoms; i++)
2750 {
2752 if (!points)
2753 continue;
2754
2755 for (uint32_t k = 0; k < points->
ngeoms; k++)
2756 {
2758
2760 for (uint32_t j = 0; j < n; j++)
2761 {
2762 if (memcmp(&(out[j]), &pt,
sizeof(
POINT4D)) == 0)
2763 {
2765 out[j] = out[--n];
2766 break;
2767 }
2768 }
2769 if (!seen)
2770 out[n++] = pt;
2771 }
2772
2774 }
2775
2777
2778 for (uint32_t i = 0; i < n; i++)
2780
2782
2783 return (
LWGEOM *)lwmpoint;
2784 }
2789 }
2792
2794 for (uint32_t i = 0; i < lwpoly->
nrings; i++)
2795 {
2798 }
2799
2800
2803 return lwout;
2804 }
2808
2809 for (uint32_t i = 0; i < lwcurvepoly->
nrings; i++)
2811
2813 }
2819
2820 for (uint32_t i = 0; i < lwcol->
ngeoms; i++)
2822
2825
2826 return lwout;
2827 }
2828 default:
2830 return NULL;
2831 }
2832}
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)