1395 ArrayIterator iterator;
1399 POSTGIS_DEBUGF(2,
"%s called", __func__);
1402 if ( PG_ARGISNULL(0) )
1406 array = PG_GETARG_ARRAYTYPE_P(0);
1409 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1411 POSTGIS_DEBUGF(3,
"%s: array has %d elements", __func__, nelems);
1425 geoms = palloc(
sizeof(
LWGEOM *) * nelems);
1428 #if POSTGIS_PGSQL_VERSION >= 95 1429 iterator = array_create_iterator(array, 0, NULL);
1431 iterator = array_create_iterator(array, 0);
1434 while( array_iterate(iterator, &value, &isnull) )
1456 srid = geoms[ngeoms-1]->
srid;
1464 POSTGIS_DEBUGF(3,
"%s: element %d deserialized", __func__, ngeoms);
1466 array_free_iterator(iterator);
1472 elog(NOTICE,
"No points or linestrings in input array");
1476 POSTGIS_DEBUGF(3,
"LWGEOM_makeline_garray: elements: %d", ngeoms);
1482 PG_RETURN_POINTER(result);
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void error_if_srid_mismatch(int srid1, int srid2)
#define SRID_UNKNOWN
Unknown SRID value.
LWLINE * lwline_from_lwgeom_array(int srid, uint32_t ngeoms, LWGEOM **geoms)
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.