Just spitballing, since you have to work with what's there, perhaps do a st_extent to get x/y then do a second pass getting zmin and zmax?
P On Mon, Jan 11, 2010 at 8:38 AM, Abram Gillespie <[email protected]> wrote: > OK, I'll ask this then. What's the best way to get this: > > select ST_Extent3d(geometry_column) from my_table; > > Into EWKB w/o losing the Z (or M) coordinate? > > Doing: > > select ST_AsEWKB(ST_Extent3D(geometry_column)) from my_table; > > unfortunately falls prey to the issue we're discussing. > > Thanks. > -Abe > > On Sun, Jan 10, 2010 at 10:53 PM, Paragon Corporation <[email protected]> wrote: >> As a side note. ST_Zmax doesn't exist for geometries. It works because >> geometries can be autocast to boxes. >> >> See matrix >> http://www.postgis.org/documentation/manual-svn/ch08.html#PostGIS_TypeFuncti >> onMatrix >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of Paragon >> Corporation >> Sent: Sunday, January 10, 2010 10:50 PM >> To: 'PostGIS Users Discussion' >> Subject: Re: [postgis-users] Bug dropping the Z coordinate? >> >> Abe, >> >> It seems we are flattening the box3d geometry in to a 2D polygon always >> instead of as a 3D/2.5D polygon. >> I'm not sure it's a bug though, because I think a box3d is an invalid 2.5/3D >> polygon if you were to construct it. >> >> Can you envision it? >> >> Paul, Mark or Kevin might have a better clue, but I think it's at best an >> ambiguous 3D polygon and that is the problem. A box3d isn't really a 3D box, >> its more just a coordinate bounding thing. >> >> Hope that helps, >> Regina >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of Abram >> Gillespie >> Sent: Sunday, January 10, 2010 4:31 PM >> To: PostGIS Users Discussion >> Subject: [postgis-users] Bug dropping the Z coordinate? >> >> Is this a bug? >> >> select ST_ZMax('BOX3D(0 0 0,0 0 1)'::box3d); >> >> versus >> >> select ST_ZMax(ST_GeomFromEWKB(ST_AsEWKB('BOX3D(0 0 0,0 0 1)'::box3d))); >> >> The first query returns "1" as expected but the second returns "0" as >> unexpected. >> >> I'm trying to add Z/M support to zigGIS and this is show-stopping me. >> Any work-arounds if this is a bug? Also, I'll be happy to report the bug if >> so. >> >> Thanks. >> -Abe >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> >> >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
