[postgis-users] negative buffer

Torsten Lange tlange at gwdg.de
Wed Jan 21 03:12:11 PST 2009


Vincent, thank you for the suggestion!

The problem seems to be solved now! I googled a bit because not knowing 
what st_buffer(geom,0) really does and by the way found a former 
problem. This was solved by additionally dropping the 
enforce_geotype_geom-check constraint, which enabled 
st_buffer(st_buffer(geom,-i)0) to perform the job as expected - very nice!

So 3 question remain:
What does st_buffer(geom,0) - just optimising the segments of the polygone?
Before I dropped the constraint it prevented the insert of the buffer 
geometry because it complained to be violated. Dropping it 
st_isvalid()however gives TRUE. This is a bit confusing to me. Do I mix 
something here? And are invalid geometries now likely to produced by 
postgis functions in some cases due to dropping the geometry check?

Thank you, Torsten

>>I have polygons with sometimes very peculiar shapes 
>>representing the distribution limits of specific types of 
>>sediments (e.g. channel-like branching, fluvial fans...). 
>>When I try to create positive and negative buffers of that 
>>polygons using the combined 
>>(st_buffer(st_simply(geom,i)j)-method I succeed only in 
>>positive direction. In negative direction it very fastly 
>>violates enforce_geotype_geom-check. When I look on the last 
>>results I see, it is related to the channel-like branches. 
>>Using the buffer-method in ArcGIS it works as expected. Is 
>>there a clever method getting it work in PostGIS too?
>>    
>>
>
>As for getting negative buffers to be valid geometries, I generally use
>the 0-buffer trick as in :
>st_buffer(st_buffer(geom, -i), 0). Not 100% sure it will work but it
>generally fixes a lot of problems.
>
>Let us know of the results if you try that with your data.
>
>Vincent
>  
>




More information about the postgis-users mailing list