2760{
2761 ArrayIterator iterator;
2763 bool isnull;
2764 bool gotsrid = false;
2765 uint32_t i = 0;
2766
2767 GEOSGeometry** geos_geoms = palloc(nelems * sizeof(GEOSGeometry*));
2768
2769 iterator = array_create_iterator(array, 0, NULL);
2770
2771 while(array_iterate(iterator, &value, &isnull))
2772 {
2774
2775 if (isnull)
2776 continue;
2777
2779
2781 if (!geos_geoms[i])
2782 {
2783 uint32_t j;
2784 lwpgerror("Geometry could not be converted to GEOS");
2785
2786 for (j = 0; j < i; j++) {
2787 GEOSGeom_destroy(geos_geoms[j]);
2788 }
2789 return NULL;
2790 }
2791
2792 if (!gotsrid)
2793 {
2795 gotsrid = true;
2796 }
2798 {
2799 uint32_t j;
2800 for (j = 0; j <= i; j++) {
2801 GEOSGeom_destroy(geos_geoms[j]);
2802 }
2804 return NULL;
2805 }
2806
2807 i++;
2808 }
2809
2810 array_free_iterator(iterator);
2811 return geos_geoms;
2812}
void gserialized_error_if_srid_mismatch_reference(const GSERIALIZED *g1, const int32_t srid2, const char *funcname)
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
int gserialized_has_z(const GSERIALIZED *g)
Check if a GSERIALIZED has a Z ordinate.
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)