[postgis-users] Bug dropping the Z coordinate?

Paragon Corporation lr at pcorp.us
Mon Jan 11 09:14:26 PST 2010


Abe,
One thought that comes to mind is store it as a multipolygon with each
polygon being a different edge of the box, but I'm not sure that would be
terribly useful for your use-case. 

Leo

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Abram
Gillespie
Sent: Monday, January 11, 2010 11:38 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Bug dropping the Z coordinate?

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 <lr at pcorp.us> 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_Type
> Functi
> onMatrix
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] 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: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] 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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users






More information about the postgis-users mailing list