1901{
1902 ArrayIterator iterator;
1904 bool isnull;
1905 bool gotsrid = false;
1906 uint32_t i = 0;
1907
1908 GEOSGeometry** geos_geoms = palloc(nelems * sizeof(GEOSGeometry*));
1909
1910 iterator = array_create_iterator(array, 0, NULL);
1911
1912 while(array_iterate(iterator, &value, &isnull))
1913 {
1915
1916 if (isnull)
1917 continue;
1918
1920
1922 if (!geos_geoms[i])
1923 {
1924 uint32_t j;
1925 lwpgerror("Geometry could not be converted to GEOS");
1926
1927 for (j = 0; j < i; j++) {
1928 GEOSGeom_destroy(geos_geoms[j]);
1929 }
1930 return NULL;
1931 }
1932
1933 if (!gotsrid)
1934 {
1936 gotsrid = true;
1937 }
1939 {
1940 uint32_t j;
1941 for (j = 0; j <= i; j++) {
1942 GEOSGeom_destroy(geos_geoms[j]);
1943 }
1945 return NULL;
1946 }
1947
1948 i++;
1949 }
1950
1951 array_free_iterator(iterator);
1952 return geos_geoms;
1953}
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(const GSERIALIZED *pglwgeom)