PostGIS  2.1.10dev-r@@SVN_REVISION@@
static LWGEOM* parse_geojson_geometrycollection ( json_object *  geojson,
int *  hasz,
int  root_srid 
)
static

Definition at line 424 of file lwin_geojson.c.

References COLLECTIONTYPE, findMemberByName(), geojson_lwerror(), lwcollection_add_lwgeom(), lwcollection_construct_empty(), and parse_geojson().

Referenced by parse_geojson().

425 {
426  LWGEOM *geom = NULL;
427  int i;
428  json_object* poObjGeoms = NULL;
429 
430  if (!root_srid)
431  {
432  geom = (LWGEOM *)lwcollection_construct_empty(COLLECTIONTYPE, root_srid, 1, 0);
433  }
434  else
435  {
437  }
438 
439  poObjGeoms = findMemberByName( geojson, "geometries" );
440  if ( ! poObjGeoms )
441  {
442  geojson_lwerror("Unable to find 'geometries' in GeoJSON string", 4);
443  return NULL;
444  }
445 
446  if( json_type_array == json_object_get_type( poObjGeoms ) )
447  {
448  const int nGeoms = json_object_array_length( poObjGeoms );
449  json_object* poObjGeom = NULL;
450  for(i = 0; i < nGeoms; ++i )
451  {
452  poObjGeom = json_object_array_get_idx( poObjGeoms, i );
454  parse_geojson(poObjGeom, hasz, root_srid));
455  }
456  }
457 
458  return geom;
459 }
static LWGEOM * parse_geojson(json_object *geojson, int *hasz, int root_srid)
Definition: lwin_geojson.c:462
static void geojson_lwerror(char *msg, int error_code)
Definition: lwin_geojson.c:36
LWGEOM * geom
static json_object * findMemberByName(json_object *poObj, const char *pszName)
Definition: lwin_geojson.c:46
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:174
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: