[postgis-devel] Invalid geometry from buffer

strk strk at keybit.net
Sat Jun 20 14:56:57 PDT 2009


Sorry, no problem in GEOS. 
This was just a strict postgis bug.

Problem is GEOS introduced typed EMPTY geoms
(POINT EMPTY, LINESTRING EMPTY, etc..)
but while postgis does accept the WKT it doesn't
properly handle that internally (liblwgeom level).

The short term solution is to convert any type
of EMPTY GEOS geom to the official and consistent
GEOMETRYCOLLECTION EMPTY postgis type.
This is consistent with:

	> select astext('POLYGON EMPTY');
	GEOMETRYCOLLECTION EMPTY

--strk;


On Sat, Jun 20, 2009 at 11:24:24PM +0200, strk wrote:
> 
> st_buffer('POLYGON((0 0, 10 0, 10 10, 0 0))', -3, 8);
> 
> The above returns a Polygon with a ring containing 0 points.
> It is invalid for postgis, and not all functions can deal with that.
> For example the canonical text output and area() can't, summary() can.
> 
> Martin, does JTS return the same weird polygon rather than a
> POLYGON EMPTY ?
> 
> --strk;
> 
>  Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
>  http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 

-- 

 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
 http://foo.keybit.net/~strk/services.html  /\  Keep it simple! 



More information about the postgis-devel mailing list