Is there any open-source library to aggregate detached polygons?

I know that there is a tool in ArcInfo, but it is commercial.

  • Knowing which tool in ArcInfo are you trying to replicate would be helpful. Are you referring to the Dissolve function? or something else? Apr 30, 2012 at 17:57
  • I assume Sanjeewa means the actual 'Aggregate Polygons' tool (requires ArcInfo). In ArcGIS 10 it is under the Generalization tools of the Cartography toolbox. It produces a sort-off concave-hull for want of a better term. May 3, 2012 at 14:02

5 Answers 5


if you have PostgreSQL, there is a sql function which have been writed from Dr. Horst Duester. he has two sql code, one is for Orthogonal Aggregation of Buildings and another is for non Orthogonal Aggregation... you can find sql codes here.

it determines edge of objects very good way with defination of threshold..and its query is so easy to use:


select aggregatepolygons(wkb_geometry, 50, true) from buildings group by art;


Orthogonal Aggregation of Buildings

figure 1

Non Orthogonal Aggregation of Natural Objects

enter image description here

i hope it helps you...

  • 1
    The link to the code is broken. Could anyone add this code here again? Jan 3, 2018 at 16:35

Try the Java Topology Suite (JTS). There is a user guide which has a heading "How to Union Many Polygons Efficiently".

  • Union is different to "Aggregation" (in the ArcGIS sense, which might also be called "Concave Hull of Polygons". This is now in JTS 1.19
    – dr_jts
    Aug 28, 2022 at 1:53

PostGIS has a ST_ConcaveHull function which equates closely to the Aggregate Polygons function of ArcGIS. Sadly Spatialite does NOT have this function.

A concave hull can be thought of as a "shrink-wrapped" convex hull.

  • Also, in PostGIS 3.3 ST_ConcaveHull has been enhanced to respect polygon boundaries, which is required to operate correctly for polygonal inputs.
    – dr_jts
    Aug 28, 2022 at 2:00

Also, Sextante is a GIS library for Java. It may include that functionality - http://www.sextantegis.com/


The aggregatepolygons function is published at github under:


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.