PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ findMemberByName()

static json_object* findMemberByName ( json_object *  poObj,
const char *  pszName 
)
static

Definition at line 45 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().

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