[postgis-users] unioning a buffer - bug?

Lee quimby5 at yahoo.com
Wed Sep 15 12:09:41 PDT 2010


okay so I plotted those points that were in the topology exception error, and 
narrowed it down to two adjacent polygons.  So now I have:
select st_union(st_buffer(the_geom,0.1)) from base.current_assessment_parcel 
where gid in (36,37)
(returns the topology exception)

Checking out those two parcels, they seem legit in qgis / arcview. (no weird 
nodes that I can see).  


Attached is the output from the following query: select gid, st_asewkt(the_geom) 
from base.current_assessment_parcel where gid in (36,37) 

I'm relatively newbie to postgis, so can't see what might be causing this, if 
someone could look at this for me?

 unfortunately, I am on vacation starting tonight, and won't be available to 
provide further details. If the answer is "your polygons are just messed up" 
then so be it. These are from someone elses shapefile. Just want to help if this 
is indeed a bug.

Thanks for your help Kevin.
Lee.





________________________________
From: Kevin Neufeld <kneufeld at refractions.net>
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Sent: Tue, September 14, 2010 10:49:25 PM
Subject: Re: [postgis-users] unioning a buffer - bug?

Interesting.  Something sure sounds amiss.  Are the results null?  Is there 
anything usual occurring at the TopologyException location?  Is your dataset 
large?  Can you winnow it down to the few polygons that might be causing the 
problem (this may be just the polygons around the TopologyException location)?  
If so, you could paste the representation of the geometries in PasteBin or 
something so we can help you isolate the problem.

Also, what version of GEOS do you have installed?
SELECT PostGIS_Full_Version();

Cheers,
Kevin

On 9/14/2010 6:03 AM, Lee wrote: 
Hi Kevin,
>
>I assumed I have no results because when I load one of the working queries as a 
>view (eg. select st_buffer(the_geom,0.1)) in QGIS, or in ArcGIS, I see all my 
>results as I would expect, but when I modify the query to st_union(st_buffer()), 
>all my parcels disappear and I have a blank canvas.
>
>Also, with st_isvalid(st_union(st_buffer(the_geom,0.1))) returning null (neither 
>t nor f) I guess I just assumed.  Anyways, results for your suggestions are 
>inline, below.  
>
>
>
>Thanks for your help. Any further ideas?
>
>Lee.
>
>
________________________________
From: Kevin Neufeld <kneufeld at refractions.net>
>To: postgis-users at postgis.refractions.net
>Sent: Tue, September 14, 2010 12:12:46 AM
>Subject: Re: [postgis-users] unioning a buffer - bug?
>
>How are you determining you have no results?  
>
>Try:
>CREATE TABLE results AS
>SELECT st_union(st_buffer(the_geom,0.1)) as the_geom 
>FROM base.current_assessment_parcel;
>
>NOTICE:  TopologyException: found non-noded intersection between 586714 
>4.95189e+006, 586714 4.95189e+006 and 586714 4.95189e+006, 586739 4.9519e+006 
>586714 4.95189e+006
>Query returned successfully with no result in 1078 ms.
>
>
>
>SELECT count(*) FROM results;
>
>1
>
>SELECT ST_Summary(the_geom) FROM results;
>
>This returns blank.
>
>
>(snip)
>
>-- Kevin
>
>On 9/13/2010 7:07 AM, Lee wrote: 
>So after some googling I see similar problems, but no solutions posted.
>>
>>I am trying to union a buffer, but the query is returning no results.  Here is 
>>ultimately what I would like to achieve:
>>
>>select st_union(st_buffer(the_geom,0.1)) as the_geom from 
>>base.current_assessment_parcel
>>
>>Here are some troubleshooting steps I have taken to try narrow it down:
>>
>>select st_isvalid(the_geom) a from base.current_assessment_parcel group by a
>>TRUE
>>
>>select st_isvalid(st_buffer(the_geom,0.1)) a from base.current_assessment_parcel 
>>group by a
>>TRUE
>>
>>select st_isvalid(st_union(the_geom)) from base.current_assessment_parcel
>>TRUE
>>
>>select st_isvalid(st_union(st_buffer(the_geom,0.1))) from 
>>base.current_assessment_parcel
>>NOTICE:  TopologyException: found non-noded intersection between 586714 
>>4.95189e+006, 586714 4.95189e+006 and 586714 4.95189e+006, 586739 4.9519e+006 
>>586714 4.95189e+006
>>Total query runtime: 859 ms.
>>1 row retrieved.
>>(returns blank record)
>>
>>
>> And just for fun
>>select st_isvalid(st_buffer(st_union(the_geom),0.1)) a from 
>>base.current_assessment_parcel
>>TRUE
>>
>> 
>>I guess my next step would be to try the snap to grid functions, but the first 
>>query above should work, shouldn't it?
>>
>>Any help appreciated. Thanks.
>>Lee
>>
>> _______________________________________________ postgis-users mailing list 
>>postgis-users at postgis.refractions.net 
>>http://postgis.refractions.net/mailman/listinfo/postgis-users 
>>
> _______________________________________________ postgis-users mailing list 
>postgis-users at postgis.refractions.net 
>http://postgis.refractions.net/mailman/listinfo/postgis-users 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100915/150e4272/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ewkt.csv
Type: application/octet-stream
Size: 591 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100915/150e4272/attachment.obj>


More information about the postgis-users mailing list