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

Paul Ramsey pramsey at cleverelephant.ca
Fri Oct 3 09:09:52 PDT 2008


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
>



More information about the postgis-devel mailing list