124 POINT4D point = { 0.0, 0.0, 0.0, 0.0 };
126 LWDEBUG(2,
"ptarray_fromGEOSCoordSeq called");
128 if (!GEOSCoordSeq_getSize(cs, &size))
lwerror(
"Exception thrown");
130 LWDEBUGF(4,
" GEOSCoordSeq size: %d", size);
134 if (!GEOSCoordSeq_getDimensions(cs, &dims))
lwerror(
"Exception thrown");
136 LWDEBUGF(4,
" GEOSCoordSeq dimensions: %d", dims);
139 if (dims > 3) dims = 3;
142 LWDEBUGF(4,
" output dimensions: %d", dims);
146 for (i = 0; i < size; i++)
148 #if POSTGIS_GEOS_VERSION < 38
149 GEOSCoordSeq_getX(cs, i, &(point.
x));
150 GEOSCoordSeq_getY(cs, i, &(point.
y));
151 if (dims >= 3) GEOSCoordSeq_getZ(cs, i, &(point.
z));
154 GEOSCoordSeq_getXYZ(cs, i, &(point.
x), &(point.
y), &(point.
z));
156 GEOSCoordSeq_getXY(cs, i, &(point.
x), &(point.
y));
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...
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.