As I am unfamiliar with any tools I decided to try my luck with PostGis. I imported my data. and executed the query :
create merged as select delomrade_code, st_union(geometry) from grunnkrets group by delomrade_code
it seems to be doing a much better job on my data. first it executed in minutes not in hours. and the result set has only 6 MULTIPOLYGONS out of 1546 as oppose to over 200 I got with the Spatialite.
I'm OK with this result and will try to dig deeper and understand why I couldn't get these 6 areas as I wanted.
I'm new to GIS. I have seen relevant and possibly duplicate questions but can't solve this problem.
I'm using Spatialite. I have a table with the basic statistical area units of norway (Grunnkrets) - 13990 polygons. I added a column to the table named "delomrade_code" with the code of groups of these smaller polygons - 2224 unique values.
I'm trying to convert the these 13990 polygons to 2224 bigger polygons containing these smaller polygons.
first I tried running the query :
select delomrade_code, GUnion(Geometry) as geometry from Grunnkretser group by delomrade_code
The result geometry column has mostly polygons (success) but a few hundred lines contain MULTIPOLYGONS. I need the result to be polygons only. what do I need to do in order to try to avoid the multipolygons in the result ?
I suspect there is some minor difference in LatLng of point in adjoining polygons and therefore GUnion fails to merge these polygons. I then tried running :
select delomrade_code, GUnion(Buffer(Geometry, 0.02)) as resulting_polygon from grunnkretser group by delomrade_code
results were better, more of the 2224 rows in the result were polygons but still not all.
The documentation of the
Buffer function says :
return a geometric object defined by buffering a distance d around geom, where dist is in the distance units for the Spatial Reference of geom
How do I find my :
...distance units for the Spatial Reference of geom