PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ findMemberByName()

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

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

60 {
61  json_object* poTmp;
62  json_object_iter it;
63 
64  poTmp = poObj;
65 
66  if( NULL == pszName || NULL == poObj)
67  return NULL;
68 
69  it.key = NULL;
70  it.val = NULL;
71  it.entry = NULL;
72 
73  if( NULL != json_object_get_object(poTmp) )
74  {
75  if( NULL == json_object_get_object(poTmp)->head )
76  {
77  geojson_lwerror("invalid GeoJSON representation", 2);
78  return NULL;
79  }
80 
81  for( it.entry = json_object_get_object(poTmp)->head;
82  ( it.entry ?
83  ( it.key = (char*)it.entry->k,
84  it.val = (json_object*)it.entry->v, it.entry) : 0);
85  it.entry = it.entry->next)
86  {
87  if( strcasecmp((char *)it.key, pszName )==0 )
88  return it.val;
89  }
90  }
91 
92  return NULL;
93 }
static void geojson_lwerror(char *msg, int error_code)
Definition: lwin_geojson.c:49
Here is the call graph for this function:
Here is the caller graph for this function: