]> granicus.if.org Git - postgis/commitdiff
Fix up GeoJSON empty poly fix a little more
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 26 Mar 2014 09:31:47 +0000 (09:31 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 26 Mar 2014 09:31:47 +0000 (09:31 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12356 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwin_geojson.c

index 1f9d0a21788d2d3af49ea9fff84f176984b55f29..78a8a3f56e394541448ccb1b7ddd6eb544a921aa 100644 (file)
@@ -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 );