Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to know what is the sense of using st_buffer operation. In PostGIS reference guide there is only the syntax and a short description of this operation.

Could you give some examples to understand the advantages of this operation?

share|improve this question
add comment

3 Answers 3

As Underdark comments ST_Dwithin is the recommended way of finding geometries at a distance. In many other gis-systems the buffer method is the only way but building buffers is quite costly.

But there is other use cases when you need to buffer. One reason can be to visualize a buffer. If you for instance wants to show the area closer than 100 meters from a highway, then you can make a buffer.

Another case is if you want to get the area 100 meters from the highway to be cut out from another map. Say you have a map showing areal usage and you want to analyze how much of the area closer than 100 meters from the highway is forest and how much is agriculture area. Then you make a buffer and creates an intersection with the area usage map.

There is an example on page 8-10 on this tutorial:
http://postgisonline.org/map.php?tutorial=mixed_examples.html

/Nicklas

share|improve this answer
add comment

OpenGeo provides a pretty good summary of ST_Buffer. Note the ability to pass a negative buffer radius.

The buffer function is also a useful work around at times. By passing a buffer radius of zero, you can build a footprint of a collection of geometries or "repair" an invalid polygon geometry.

share|improve this answer
add comment

ummm to do a buffer? That's all it really does.

I wouldn't really call this a short description http://www.postgis.org/documentation/manual-svn/ST_Buffer.html

A use case is if you want to select all the objects in one table that are within 20m of each object in another table.

share|improve this answer
3  
I think it's recommended to use ST_Distance for that use case. –  underdark Sep 18 '11 at 10:48
1  
No it's recommended to use ST_DWithin as Nicklas mentioned. ST_Distance is slow because it doesn't use an index. ST_DWithin uses an index and has short-circuit logic so it doesn't have to completely compute distance to figure out if 2 things are within the distance you specify. ST_Buffer should really only be used for visualization –  LR1234567 Sep 19 '11 at 14:02
    
I read what I expected to read, not what was written :-) –  Nicklas Avén Sep 21 '11 at 8:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.