2348{
2352
2353 POSTGIS_DEBUG(2, "LWGEOM_removepoint called.");
2354
2355 pglwg1 = PG_GETARG_GSERIALIZED_P(0);
2356 which = PG_GETARG_INT32(1);
2357
2359 {
2360 elog(ERROR, "First argument must be a LINESTRING");
2361 PG_RETURN_NULL();
2362 }
2363
2365
2366 if (which < 0 || (uint32_t)which > line->
points->
npoints - 1)
2367 {
2368 elog(ERROR,
"Point index out of range (%u..%u)", 0, line->
points->
npoints - 1);
2369 PG_RETURN_NULL();
2370 }
2371
2373 {
2374 elog(ERROR, "Can't remove points from a single segment line");
2375 PG_RETURN_NULL();
2376 }
2377
2379
2381
2384
2385 PG_FREE_IF_COPY(pglwg1, 0);
2386 PG_RETURN_POINTER(
result);
2387}
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
LWLINE * lwline_removepoint(LWLINE *line, uint32_t which)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
void lwline_free(LWLINE *line)