2301{
2305 uint32_t uwhere = 0;
2306
2307 POSTGIS_DEBUGF(2, "%s called.", __func__);
2308
2309 pglwg1 = PG_GETARG_GSERIALIZED_P(0);
2310 pglwg2 = PG_GETARG_GSERIALIZED_P(1);
2311
2313 {
2314 elog(ERROR, "First argument must be a LINESTRING");
2315 PG_RETURN_NULL();
2316 }
2317
2319 {
2320 elog(ERROR, "Second argument must be a POINT");
2321 PG_RETURN_NULL();
2322 }
2323
2325 {
2326 PG_RETURN_POINTER(pglwg1);
2327 }
2328
2330
2331 if (PG_NARGS() <= 2)
2332 {
2334 }
2335 else
2336 {
2337 int32 where = PG_GETARG_INT32(2);
2338 if (where == -1)
2339 {
2341 }
2343 {
2344 elog(ERROR, "%s: Invalid offset", __func__);
2345 PG_RETURN_NULL();
2346 }
2347 else
2348 {
2349 uwhere = where;
2350 }
2351 }
2352
2356
2358 {
2359 elog(ERROR, "Point insert failed");
2360 PG_RETURN_NULL();
2361 }
2362
2364
2365
2366 PG_FREE_IF_COPY(pglwg1, 0);
2367 PG_FREE_IF_COPY(pglwg2, 1);
2369
2370 PG_RETURN_POINTER(
result);
2371}
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
void lwpoint_free(LWPOINT *pt)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
void lwline_free(LWLINE *line)
int lwline_add_lwpoint(LWLINE *line, LWPOINT *point, uint32_t where)
Add a LWPOINT to an LWLINE.
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)