I have a multi polygon with spatial field layer with and 3000 records and I want to use dissolve all in 1 record.

On DISSOLVE algorithm in QGIS you have a choose to dissolve all features from layer that I want with PostGIS.

After the query I want to have one record and this record have all.

I test this query :

SELECT (ST_Dump(ST_union(geom))).geom::geometry(POLYGON,2100) FROM public.parcel1

but don't work; don't create me one record with all features.

What have I done wrong?

  • 3
    select st_union(geom) geom from parcel1 – ziggy Sep 23 '17 at 15:02
  • 2
    the query you have is breaking up the spatial table into many singlepart features – ziggy Sep 23 '17 at 15:02
  • @Ziggy that export if I use your details is multipolygon or polygon ? – Chris Papas Sep 23 '17 at 15:41
  • "that export"? dont know what you are talking about. it will be a multipolygon – ziggy Sep 23 '17 at 16:13

To condense all the geometries in a table to one single geometry, you can pass an array to ST_Union:

| improve this answer | |
  • 1
    ST_Union has an aggregate function variant, so you should just be able to use SELECT ST_Union(geom) FROM tbl – dr_jts Jul 6 at 21:37
  • @dr_jts that's what we use – DPSSpatial Jul 7 at 1:33

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.