60 lwnotice(
"lwcircstring_construct: invalid point count %d", points->
npoints);
98 if ( ! curve )
return;
144 int has_z = 0, has_m = 0;
150 for (i = 0; i < npoints; i++)
160 if (has_z && has_m)
break;
168 for (i = 0; i < npoints; i++)
170 const LWPOINT *lwpt = points[i];
173 lwerror(
"%s: failed getPoint4d_p", __func__);
192 uint8_t *newpoints, *ptr;
194 if (zmflag == 0) ptsize = 2 *
sizeof(double);
195 else if (zmflag == 3) ptsize = 4 *
sizeof(double);
196 else ptsize = 3 *
sizeof(double);
199 size = ptsize * mpoint->
ngeoms;
201 memset(newpoints, 0, size);
204 for (i = 0; i < mpoint->
ngeoms; i++)
214 LWDEBUGF(3,
"lwcurve_from_lwmpoint: constructed pointarray for %d points, %d zmflag", mpoint->
ngeoms, zmflag);
char result[OUT_DOUBLE_BUFFER_SIZE]
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)
int ptarray_is_closed_3d(const POINTARRAY *pa)
POINTARRAY * ptarray_construct_reference_data(char hasz, char hasm, uint32_t npoints, uint8_t *ptlist)
Construct a new POINTARRAY, referencing to the data from ptlist.
LWPOINT * lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
#define FLAGS_SET_BBOX(flags, value)
void printPA(POINTARRAY *pa)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
void * lwalloc(size_t size)
#define FLAGS_NDIMS(flags)
POINTARRAY * ptarray_removePoint(POINTARRAY *pa, uint32_t where)
Remove a point from a pointarray.
#define FLAGS_GET_M(flags)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
void ptarray_free(POINTARRAY *pa)
#define FLAGS_GET_ZM(flags)
POINTARRAY * ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
Add a point in a pointarray.
LWGEOM * lwcircstring_as_lwgeom(const LWCIRCSTRING *obj)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
int ptarray_is_closed_2d(const POINTARRAY *pa)
lwflags_t lwflags(int hasz, int hasm, int geodetic)
Construct a new flags bitmask.
#define LW_TRUE
Return types for functions with status returns.
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
char ptarray_same(const POINTARRAY *pa1, const POINTARRAY *pa2)
double ptarray_arc_length_2d(const POINTARRAY *pts)
Find the 2d length of the given POINTARRAY, using circular arc interpolation between each coordinate ...
LWLINE * lwline_clone(const LWLINE *lwgeom)
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
LWCIRCSTRING * lwcircstring_from_lwmpoint(int32_t srid, LWMPOINT *mpoint)
double lwcircstring_length_2d(const LWCIRCSTRING *circ)
int lwcircstring_is_closed(const LWCIRCSTRING *curve)
LWCIRCSTRING * lwcircstring_addpoint(LWCIRCSTRING *curve, LWPOINT *point, uint32_t where)
void lwcircstring_setPoint4d(LWCIRCSTRING *curve, uint32_t index, POINT4D *newpoint)
LWPOINT * lwcircstring_get_lwpoint(const LWCIRCSTRING *circ, uint32_t where)
LWCIRCSTRING * lwcircstring_removepoint(LWCIRCSTRING *curve, uint32_t index)
char lwcircstring_same(const LWCIRCSTRING *me, const LWCIRCSTRING *you)
void lwcircstring_free(LWCIRCSTRING *curve)
void printLWCIRCSTRING(LWCIRCSTRING *curve)
void lwcircstring_release(LWCIRCSTRING *lwcirc)
LWCIRCSTRING * lwcircstring_construct_empty(int32_t srid, char hasz, char hasm)
LWCIRCSTRING * lwcircstring_clone(const LWCIRCSTRING *g)
double lwcircstring_length(const LWCIRCSTRING *circ)
LWCIRCSTRING * lwcircstring_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWCIRCSTRING * lwcircstring_from_lwpointarray(int32_t srid, uint32_t npoints, const LWPOINT **points)
#define LWDEBUGF(level, msg,...)
void lwnotice(const char *fmt,...) __attribute__((format(printf
Write a notice out to the notice handler.
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)