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

Obe, Regina robe.dnd at cityofboston.gov
Fri Oct 3 06:05:11 PDT 2008


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.



More information about the postgis-devel mailing list