From: Paul Ramsey Date: Wed, 26 Mar 2014 09:31:47 +0000 (+0000) Subject: Fix up GeoJSON empty poly fix a little more X-Git-Tag: 2.2.0rc1~1176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33563bf25b0d8ac1bbacf1cc686dfc9a43d21f2d;p=postgis Fix up GeoJSON empty poly fix a little more git-svn-id: http://svn.osgeo.org/postgis/trunk@12356 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwin_geojson.c b/liblwgeom/lwin_geojson.c index 1f9d0a217..78a8a3f56 100644 --- a/liblwgeom/lwin_geojson.c +++ b/liblwgeom/lwin_geojson.c @@ -181,6 +181,7 @@ parse_geojson_polygon(json_object *geojson, int *hasz, int root_srid) json_object* rings = NULL; int i = 0, j = 0; int nRings = 0; + int nPoints = 0; rings = findMemberByName( geojson, "coordinates" ); if ( ! rings ) @@ -199,12 +200,11 @@ parse_geojson_polygon(json_object *geojson, int *hasz, int root_srid) if ( ! nRings ) { - return (LWGEOM *)lwpoly_construct_empty(root_srid, 0, 0); + return (LWGEOM *)lwpoly_construct_empty(root_srid, *hasz, 0); } ppa = (POINTARRAY**) lwalloc(sizeof(POINTARRAY*)); - int nPoints; json_object* points = NULL; ppa[0] = ptarray_construct_empty(1, 0, 1); points = json_object_array_get_idx( rings, 0 );