<div dir="ltr"><br><br>On Mon, Aug 20, 2018 at 4:11 PM, Mira Kattwinkel <<a href="mailto:kattwinkel-mira@uni-landau.de">kattwinkel-mira@uni-landau.de</a>> wrote:<br>><br>> Dear list,<br>><br>> I dissolve a vector map of lakes based on the names of the features (v.dissolve). As many of the features do not have names, I get, among the others, one new feature built up by many parts.<br>><br>> v.dissolve input=lakes@PERMANENT column=name output=lakes_diss<br>> I do get a warning during the dissolve:<br>> ...<br>> WARNING: Number of centroids exceeds number of areas: 44345 > 43502<br>> WARNING: Number of duplicate centroids: 1237<br>><br>> This results in 932 features with one containing the majority of lakes (those without a name). Then, I want to calculate the area (v.to.db) but this gives a wrong result because I need the area of every single lake.<br>><br>> This is the same problem as described here <a href="https://lists.osgeo.org/pipermail/grass-user/2011-January/059282.html">https://lists.osgeo.org/pipermail/grass-user/2011-January/059282.html</a> and I followed the advice given by Markus. However, I still get one big feature without a name and get error messages when calculating the area. Can anybody please give me an hint what's going wrong?<br>><br>> Here are the steps:<br>> 1. delete categories:<br>><br>> v.category input=lakes_diss@PERMANENT output=lakes_diss_wocat option=del cat=-1<br>> Processing features...<br>> Copying attribute table(s)...<br>> Building topology for vector map <lakes_diss_wocat@PERMANENT>...<br>> Registering primitives...<br>> 88399 primitives registered<br>> 1409269 vertices registered<br>> Building areas...<br>> 43502 areas built<br>> 43426 isles built<br>> Attaching islands...<br>> Attaching centroids...<br>> Number of nodes: 45215<br>> Number of primitives: 88399<br>> Number of points: 0<br>> Number of lines: 0<br>> Number of boundaries: 45291<br>> Number of centroids: 43108<br>> Number of areas: 43502<br>> Number of isles: 43426<br>> v.category complete. 43108 features modified.<br>> (Mon Aug 20 15:59:30 2018) Command finished (3 sec)<br><div>> --> still 932 features in attribute table</div><div><br></div><div>v.category deletes categories from geometries, but does not touch the attribute table. Since you deleted all categories in layer 1, you should also delete the attribute table linked to layer 1 with</div><div>v.db.droptable map=lakes_diss_wocat layer=1 -f<br></div>><br>> 2. add category<br><div>> v.category input=lakes_diss_wocat@PERMANENT output=lakes_diss_wcat option=add</div><div><br></div><div>you should specify the geometry type for which categories should be added, here type=centroid</div><div><br></div><div>Alternatively, you could use with GRASS 7.5<br></div><div>v.extract input=lakes dissolve_column=name type=area output=lakes_diss<br></div><div><br></div><div>Markus M</div><div><br></div><div><br></div>> Processing features...<br>> Copying attribute table(s)...<br>> Building topology for vector map <lakes_diss_wcat@PERMANENT>...<br>> Registering primitives...<br>> 88399 primitives registered<br>> 1409269 vertices registered<br>> Building areas...<br>> 43502 areas built<br>> 43426 isles built<br>> Attaching islands...<br>> Attaching centroids...<br>> Number of nodes: 45215<br>> Number of primitives: 88399<br>> Number of points: 0<br>> Number of lines: 0<br>> Number of boundaries: 45291<br>> Number of centroids: 43108<br>> Number of areas: 43502<br>> Number of isles: 43426<br>> v.category complete. 43108 features modified.<br>> (Mon Aug 20 16:02:07 2018) Command finished (3 sec)<br>> --> 932 features in attribute table<br>><br>> 3. add new column and populate with area<br>><br>> v.db.addcolumn map=lakes_diss_wcat@PERMANENT columns=area double<br>><br>> v.to.db map=lakes_diss_wcat@PERMANENT option=area columns=area<br>> Reading areas...<br>> Updating database...<br>> WARNING: Record (cat 933) does not exist (not updated)<br>> [a long long list...]<br>> 43108 categories read from vector map (layer 1)<br>> 932 records selected from table (layer 1)<br>> 932 categories read from vector map exist in selection from table<br>> 42176 categories read from vector map don't exist in selection from table<br>> 932 records updated/inserted (layer 1)<br>><br>> Thanks a lot,<br>> Mira<br>><br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br></div>