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

Definition at line 147 of file lwin_geojson.c.

References findMemberByName(), geojson_lwerror(), LWDEBUG, LWDEBUGF, lwpoint_construct(), parse_geojson_coord(), and ptarray_construct_empty().

Referenced by parse_geojson().

148 {
149  LWGEOM *geom;
150  POINTARRAY *pa;
151  json_object* coords = NULL;
152 
153  LWDEBUGF(3, "parse_geojson_point called with root_srid = %d.", root_srid );
154 
155  coords = findMemberByName( geojson, "coordinates" );
156  if ( ! coords )
157  {
158  geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
159  return NULL;
160  }
161 
162  pa = ptarray_construct_empty(1, 0, 1);
163  parse_geojson_coord(coords, hasz, pa);
164 
165  geom = (LWGEOM *) lwpoint_construct(root_srid, NULL, pa);
166  LWDEBUG(2, "parse_geojson_point finished.");
167  return geom;
168 }
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
Definition: ptarray.c:57
static void geojson_lwerror(char *msg, int error_code)
Definition: lwin_geojson.c:36
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
static int parse_geojson_coord(json_object *poObj, int *hasz, POINTARRAY *pa)
Definition: lwin_geojson.c:84
LWGEOM * geom
static json_object * findMemberByName(json_object *poObj, const char *pszName)
Definition: lwin_geojson.c:46
LWPOINT * lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point)
Definition: lwpoint.c:96
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the call graph for this function:

Here is the caller graph for this function: