142{
143 int zmflag=0;
144 uint32_t i;
146 uint8_t *newpoints, *ptr;
147 size_t ptsize, size;
148
149
150
151
152 for (i = 0; i < npoints; i++)
153 {
155 {
156 lwerror(
"lwcurve_from_lwpointarray: invalid input type: %s",
158 return NULL;
159 }
162 if (zmflag == 3) break;
163 }
164
165 if (zmflag == 0) ptsize = 2 * sizeof(double);
166 else if (zmflag == 3) ptsize = 4 * sizeof(double);
167 else ptsize = 3 * sizeof(double);
168
169
170
171
172 size = ptsize * npoints;
174 memset(newpoints, 0, size);
175
176 ptr = newpoints;
177 for (i = 0; i < npoints; i++)
178 {
181 ptr += ptsize;
182 }
184
186}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
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.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
void * lwalloc(size_t size)
#define FLAGS_GET_M(flags)
LWCIRCSTRING * lwcircstring_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
static size_t ptarray_point_size(const POINTARRAY *pa)