PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ parse_geojson_multipolygon()

static LWGEOM* parse_geojson_multipolygon ( json_object *  geojson,
int *  hasz 
)
inlinestatic

Definition at line 310 of file lwin_geojson.c.

311 {
312  json_object *polys = parse_coordinates(geojson);
313  if (!polys)
314  return NULL;
316  int nPolys = json_object_array_length(polys);
317 
318  for (int i = 0; i < nPolys; ++i)
319  {
320  json_object *rings = json_object_array_get_idx(polys, i);
321  LWPOLY *poly = parse_geojson_poly_rings(rings, hasz);
322  if (poly)
323  geom = (LWGEOM *)lwmpoly_add_lwpoly((LWMPOLY *)geom, poly);
324  }
325 
326  return geom;
327 }
LWMPOLY * lwmpoly_add_lwpoly(LWMPOLY *mobj, const LWPOLY *obj)
Definition: lwmpoly.c:47
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:121
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
Definition: lwcollection.c:92
static json_object * parse_coordinates(json_object *geojson)
Definition: lwin_geojson.c:87
static LWPOLY * parse_geojson_poly_rings(json_object *rings, int *hasz)
Definition: lwin_geojson.c:174

References lwcollection_construct_empty(), lwmpoly_add_lwpoly(), MULTIPOLYGONTYPE, parse_coordinates(), and parse_geojson_poly_rings().

Referenced by parse_geojson().

Here is the call graph for this function:
Here is the caller graph for this function: