[postgis-users] AddGeometryColumn BOX3D

Mike Toews mwtoews at gmail.com
Tue Oct 19 07:41:19 PDT 2010


Hi Jan,

Here is a wrapper function to directly pass the double precision values to
minimize any precision error due to text conversion:

CREATE OR REPLACE FUNCTION ST_MakeBox3D(minx double precision, miny double
precision, minz double precision, maxx double precision, maxy double
precision, maxz double precision)
  RETURNS box3d AS
'SELECT ST_MakeBox3D(ST_MakePoint($1, $2, $3), ST_MakePoint($4, $5, $6))'
  LANGUAGE 'sql' IMMUTABLE STRICT
  COST 10;


-- E.g. a cube:
SELECT ST_MakeBox3D(3421250, 5968415, -22.96, 3427355, 5971725, -15.15);

or from Python or other environment with parameter support, this will look
more like:
SELECT ST_MakeBox3D($1, $2, $3, $4, $5, $6);
using all six inputs of double precision.


-Mike

On 19 October 2010 05:48, Jan Saalbach <fire at dubmosphere.de> wrote:

> 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?
>
> Regards
> Jan
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101019/04e90c15/attachment.html>


More information about the postgis-users mailing list