[postgis-devel] [PostGIS] #103: Box3D always gets cast to 2D geometry

PostGIS trac at osgeo.org
Sat Apr 2 00:36:05 PDT 2011


#103: Box3D always gets cast to 2D geometry
----------------------+-----------------------------------------------------
  Reporter:  robe     |       Owner:  robe         
      Type:  task     |      Status:  reopened     
  Priority:  medium   |   Milestone:  PostGIS 2.0.0
 Component:  postgis  |     Version:  trunk        
Resolution:           |    Keywords:               
----------------------+-----------------------------------------------------
Changes (by strk):

  * status:  closed => reopened
  * priority:  low => medium
  * version:  => trunk
  * milestone:  => PostGIS 2.0.0
  * resolution:  wontfix =>


Old description:

> Actually not sure if this is solvable.  But ST_SetSRID, ST_Force_3DZ all
> lose the Z coordinate value of a BOX3D.
>
> Example:
>
> SELECT ST_AsEWKT(ST_Force_3DZ(ST_Extent3D(foo.the_geom))) As
> b3extentpoly,
> ST_Extent3D(foo.the_geom) As b3extent
> FROM (SELECT ST_MakePoint(x,y,z) As the_geom
>         FROM generate_series(1,3) As x
>                 CROSS JOIN generate_series(1,2) As y
>                 CROSS JOIN generate_series(0,2) As Z) As foo;
>
> Yields:
> b3extentpoly                                 b3extent
> POLYGON((1 1 0,1 2 0,3 2 0,3 1 0,1 1 0)) ;BOX3D(1 1 0,3 2 2)
>
> I would expect the POLYGON value to have some 2 z coords in there.

New description:

 Actually not sure if this is solvable.  But ST_SetSRID, ST_Force_3DZ all
 lose the Z coordinate value of a BOX3D.

 Example:

 SELECT ST_AsEWKT(ST_Force_3DZ(ST_Extent3D(foo.the_geom))) As b3extentpoly,
 ST_Extent3D(foo.the_geom) As b3extent
 FROM (SELECT ST_MakePoint(x,y,z) As the_geom
         FROM generate_series(1,3) As x
                 CROSS JOIN generate_series(1,2) As y
                 CROSS JOIN generate_series(0,2) As Z) As foo;

 Yields:
 b3extentpoly                                 b3extent
 POLYGON((1 1 0,1 2 0,3 2 0,3 1 0,1 1 0)) ;BOX3D(1 1 0,3 2 2)

 I would expect the POLYGON value to have some 2 z coords in there.

--

Comment:

 Wait a sec, box3d is not a cube, is it ?
 It's defined by 2 points only, you can't define a cube like that.

 I've hit this problem as well, while trying to get a 3d envelope of a 2.5d
 geom.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/103#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list