[postgis-users] GeomUnion Bug?

Charlie Savage cfis at savagexi.com
Fri Sep 7 10:28:16 PDT 2007


Hi Martin,

> Two observations:
> - This does look like a bug, or at least a porting problem in GEOS.  In 
> JTS, the envelope of a Point is itself a Point.  This means that the 
> return value is always a valid geometry, and thus can be safely used in 
> further operations.

Ok, I'll submit a bug report.

> 
> - Are you sure you want to compute the union of the bounding boxes, 
> rather than the bounding box that contains them both?  If the latter is 
> the case, perhaps the ST_extent function is what you want.  (In raw 
> GEOS, there should be an Envelope.expandToInclude function which does this)

Good point, you are right.

However, is this another bug then?

select astext(extent(GeomFromText('POINT(-104 40)')))

"POLYGON((-104 40,-104 40,-104 40,-104 40,-104 40))"


But luckily, this actually works:

select astext(extent(collect(envelope(GeomFromText('POINT(-104 40)')), 
envelope(GeomFromText('POINT(-105 39)')))))

"POLYGON((-105 39,-105 40,-104 40,-104 39,-105 39))"

So that solves my issue.

I will file these both as bug reports - thanks for your help Martin!

Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070907/a4048747/attachment.bin>


More information about the postgis-users mailing list