Need to Implement Spatial Analysis in Postgresql. Can Any one guide me to accomplish the spatial analysis eg) 2 km buffer for road network layer.

  • 1
    what sort of spatial analysis?
    – Ian Turton
    Commented Sep 18, 2013 at 6:09

2 Answers 2

SELECT x.* from table road as r , x where ST_Intersects(STBuffer(r.the_geom, 2000), x.the_geom) IS TRUE 

assuming that you want all colums from table x intersect road+2km buffer area (and used projection uses meters) . You can also use faster ST_DWithIN(r.geom, x.geom, 2000) (see Postgis Manual)

I cant guess what kind analysis you want to after that but that should point you into right direction.


If you are trying to create a buffered featured, ST_Buffer will work. If you are trying to select other features based upon a distance of your road network, you should consider using ST_DWithin, both as @simplexio suggested.

See similar questions that should help you out:

If you are just getting started with PostGIS, I think you would probably benefit by going through the material presented in other questions already on GIS.StackExchange.

Additionally, purchasing & reading the book "PostGIS in Action" would be helpful, as well as reading the many helpful tutorials on the publishers blog at http://www.bostongis.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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