145{
146 uint32_t dims = 2;
148 uint32_t size = 0;
149#if POSTGIS_GEOS_VERSION < 31000
150 uint32_t i;
151 POINT4D point = { 0.0, 0.0, 0.0, 0.0 };
152#endif
153
154 LWDEBUG(2,
"ptarray_fromGEOSCoordSeq called");
155
156 if (!GEOSCoordSeq_getSize(cs, &size))
lwerror(
"Exception thrown");
157
158 LWDEBUGF(4,
" GEOSCoordSeq size: %d", size);
159
160 if (want3d)
161 {
162 if (!GEOSCoordSeq_getDimensions(cs, &dims))
lwerror(
"Exception thrown");
163
164 LWDEBUGF(4,
" GEOSCoordSeq dimensions: %d", dims);
165
166
167 if (dims > 3) dims = 3;
168 }
169
170 LWDEBUGF(4,
" output dimensions: %d", dims);
171
173#if POSTGIS_GEOS_VERSION >= 31000
175 return pa;
176#else
177 for (i = 0; i < size; i++)
178 {
179 if (dims >= 3)
180 GEOSCoordSeq_getXYZ(cs, i, &(point.
x), &(point.
y), &(point.
z));
181 else
182 GEOSCoordSeq_getXY(cs, i, &(point.
x), &(point.
y));
183
185 }
186
187 return pa;
188#endif
189}
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...
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
uint8_t * serialized_pointlist