[postgis-users] Buffering a multipolygon gives Empty Geometry.

Paul Ramsey pramsey at refractions.net
Wed May 12 15:48:36 PDT 2004


OK, here is the odd bit about your examples: they are both buffer(0) 
cases. What are you trying to accomplish with this?
That said, they should still work, so perhaps our buffer(0) semantics in 
GEOS far fubar.
I found that example 1 worked with a positive buffer, but with 0 my test 
platform gave the same results as yours, an empty geometrycollection.

Paul

rm_postgis at cheapcomplexdevices.com wrote:

> A have a number of valid (acording to isvalid()) geometries that I can't 
> seem to manipulate with PostGIS.  Some give errors (including crashing the 
> backend), and others give unexpected results such as a buffer of a
> multipolygon returning a GEOMETRYCOLLECTION(EMPTY).
> 
> Any pointers in to how I can best track down and debug this
> kind of problem would be appreciated.  I'm currently using 
> postgresql-7.4.2 and postgis0.8.1.   I scanned the mailinglist
> for "buffer empty" without too much success.
> 
>   Thanks in advance,
>   Ron
> 
> Attached are two such examples:
> 
> a. This simple (no holes, only one polygon) MULTIPOLYGON
>    gives an error when I buffer it.  isvalid() suggests
>    that it is a valid geometry, and The "JTS Test Builder" 
>    program happily creates a buffer with no errors.   I think
>    this polygon is cenid=c1452, polyid=11454 from the 2003 TIGER data.
> 
>    ronmap=# select isvalid(the_geom),buffer(the_geom,0) from
>     (select GeometryFromText('MULTIPOLYGON (((-120.013013 34.752622,
>      -120.012962 34.752689, -120.013045 34.753376, -120.012934 34.754314,
>      -120.012406 34.75484, -120.011658 34.75516, -120.011075 34.755251,
>      -120.0098 34.755754, -120.009799 34.755869, -120.009993 34.756121,
>      -120.009938 34.756212, -120.009466 34.756258, -120.009465 34.756647,
>      -120.009715 34.757173, -120.00966 34.757425, -120.009492 34.757516,
>      -120.008716 34.757218, -120.008439 34.757287, -120.007634 34.757927,
>      -120.007273 34.758545, -120.007245 34.759232, -120.007522 34.760033,
>      -120.007466 34.760468, -120.007216 34.760971, -120.007105 34.761932,
>      -120.006882 34.762618, -120.005967 34.763762, -120.006216 34.763762,
>      -120.007271 34.762367, -120.007382 34.761566, -120.007771 34.760834,
>      -120.008104 34.760468, -120.008992 34.759805, -120.009103 34.759622,
>      -120.009574 34.759393, -120.009769 34.759118, -120.009937 34.758066,
>      -120.009854 34.757379, -120.010242 34.756784, -120.011075 34.755915,
>      -120.011325 34.755435, -120.011574 34.755297, -120.012046 34.755252,
>      -120.012573 34.754955, -120.012684 34.754772, -120.013128 34.754451,
>      -120.013183 34.753971, -120.013239 34.753261, -120.013013
>      34.752622)))',-1) as the_geom
>     ) as a;
>    ronmap=#
>     isvalid |              buffer               
>    ---------+-----------------------------------
>     t       | SRID=-1;GEOMETRYCOLLECTION(EMPTY)
> 
> 
> b. This geomunion of 100+ polygons ( Los Padres National Forest, from
>    the 2003 TIGER data, I believe ) crashes the backend.
> 
>     ronmap=#    
>     select laname,geomunion(buffer(the_geom,0))
> 	 from rtgr_landpoly
> 	 join (select * from tmp_interestingland order by totarea desc
> 		      limit 1 offset 30) as a 
> 	using (land,cfcc,laname)
> 	where area(buffer(the_geom,0))>0 group by laname;
>     ronmap=# ronmap-# ronmap-# ronmap-# ronmap-# server closed the connection 
>     unexpectedly
> 	    This probably means the server terminated abnormally
> 	    before or while processing the request.
>     The connection to the server was lost. Attempting reset: Failed.
>     !> 
>     !> 
>     !> \q
>     [25]localhost:~/work/map% 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632
      \_



More information about the postgis-users mailing list