1399 ArrayIterator iterator;
1403 POSTGIS_DEBUGF(2,
"%s called", __func__);
1406 if ( PG_ARGISNULL(0) )
1410 array = PG_GETARG_ARRAYTYPE_P(0);
1413 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array));
1415 POSTGIS_DEBUGF(3,
"%s: array has %d elements", __func__, nelems);
1429 geoms = palloc(
sizeof(
LWGEOM *) * nelems);
1432 #if POSTGIS_PGSQL_VERSION >= 95
1433 iterator = array_create_iterator(array, 0, NULL);
1435 iterator = array_create_iterator(array, 0);
1438 while( array_iterate(iterator, &
value, &isnull) )
1460 srid = geoms[ngeoms-1]->
srid;
1468 POSTGIS_DEBUGF(3,
"%s: element %d deserialized", __func__, ngeoms);
1470 array_free_iterator(iterator);
1476 elog(NOTICE,
"No points or linestrings in input array");
1480 POSTGIS_DEBUGF(3,
"LWGEOM_makeline_garray: elements: %d", ngeoms);
1486 PG_RETURN_POINTER(result);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
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)