From: Regina Obe Date: Wed, 16 Mar 2011 04:48:44 +0000 (+0000) Subject: Alas a functioning polyhedralsurface export viewable in freeWRL. Also add proto... X-Git-Tag: 2.0.0alpha1~1899 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bf0b34042b9b1c0fe91a5e4f7216595a65cc677;p=postgis Alas a functioning polyhedralsurface export viewable in freeWRL. Also add proto that just takes geometry as argument and defaults to precision 15 git-svn-id: http://svn.osgeo.org/postgis/trunk@6903 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwout_x3d.c b/liblwgeom/lwout_x3d.c index 77aafd477..f585936f7 100644 --- a/liblwgeom/lwout_x3d.c +++ b/liblwgeom/lwout_x3d.c @@ -458,6 +458,9 @@ asx3d3_psurface_buf(const LWPSURFACE *psur, char *srs, char *output, int precisi for (i=0; ingeoms; i++) { ptr += asx3d3_poly_buf(psur->geoms[i], 0, ptr, precision, opts, 1, defid); + if (i < (psur->ngeoms - 1) ){ + ptr += sprintf(ptr, " "); //only add a trailing space if its not the last polygon in the set + } } /* Close outmost tag */ diff --git a/postgis/postgis.sql.in.c b/postgis/postgis.sql.in.c index a21bb3aa0..099162115 100644 --- a/postgis/postgis.sql.in.c +++ b/postgis/postgis.sql.in.c @@ -5075,6 +5075,12 @@ CREATE OR REPLACE FUNCTION ST_AsX3D(geom geometry, prec int4) RETURNS TEXT AS $$SELECT _ST_AsX3D(3,$1,$2,1,'');$$ LANGUAGE 'sql' IMMUTABLE; + +-- ST_AsX3D(geom, precision) +CREATE OR REPLACE FUNCTION ST_AsX3D(geom geometry) + RETURNS TEXT + AS $$SELECT _ST_AsX3D(3,$1,15,1,'');$$ + LANGUAGE 'sql' IMMUTABLE; COMMIT; #include "postgis_drop.sql.in.c"