176 if (!rings || json_object_get_type(rings) != json_type_array)
179 int nRings = json_object_array_length(rings);
189 for (
int i = 0; i < nRings; i++)
191 json_object *points = json_object_array_get_idx(rings, i);
192 if (!points || json_object_get_type(points) != json_type_array)
194 for (
int k = 0; k < o; k++)
197 lwerror(
"The 'coordinates' in GeoJSON ring are not an array");
200 int nPoints = json_object_array_length(points);
213 for (
int j = 0; j < nPoints; j++)
215 json_object *coords = NULL;
216 coords = json_object_array_get_idx(points, j);
219 for (
int k = 0; k <= o; k++)
222 lwerror(
"The 'coordinates' in GeoJSON are not sufficiently nested");
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
void ptarray_free(POINTARRAY *pa)
void * lwalloc(size_t size)
LWPOLY * lwpoly_construct_empty(int32_t srid, char hasz, char hasm)
LWPOLY * lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static int parse_geojson_coord(json_object *poObj, int *hasz, POINTARRAY *pa)