Hi Jan,<div><br></div><div>Here is a wrapper function to directly pass the double precision values to minimize any precision error due to text conversion:<div><br></div><div><div>CREATE OR REPLACE FUNCTION ST_MakeBox3D(minx double precision, miny double precision, minz double precision, maxx double precision, maxy double precision, maxz double precision)</div>
<div> RETURNS box3d AS</div><div>'SELECT ST_MakeBox3D(ST_MakePoint($1, $2, $3), ST_MakePoint($4, $5, $6))'</div><div> LANGUAGE 'sql' IMMUTABLE STRICT</div><div> COST 10;</div><div><br></div><div><br></div>
<div>-- E.g. a cube:</div><div>SELECT ST_MakeBox3D(3421250, 5968415, -22.96, 3427355, 5971725, -15.15);</div><div><br></div><div>or from Python or other environment with parameter support, this will look more like:</div>
<div>
<meta http-equiv="content-type" content="text/html; charset=utf-8">SELECT ST_MakeBox3D($1, $2, $3, $4, $5, $6);</div><div>using all six inputs of double precision.</div><div><br></div><div><br></div>-Mike</div><div><br><div class="gmail_quote">
On 19 October 2010 05:48, Jan Saalbach <span dir="ltr"><<a href="mailto:fire@dubmosphere.de">fire@dubmosphere.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
will I lose data/precision if I save the box3ds as text first and once they are all in the column cast them to box3d? That operation would be purely inside the database and should work. should it?<br>
<br>
Regards<br><font color="#888888">
Jan</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div></div>