]> granicus.if.org Git - postgis/commitdiff
for bbox only geometries, it will dump as "SRID=x;NULL", and on load, it will be...
authorDavid Blasby <dblasby@gmail.com>
Tue, 26 Feb 2002 23:46:03 +0000 (23:46 +0000)
committerDavid Blasby <dblasby@gmail.com>
Tue, 26 Feb 2002 23:46:03 +0000 (23:46 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@124 b70326c6-7e19-0410-871a-916f4a2858ee

postgis_inout.c

index dacdfd8dea26fc49a2df4f32eb5ac0914aa29596..96d963245be36f334fffb965731b668ba9e1bc7f 100644 (file)
@@ -1467,6 +1467,8 @@ Datum geometry_in(PG_FUNCTION_ARGS)
                        str++;
        }
 
+       if (strcmp(str,"NULL")==0)
+               PG_RETURN_NULL() ;
 
 
        if ((str==NULL) || (strlen(str) == 0) )
@@ -1660,6 +1662,9 @@ Datum geometry_out(PG_FUNCTION_ARGS)
                int                             len;
 
                wkt = geometry_to_text(geom1);
+
+
+
                len = strlen(wkt) + 6+ 25 + 1;
                result = palloc(len);//extra space for SRID
                memset(result, 0, len); //zero everything out
@@ -1682,6 +1687,8 @@ Datum astext_geometry(PG_FUNCTION_ARGS)
        int                     len;
 
        wkt = geometry_to_text(geom1);
+
+
        len = strlen(wkt) + 5;
                
        result= palloc(len);
@@ -1725,7 +1732,8 @@ char *geometry_to_text(GEOMETRY  *geometry)
 
        if (geometry->type == BBOXONLYTYPE)
        {
-               sprintf(result,"BOX3D ONLY - NOT useable");
+               strcpy(result,"NULL");
+               return result;
        }