[GRASS-user] ... getting rid of duplicate polygons ...

Markus Metz markus.metz.giswork at gmail.com
Wed Feb 15 00:32:15 PST 2017


On Fri, Feb 10, 2017 at 5:44 PM, Uwe Fischer <gisfisch at t-online.de> wrote:
>
> Hello list,
>
> I have a question about dealing with duplicate polygons (dp) coming into
GRASS from a polygon shapefile. The polygons are not overlapping or having
gaps, but there are a number of real duplicate ones (polygons show parcels
with owners, and if one parcel has two or more owners, e. g. wife and
husband, this situation in the shapefile is represented by two identical
polys with two database rows that only differ in the owners name).
>
> My goal is to get rid of duplicates, having a result with only one
polygon/centroid at a given location with only one owner name. The name
does not matter, it can be chosen arbitrary by the system. This works fine
when using ESRI "clean"-command. The structure of the database table is
maintained while one (or many) of the dp is/are lost, leaving only one
valid polygon.
>
> Now, I found an older thread called "unable to get rid of duplicate
polygons". Obviously, the problem/question is the same but I could not find
a solution for GRASS there.

There is no tool in GRASS that automatically removes all but one category
values from a feature. You would need to use the vector digitizer or v.edit.

Alternatively, you could create a copy of the vector, remove all categories
from layer 1 and 2 with
v.category type=centroid option=del cat=-1 layer=1
and
v.category type=centroid option=del cat=-1 layer=2

Then assign new categories with
v.category type=centroid option=add cat=1 layer=1

Finally try v.distance from=<cleaned vector> to=<original vector>
from_type=centroid from_layer=1 to_type=centroid to_layer=1 upload=to_attr
to_column=<column with owner name> column=<name of new column to be
populated>

Markus M

> So I tried:
>
> v.clean -c input=input at mapset output=output_clean tool=snap,rmdac,bpol
threshold=0.01,0,0
>
> and
>
> v.clean -c input=input at mapset output=output_clean
 tool=break,snap,rmdupl,rmdac,bpol
>
> Nothing did work. I get a map with tree layers, one showing the islands
only (layer 0), one showing the complete polygon set with duplicates (1),
and one showing only the duplicates (2). I also tried to delete layer 2,
assuming that this might remove the dp, but it only messed up the dataset.
>
>
>
> What am I doing wrong?
>
>
>
> Regards, Uwe
>
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170215/beb7eb0e/attachment.html>


More information about the grass-user mailing list