3

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.

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178
vibin
  • 125
  • 3
  • 11

2 Answers2

6
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.

artwork21
  • 35,114
  • 8
  • 66
  • 134
simpleuser001
  • 3,864
  • 18
  • 21
3

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/

RyanKDalton
  • 23,068
  • 17
  • 110
  • 178