I'm looking for the best ways to 'group' a budge of block polygons in a new polygon that should be the town.

My block layer is something like this: enter image description here

Or zoomed: enter image description here

And I'm looking to get something like this polygon (the left one): enter image description here

Could somebody tell me some indications of how to get something like this? I'm not looking for the best accuracy, but something close to town or city polygons.

I thought in a convex hull, but the problem is that the block layer are a lot of polygons, instead of an irregular one.

I'm sure that PostGIS has some process that approximates to my goal, but I can't find it.

  • 1
    Hi, The green areas, have they a town or village ID?
    – huckfinn
    Feb 2, 2014 at 11:57
  • 1
    How unsharp the result could be? Is a temprary raster a option or should all border vetrices be present in/on the hull
    – huckfinn
    Feb 2, 2014 at 12:49

4 Answers 4


As your polygon example is not convex, I would rather use some "morphological math" tricks. You dilate your polygons so that closeby polygons will touch each others and fill the gaps of your streets, then you erode the block so that the contour is the same as the origin.

In practice, you can do it with vectors using the buffer tool. After first positive buffering, then you dissolve all the overlapping polygon, finally you use the same buffer value as a negative buffer.

The "optimal" buffer size could need some trial/error : it will depend of your definition to consider the "urban island" being part or not of the main city block.


In PostGIS, use ST_Collect to collect your block geometries into one geometry. Then use ST_ConvexHull to get the convex hull, or try ST_ConcaveHull to get a better fit at the cost of more CPU.


I think there is more detail required in your question.

But maybe you could select the shapes by using a rectangle or polygon, then use the Merge Shapes Tool. Maybe then also add a buffer before that step if you want the final shape to be more contiguous.


I saw that the solution was easier than I thought.

Finally I decided using a dissolved buffer, and then a convex hull.

As my project is a country scale, I don't need much accuracy.

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.