2

I need to create buffer for a point feature, but the buffer area will be restricted within the land area only.

For example consider the following: A buffer of say 500 km radius is to be generated around Washington or Rome. However the generated buffer will be covering the land area of US(west-ward) or Europe(towards east or north) only, respectively and not the water areas.

How can I achieve this, preferably in PostGIS. The input tables will be land area boundary polygons and a point layer.

1 Answer 1

3

You can't in one step. It's a two step procedure. BUT you can simulate the behaviour by creating your buffer as a subquerry. Afterwards you 'select' the buffer area that intersects with your land polygon eg:

WITH buffer AS 
       (select st_buffer(point.geom,500000) as geom from data.point_table) 

SELECT ST_Intersection(buffer.geom,land.geom) from buffer, data.land_table;

Make sure your Spatial Indexed are populated, otherwise it might take a LONG time to complete (depending on your complexity of your data)

To populate the Spatial Indexes just run VACUUM ANALYZE [tablename];

If you haven't create a spatial index you can create one like this:

CREATE INDEX [indexname] ON [tablename] USING GIST ( [geometrycolumn] );
1
  • I did not get your point. If I am not wrong, you said first I need to create the buffer and then intersect it with the land polygon. I do not have any problem, it being a multi step job. But the process you said will decrease the buffer area, deleting areas in the ocean. But I need the actual area, eg. the final buffer generated will have area equals to pirr, r being the buffer radius. Please correct me if I am wrong.
    – thelastray
    Commented Dec 2, 2013 at 10:05

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.