[postgis-devel] Is this behavior of union by design or a sideeffect?

Obe, Regina robe.dnd at cityofboston.gov
Fri Oct 3 09:15:50 PDT 2008


Okay so it is by design not by accident. I was expecting it to throw an
error like ST_Collect, but I rather prefer this interpretation better. I
just thought it was kind of funny.  Now I can live in 2 different
dimensional spaces :)

-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of Paul
Ramsey
Sent: Friday, October 03, 2008 12:10 PM
To: PostGIS Development Discussion
Subject: Re: [postgis-devel] Is this behavior of union by design or a
sideeffect?

If you intersect

LINESTRING(0 5 5, 10 5 5)

with

LINESTRING(5 0, 5 10)

what are the coordinates of the resulting point?

POINT(5 5 0)
POINT(5 5 5)
POINT(5 5 2.5)
POINT(5 5)

Anyways, take that discussion and spread it out over every combination
of typeA/typeB/hasZ/hasntZ and you get what was done for the Z
handling.

So far, the complaints have been few, at least.

P.

On Fri, Oct 3, 2008 at 6:05 AM, Obe, Regina <robe.dnd at cityofboston.gov>
wrote:
> I was testing out st_union trying to figure out its fitness for 3d use
> and also comparing to my cascade imp to make sure they agree in cases
> before I put in wiki, and noticed I can mix dimensions and get answers
> instead of an error like I get with ST_Collect.
>
> I presume this is attributed to the elevation and average elevation
> calcs in there.  I'm just not quite sure what to think of this.  Seems
a
> little odd that you can mix dimensions and if you do, I would think it
> would assume z is 0 or something not do some weird averaging.  Well
its
> always been like this so its not a new thing and probably least of
> importance right now.  Just thought I'd point it out before I forget.
>
>
> SELECT ST_AsEWKT(st_union(the_geom))
> FROM
> (SELECT ST_GeomFromEWKT('POLYGON((-7 4.2,-7.1 4.2,-7.1 4.3,
> -7 4.2))') as the_geom
> UNION ALL
> SELECT ST_GeomFromEWKT('POINT(5 5 5)') as the_geom
> UNION ALL
>        SELECT ST_GeomFromEWKT('POINT(-2 3 1)') as the_geom
> UNION ALL
> SELECT ST_GeomFromEWKT('LINESTRING(5 5 5, 10 10 10)') as the_geom ) as
> foo;
>
> --Result
>
> "GEOMETRYCOLLECTION(POINT(-2 3 1),LINESTRING(5 5 5,10 10
10),POLYGON((-7
> 4.2 5,-7.1 4.2 5,-7.1 4.3 5,-7 4.2 5)))"
>
> Thanks,
> Regina
> -----------------------------------------
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended
> solely for the addressee. If you received this in error, please
> contact the sender and delete the material from any computer.
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list