PostGIS  2.1.10dev-r@@SVN_REVISION@@
static json_object* findMemberByName ( json_object *  poObj,
const char *  pszName 
)
static

Definition at line 46 of file lwin_geojson.c.

References geojson_lwerror().

Referenced by lwgeom_from_geojson(), parse_geojson(), parse_geojson_geometrycollection(), parse_geojson_linestring(), parse_geojson_multilinestring(), parse_geojson_multipoint(), parse_geojson_multipolygon(), parse_geojson_point(), and parse_geojson_polygon().

47 {
48  json_object* poTmp;
49  json_object_iter it;
50 
51  poTmp = poObj;
52 
53  if( NULL == pszName || NULL == poObj)
54  return NULL;
55 
56  it.key = NULL;
57  it.val = NULL;
58  it.entry = NULL;
59 
60  if( NULL != json_object_get_object(poTmp) )
61  {
62  if( NULL == json_object_get_object(poTmp)->head )
63  {
64  geojson_lwerror("invalid GeoJSON representation", 2);
65  return NULL;
66  }
67 
68  for( it.entry = json_object_get_object(poTmp)->head;
69  ( it.entry ?
70  ( it.key = (char*)it.entry->k,
71  it.val = (json_object*)it.entry->v, it.entry) : 0);
72  it.entry = it.entry->next)
73  {
74  if( strcasecmp((char *)it.key, pszName )==0 )
75  return it.val;
76  }
77  }
78 
79  return NULL;
80 }
static void geojson_lwerror(char *msg, int error_code)
Definition: lwin_geojson.c:36

Here is the call graph for this function:

Here is the caller graph for this function: