[GRASS-user] Unable to get rid of duplicate polygons

Daniel Lee lee at isi-solutions.org
Mon Apr 2 15:20:24 EDT 2012


Hi David,

Deleting duplicates that are only different in the cat column would
definitely be possible with SQL, but I don't know enough SQL to give you a
quick command for that. I think the relevant command would be v.extract.

Other than that, GRASS does have many fundamental differences compared to
other GIS - for example, that vectors are attached to tables, but not in
the sense that one entry in the table necessarily means one vector feature.
Features can e.g. be attached to several tables simultaneously, something
that is also possible with other GIS but functions differently. A good
description of the GRASS vector model is available here:
http://grass.osgeo.org/gdp/html_grass63/vectorintro.html

Hope that helps at least a little bit :)
Daniel

--

B.Sc. Daniel Lee
Geschäftsführung für Forschung und Entwicklung
ISIS - International Solar Information Solutions GbR
Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder

Deutschhausstr. 10
35037 Marburg
Festnetz: +49 6421 379 6256
Mobil: +49 176 6127 7269
E-Mail: Lee at isi-solutions.org
Web: http://www.isi-solutions.org

ISIS wird gefördert durch die Bundesrepublik Deutschland, Zuwendungsgeber:
Bundesministerium für Wirtschaft und Technologie aufgrund eines Beschlusses
des Deutschen Bundestages, sowie durch die Europäische Union,
Zuwendungsgeber: Europäischer Sozialfonds.
Zusätzliche Unterstützung erhält ISIS von dem Entrepreneurship Cluster
Mittelhessen, der Universität Marburg, dem Laboratory for Climatology and
Remote Sensing und dem GIS-Lab Marburg.




Am 2. April 2012 21:09 schrieb David J. Bakeman <dbakeman at comcast.net>:

> Markus Metz wrote:
>
>> On Sun, Apr 1, 2012 at 11:45 PM, David J. Bakeman<dbakeman at comcast.net>
>>  wrote:
>>
>>
>>> David J. Bakeman wrote:
>>>
>>>
>>>> Markus Neteler wrote:
>>>>
>>>>
>>>>> On Sun, Apr 1, 2012 at 9:45 PM, David J. Bakeman<dbakeman at comcast.net>
>>>>>  wrote:
>>>>>
>>>>>
>>>>>> I didn't find an answer in the archives so.
>>>>>>
>>>>>> I have a shapefile of polygons and some of the polygons are
>>>>>> duplicated.
>>>>>>  I
>>>>>> thought I could use v.clean tool=rmdupl to get rid of these polygons.
>>>>>>  I
>>>>>> use
>>>>>> v.in.ogr to read it in and I get the following:
>>>>>>
>>>>>> WARNING: 8 areas represent more (overlapping) features, because
>>>>>> polygons
>>>>>>          overlap in input layer(s). Such areas are linked to more
>>>>>> than 1
>>>>>>          row in attribute table. The number of features for those
>>>>>> areas
>>>>>> is
>>>>>>          stored as category in layer 2
>>>>>>
>>>>>> That is correct in that there are 8 duplicate polygons but the only
>>>>>> different attribute is the cat which grass added?  What am I missing?
>>>>>>  I
>>>>>> then tried v.clean tool=bpol,rmdupl and nothing changes it still has
>>>>>> the
>>>>>> 8
>>>>>> duplicates.  What am I doing wrong?
>>>>>>
>>>>>>
>>>>> I think that you need to add the break tool for v.clean.
>>>>>
>>>>>
>>>> Correct that was actually what I was using:  v.clean tool=break,rmdupl
>>>>
>>>> Looking closer I see that when I run v.clean it doesn't even report the
>>>> duplicates that v.in.ogr did but they are still there.  The only thing
>>>> that
>>>> differs in coordinates or attributes is the cat attribute that grass
>>>> added.
>>>>
>>>>
>>>>> I am using grass 6.3.0 on fedora core 14 linux.
>>>>>>
>>>>>>
>>>>> Please note that you can upgrade to grass-6.4.0-4.fc14:
>>>>> http://koji.fedoraproject.org/**koji/buildinfo?buildID=263115<http://koji.fedoraproject.org/koji/buildinfo?buildID=263115>
>>>>>
>>>>>
>>>> Thanks I'll see if I can upgrade.
>>>>
>>>>
>>> I upgraded to the 6.4.0 and the results are exactly the same.  The
>>> polygons
>>> really are identical in every respect except for they have different
>>> values
>>> in the cat column.  Is there some other grass tool for removing this
>>> kind of
>>> duplicate?
>>>
>>>
>> After import with v.in.ogr, there are no duplicate geometries left in
>> the vector. What you have now is some areas with two categories
>> assigned to them. Removing the duplicates means in this case removing
>> one of the two categories, for example with one of the vector
>> digitizers.
>>
>>
> I'm relatively new to grass but that doesn't make sense.  I started with a
> shapefile with duplicate features.  That is polygons with the exact same
> attributes and geometry (they are identical).  What I thought grass could
> do for me was to read it in and delete one of the duplicates without user
> intervention.  After all it identifies the duplicates so why can't it
> delete one?
>
> Are you saying that the duplicate geometry was deleted but it kept both
> rows even though they were identical as well?  Is there a operation that
> would identify and delete rows that differ in only the cat attribute.
>
>  Markus M
>>
>>
>>
>
> ______________________________**_________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user<http://lists.osgeo.org/mailman/listinfo/grass-user>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20120402/585ad6cf/attachment.html


More information about the grass-user mailing list