[postgis-users] Concern about GEOMUNION() results

James G Wilkinson jgw at alpinegeophysics.com
Tue Feb 1 08:51:52 PST 2005


I am using PostgreSQL v.7.4.2, PostGIS 0.9.0, PROJ v.4.4.7, and GEOS 
v.2.1.1.
I have prepared two spatially enabled tables called "test" and "test2."  
"test" is a
single polygon, and "test2" is a single line segment (see below for 
their geometries).
When I perform a union of the two geometries (also shown below), I 
expected to
get a GEOMETRYCOLECTION with three line segments and the polygon.  Instead,
I received only two line segments and a polygon (results shown below).  
The third
line segment that I expected was as follows:

LINESTRING(-97 42.04,-97.05 42.1)

Is my expectation wrong?

Regards,

Jim


beta_jgw=# select * from spatial.test2;

 gid |                  the_geom                  
-----+---------------------------------------------
   1 | SRID=4267;LINESTRING(-96.8 41.8,-97.3 42.4)
(1 row)

beta_jgw=# select * from spatial.test;

 gid |                            the_geom
-----+-----------------------------------------------------------------
   1 | SRID=4267;POLYGON((-97 42,-97.1 42,-97.1 42.1,-97 42.1,-97 42))

beta_jgw=# select geomunion(a.the_geom, b.the_geom) from spatial.test a, 
spatial.test2 b;

                             geomunion
------------------------------------------------------------------------------------------
SRID=-1;GEOMETRYCOLLECTION(LINESTRING(-96.8 41.8,-97 42.04),
LINESTRING(-97.05 42.1,-97.3 42.4),
POLYGON((-97 42,-97.1 42,-97.1 42.1,-97.05 42.1,-97 42.1,-97 42.04,-97 42)))
(1 row)



More information about the postgis-users mailing list