275{
277 if (!mls)
278 return NULL;
280 const int nLines = json_object_array_length(mls);
281 for (int i = 0; i < nLines; ++i)
282 {
284 json_object *coords = json_object_array_get_idx(mls, i);
285
286 if (json_type_array == json_object_get_type(coords))
287 {
288 const int nPoints = json_object_array_length(coords);
289 for (int j = 0; j < nPoints; ++j)
290 {
291 json_object *coord = json_object_array_get_idx(coords, j);
293 {
296 return NULL;
297 }
298 }
300 }
301 else
302 {
305 return NULL;
306 }
307 }
309}
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWMLINE * lwmline_add_lwline(LWMLINE *mobj, const LWLINE *obj)
void ptarray_free(POINTARRAY *pa)
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
void lwmline_free(LWMLINE *mline)
static json_object * parse_coordinates(json_object *geojson)
static int parse_geojson_coord(json_object *poObj, int *hasz, POINTARRAY *pa)