[GRASS-user] importing and cleaning overlapping polygons that are supposed to overlap

Margherita Di Leo diregola at gmail.com
Wed May 15 02:56:31 PDT 2019

Ciao Vero,

shapefile is not a good choice in this case for exporting such geometry
because is not apt to store topological information. You may want to export
your dataset in a different format, e.g. geopackage.

Hope this helps,

On Tue, May 14, 2019 at 11:47 PM Veronica Andreo <veroandreo at gmail.com>

> Hi all,
> I was working today with a very simple vector map which corresponds to
> clusters (circular polygons) that overlap and it is just fine that they
> overlap. So, i received a shapefile with 3 of these clusters. Two of them
> overlaped. When I import them into GRASS with v.import I get an extra
> centroid and area where 2 of the polygons overlap.
> Problem arises when I want to query a raster map with those polygons since
> originally the attribute table contained only 3 polygons (which is just
> fine). However, v.what.rast will only upload values for 2 of those three
> polygons because it finds 2 centroids with the same category, AFAIU.
> I tried with
> v.clean input=clusters output=clusters_clean1 tool=break,rmdupl,rmsa,rmdac
> and
> v.clean input=clusters type=centroid output=clusters_clean2 tool=rmdupl
> but nothing seemed to do the kind of cleaning I wanted. I ended up using
> brute force and removing the extra centroid manually in the GUI. That
> helped with v.what.rast (all cats in the attr table were updated) but part
> of the original and correct geometry was clearly gone. I am sure that's not
> the right combination nor the right way either.
> In the wiki [0], I only found this piece of text: "If the *input polygons
> have logical errors*.... You can investigate overlapping areas in the
> imported vector with 'd.vect
> <https://grass.osgeo.org/grass76/manuals/d.vect.html> yourmap type=area
> layer=2' (only overlapping areas have a category in layer 2 after import).
> Additionally you may show the centroids of layer=2 to easier find tiny
> overlapping areas with 'd.vect
> <https://grass.osgeo.org/grass76/manuals/d.vect.html> yourmap
> type=centroid layer=2'"
> However, it says nothing about how to proceed further as to keep correctly
> overlapping polygons, each with its own centroid and remove the duplicated
> ones that are generated when importing.
> Can someone please share the set of steps that should be followed in these
> cases? Maybe it's a silly question, but I'm more a raster person so I am
> very easily lost with vector issues.
> Thanks much in advance!
> Vero
> [0] https://grasswiki.osgeo.org/wiki/Vector_topology_cleaning
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user

Margherita Di Leo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190515/82b12f81/attachment.html>

More information about the grass-user mailing list