]> granicus.if.org Git - postgis/commitdiff
Gracefully handle typed empty GEOS geometries.
authorSandro Santilli <strk@keybit.net>
Sat, 20 Jun 2009 22:13:48 +0000 (22:13 +0000)
committerSandro Santilli <strk@keybit.net>
Sat, 20 Jun 2009 22:13:48 +0000 (22:13 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4189 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_geos.c

index 21ea05ca1edc17f43ddc7086c77dcd103afba2d8..4aa25fc45c4ed774801a15e460def92f1132e5f2 100644 (file)
@@ -2450,6 +2450,11 @@ GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
                }
        }
 
+       if ( GEOSisEmpty(geom) )
+       {
+               return (LWGEOM*)lwcollection_construct_empty(SRID, want3d, 0);
+       }
+
        switch (type)
        {
                const GEOSCoordSequence *cs;