From 4be594d6de36d07b07eb152f3848f089e9d0922a Mon Sep 17 00:00:00 2001 From: David Blasby Date: Tue, 26 Feb 2002 23:46:03 +0000 Subject: [PATCH] for bbox only geometries, it will dump as "SRID=x;NULL", and on load, it will be NULL. git-svn-id: http://svn.osgeo.org/postgis/trunk@124 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis_inout.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/postgis_inout.c b/postgis_inout.c index dacdfd8de..96d963245 100644 --- a/postgis_inout.c +++ b/postgis_inout.c @@ -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; } -- 2.49.0