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.

  • 1
    what sort of spatial analysis? – Ian Turton Sep 18 '13 at 6:09
4
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.

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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